@@ -13,7 +13,9 @@ |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | $basePath = $_SERVER['argv'][1]; |
16 | -if($basePath[0] != '/') $basePath = getcwd() . '/' . $basePath; |
|
16 | +if($basePath[0] != '/') { |
|
17 | + $basePath = getcwd() . '/' . $basePath; |
|
18 | +} |
|
17 | 19 | |
18 | 20 | // SilverStripe bootstrap |
19 | 21 | define('BASE_PATH', realpath($basePath)); |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // Argument parsing |
10 | -if(empty($_SERVER['argv'][1])) { |
|
10 | +if (empty($_SERVER['argv'][1])) { |
|
11 | 11 | echo "Usage: {$_SERVER['argv'][0]} (site-docroot)\n"; |
12 | 12 | exit(1); |
13 | 13 | } |
14 | 14 | |
15 | 15 | $basePath = $_SERVER['argv'][1]; |
16 | -if($basePath[0] != '/') $basePath = getcwd() . '/' . $basePath; |
|
16 | +if ($basePath[0] != '/') $basePath = getcwd().'/'.$basePath; |
|
17 | 17 | |
18 | 18 | // SilverStripe bootstrap |
19 | 19 | define('BASE_PATH', realpath($basePath)); |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | $_SERVER['HTTP_HOST'] = 'localhost'; |
24 | 24 | chdir(BASE_PATH); |
25 | 25 | |
26 | -if(file_exists(BASE_PATH.'/sapphire/core/Core.php')) { |
|
26 | +if (file_exists(BASE_PATH.'/sapphire/core/Core.php')) { |
|
27 | 27 | //SS 2.x |
28 | - require_once(BASE_PATH . '/sapphire/core/Core.php'); |
|
29 | -} else if(file_exists(BASE_PATH.'/framework/core/Core.php')) { |
|
28 | + require_once(BASE_PATH.'/sapphire/core/Core.php'); |
|
29 | +} else if (file_exists(BASE_PATH.'/framework/core/Core.php')) { |
|
30 | 30 | //SS 3.x |
31 | - require_once(BASE_PATH. '/framework/core/Core.php'); |
|
32 | -} else if(file_exists(BASE_PATH.'/vendor/silverstripe/framework')) { |
|
31 | + require_once(BASE_PATH.'/framework/core/Core.php'); |
|
32 | +} else if (file_exists(BASE_PATH.'/vendor/silverstripe/framework')) { |
|
33 | 33 | //SS 4.x |
34 | - require_once(BASE_PATH. '/vendor/autoload.php'); |
|
34 | + require_once(BASE_PATH.'/vendor/autoload.php'); |
|
35 | 35 | $kernel = new SilverStripe\Core\CoreKernel(BASE_PATH); |
36 | 36 | //boot the parts of the kernel to populate the DB config |
37 | 37 | foreach (array('bootDatabaseEnvVars', 'bootDatabaseGlobals') as $bootMethod) { |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | } |
42 | 42 | $databaseConfig = SilverStripe\ORM\DB::getConfig(); |
43 | 43 | } else { |
44 | - echo "Couldn't locate framework's Core.php. Perhaps " . BASE_PATH . " is not a SilverStripe project?\n"; |
|
44 | + echo "Couldn't locate framework's Core.php. Perhaps ".BASE_PATH." is not a SilverStripe project?\n"; |
|
45 | 45 | exit(2); |
46 | 46 | } |
47 | 47 | |
48 | 48 | $output = array(); |
49 | -foreach($databaseConfig as $k => $v) { |
|
50 | - $output['db_' . $k] = $v; |
|
49 | +foreach ($databaseConfig as $k => $v) { |
|
50 | + $output['db_'.$k] = $v; |
|
51 | 51 | } |
52 | 52 | $output['assets_path'] = ASSETS_PATH; |
53 | 53 |