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