1 | <?php |
||
11 | class Bootstrap |
||
12 | { |
||
13 | /** |
||
14 | * Ensure SilverStripe is loaded and configured |
||
15 | */ |
||
16 | 1 | public function initialize() |
|
25 | |||
26 | /** |
||
27 | * Find and require SilverStripe. This will look in: |
||
28 | * |
||
29 | * - The current working directory (for when installed globally with composer) |
||
30 | * - The next directory up (for when installed locally into a SilverStripe project) |
||
31 | * - The console's "silverstripe" directory (for when installed in a build process) |
||
32 | * |
||
33 | * @return bool |
||
34 | */ |
||
35 | 1 | protected function findSilverStripe() |
|
47 | |||
48 | /** |
||
49 | * Get the SilverStripe DB connector |
||
50 | * |
||
51 | * @return $this |
||
52 | */ |
||
53 | 1 | protected function getDb() |
|
61 | } |
||
62 |
An exit expression should only be used in rare cases. For example, if you write a short command line script.
In most cases however, using an
exit
expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.