@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function _d( $string ) { |
|
| 3 | +function _d($string) { |
|
| 4 | 4 | die($string); |
| 5 | 5 | } |
| 6 | 6 | |
@@ -8,9 +8,9 @@ discard block |
||
| 8 | 8 | _d('Phalcon extension isn\'t installed. Please follow these instructions to install it: http://docs.phalconphp.com/en/latest/reference/install.html'); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | -function _if( $path, $name ) { |
|
| 11 | +function _if($path, $name) { |
|
| 12 | 12 | $filePath = $path.'/'.(ENVIROMENT == '' ? '' : ENVIROMENT.'/').$name; |
| 13 | - if ( !is_file($filePath) ) |
|
| 13 | + if (!is_file($filePath)) |
|
| 14 | 14 | $filePath = $path.'/'.$name; |
| 15 | 15 | return $filePath; |
| 16 | 16 | } |
@@ -25,17 +25,17 @@ discard block |
||
| 25 | 25 | | |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -define("ROOT_PATH", realpath( __DIR__."/../") ); |
|
| 28 | +define("ROOT_PATH", realpath(__DIR__."/../")); |
|
| 29 | 29 | |
| 30 | 30 | $pathConfigs = new \Phalcon\Config( |
| 31 | 31 | include_once __DIR__."/paths.php" |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | -define("SOLUTION_PATH", $pathConfigs->solution_path ); |
|
| 35 | -define("STORAGE_PATH", $pathConfigs->storage_path ); |
|
| 36 | -define("PUBLIC_PATH", $pathConfigs->public_path ); |
|
| 37 | -define("VENDOR_PATH", $pathConfigs->vendor_path ); |
|
| 38 | -define("GLOBAL_CONFIG_PATH", $pathConfigs->global_config_path ); |
|
| 34 | +define("SOLUTION_PATH", $pathConfigs->solution_path); |
|
| 35 | +define("STORAGE_PATH", $pathConfigs->storage_path); |
|
| 36 | +define("PUBLIC_PATH", $pathConfigs->public_path); |
|
| 37 | +define("VENDOR_PATH", $pathConfigs->vendor_path); |
|
| 38 | +define("GLOBAL_CONFIG_PATH", $pathConfigs->global_config_path); |
|
| 39 | 39 | |
| 40 | 40 | /* |
| 41 | 41 | |-------------------------------------------------------------------------- |
@@ -52,21 +52,21 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $configurationName = null; |
| 54 | 54 | if (PHP_SAPI === 'cli') { |
| 55 | - if ( isset( $_SERVER['argv'][1] ) AND strpos($argv[1], "@") !== FALSE ) { |
|
| 55 | + if (isset($_SERVER['argv'][1]) AND strpos($argv[1], "@") !== FALSE) { |
|
| 56 | 56 | $arguments = explode("@", $argv[1]); |
| 57 | 57 | $configurationName = $arguments[0]; |
| 58 | 58 | } |
| 59 | 59 | } else { |
| 60 | - if ( isset( $_SERVER['SERVER_NAME'] ) ) { |
|
| 60 | + if (isset($_SERVER['SERVER_NAME'])) { |
|
| 61 | 61 | $configurationName = $_SERVER['SERVER_NAME']; |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | -if ( !isset($solutionRouting->routing->$configurationName->name) ) { |
|
| 66 | - if ( isset( $solutionRouting->routing->default->name ) ) { |
|
| 65 | +if (!isset($solutionRouting->routing->$configurationName->name)) { |
|
| 66 | + if (isset($solutionRouting->routing->default->name)) { |
|
| 67 | 67 | $applicationName = $solutionRouting->routing->default->name; |
| 68 | 68 | $enviromentName = ""; |
| 69 | - if ( isset($solutionRouting->routing->default->enviroment) ) { |
|
| 69 | + if (isset($solutionRouting->routing->default->enviroment)) { |
|
| 70 | 70 | $enviromentName = $solutionRouting->routing->default->enviroment; |
| 71 | 71 | } |
| 72 | 72 | } else { |
@@ -75,16 +75,16 @@ discard block |
||
| 75 | 75 | } else { |
| 76 | 76 | $applicationName = $solutionRouting->routing->$configurationName->name; |
| 77 | 77 | $enviromentName = ""; |
| 78 | - if ( isset($solutionRouting->routing->$configurationName->enviroment) ) { |
|
| 78 | + if (isset($solutionRouting->routing->$configurationName->enviroment)) { |
|
| 79 | 79 | $enviromentName = $solutionRouting->routing->$configurationName->enviroment; |
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | define("ENVIROMENT", $enviromentName); |
| 84 | 84 | define("APPLICATION_NAME", $applicationName); |
| 85 | -define("APPLICATION_PATH", $pathConfigs->solution_path.APPLICATION_NAME."/" ); |
|
| 85 | +define("APPLICATION_PATH", $pathConfigs->solution_path.APPLICATION_NAME."/"); |
|
| 86 | 86 | |
| 87 | -if ( !is_dir( APPLICATION_PATH ) ) |
|
| 87 | +if (!is_dir(APPLICATION_PATH)) |
|
| 88 | 88 | _d("There is no application called \"".APPLICATION_NAME."\" in your apps folder."); |
| 89 | 89 | |
| 90 | 90 | /* |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | | loading of any our classes "manually". Feels great to relax. |
| 99 | 99 | */ |
| 100 | 100 | |
| 101 | -if ( !is_file( VENDOR_PATH.'autoload.php' ) ) { |
|
| 101 | +if (!is_file(VENDOR_PATH.'autoload.php')) { |
|
| 102 | 102 | _d("There is no autoload.php in your \"".VENDOR_PATH."\". Please update your vendor folder."); |
| 103 | 103 | } else { |
| 104 | 104 | require VENDOR_PATH.'autoload.php'; |