@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | $arguments['task'] = $appConfig->default_task; |
| 52 | 52 | $arguments['action'] = $appConfig->default_action; |
| 53 | 53 | |
| 54 | - if ( isset( $_SERVER['argv'][1] ) AND strpos($argv[1], "@") !== FALSE ) { |
|
| 54 | + if (isset($_SERVER['argv'][1]) AND strpos($argv[1], "@") !== FALSE) { |
|
| 55 | 55 | $itemNumber = 0; |
| 56 | 56 | $allArguments = explode("@", $argv[1]); |
| 57 | - if ( count($allArguments) === 2 ) |
|
| 57 | + if (count($allArguments) === 2) |
|
| 58 | 58 | { |
| 59 | 59 | $itemNumber = 1; |
| 60 | 60 | } |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $arguments['params'] = array(); |
| 69 | 69 | |
| 70 | - foreach($_SERVER['argv'] as $k => $arg) { |
|
| 71 | - if($k >= 2) { |
|
| 70 | + foreach ($_SERVER['argv'] as $k => $arg) { |
|
| 71 | + if ($k >= 2) { |
|
| 72 | 72 | $arguments['params'][] = $arg; |
| 73 | 73 | } |
| 74 | 74 | } |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | $output = $application->handle()->getContent(); |
| 84 | 84 | |
| 85 | 85 | // HTML Minification |
| 86 | - if ( $appConfig->html_minify ) { |
|
| 87 | - ob_start( function() use ($output) { |
|
| 88 | - $search = array( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
|
| 89 | - $replace = array( '>', '<', '\\1' ); |
|
| 86 | + if ($appConfig->html_minify) { |
|
| 87 | + ob_start(function() use ($output) { |
|
| 88 | + $search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'); |
|
| 89 | + $replace = array('>', '<', '\\1'); |
|
| 90 | 90 | $buffer = preg_replace($search, $replace, $output); |
| 91 | 91 | return $buffer; |
| 92 | 92 | }); |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $loader->registerNamespaces( |
| 28 | 28 | array( |
| 29 | - 'Modules\Common\Controllers' => __DIR__ . '/controllers/', |
|
| 30 | - 'Modules\Common\Models' => __DIR__ . '/models/', |
|
| 29 | + 'Modules\Common\Controllers' => __DIR__.'/controllers/', |
|
| 30 | + 'Modules\Common\Models' => __DIR__.'/models/', |
|
| 31 | 31 | ) |
| 32 | 32 | ); |
| 33 | 33 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public function registerServices(DiInterface $di) |
| 41 | 41 | { |
| 42 | 42 | // Registering a dispatcher |
| 43 | - $di->set('dispatcher', function () { |
|
| 43 | + $di->set('dispatcher', function() { |
|
| 44 | 44 | $dispatcher = new Dispatcher(); |
| 45 | 45 | $dispatcher->setDefaultNamespace("Modules\Common\Controllers"); |
| 46 | 46 | return $dispatcher; |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $appConfig = $di->get('config'); |
| 50 | 50 | $view = $di->get('view'); |
| 51 | - $view->setLayoutsDir( '_shared/'); |
|
| 51 | + $view->setLayoutsDir('_shared/'); |
|
| 52 | 52 | $view->setTemplateAfter($appConfig->view_layout_name); |
| 53 | - $view->setViewsDir( __DIR__ . '/views/'); |
|
| 53 | + $view->setViewsDir(__DIR__.'/views/'); |
|
| 54 | 54 | $di->set('view', $view); |
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | '.volt' => array( |
| 19 | 19 | 'type' => '\Phalcon\Mvc\View\Engine\Volt', |
| 20 | 20 | 'options' => array( |
| 21 | - 'compiledPath' => STORAGE_PATH . 'framework/views/', |
|
| 21 | + 'compiledPath' => STORAGE_PATH.'framework/views/', |
|
| 22 | 22 | 'compiledSeparator' => '_', |
| 23 | 23 | 'compiledExtension' => '.compiled', |
| 24 | 24 | 'stat' => TRUE |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | |
| 99 | 99 | 'namespaces' => array( |
| 100 | - 'Modules\Common' => APPLICATION_PATH . 'modules/common/', |
|
| 100 | + 'Modules\Common' => APPLICATION_PATH.'modules/common/', |
|
| 101 | 101 | ), |
| 102 | 102 | |
| 103 | 103 | /* |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | 'modules' => array( |
| 122 | 122 | 'common' => array( |
| 123 | 123 | 'className' => 'Modules\Common\Module', |
| 124 | - 'path' => APPLICATION_PATH . 'modules/common/module.php' |
|
| 124 | + 'path' => APPLICATION_PATH.'modules/common/module.php' |
|
| 125 | 125 | ) |
| 126 | 126 | ), |
| 127 | 127 | |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | */ |
| 306 | 306 | |
| 307 | 307 | 'paths' => array( |
| 308 | - APPLICATION_PATH . 'controllers/', |
|
| 309 | - APPLICATION_PATH . 'models/', |
|
| 310 | - APPLICATION_PATH . 'tasks/' |
|
| 308 | + APPLICATION_PATH.'controllers/', |
|
| 309 | + APPLICATION_PATH.'models/', |
|
| 310 | + APPLICATION_PATH.'tasks/' |
|
| 311 | 311 | ), |
| 312 | 312 | |
| 313 | 313 | /* |
@@ -25,10 +25,10 @@ |
||
| 25 | 25 | | |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | - 'databases' => array ( |
|
| 29 | - 'db' => array ( |
|
| 28 | + 'databases' => array( |
|
| 29 | + 'db' => array( |
|
| 30 | 30 | 'type' => '\Phalcon\Db\Adapter\Pdo\Mysql', |
| 31 | - 'config' => array ( |
|
| 31 | + 'config' => array( |
|
| 32 | 32 | 'host' => '127.0.0.1', |
| 33 | 33 | 'port' => 3306, |
| 34 | 34 | 'username' => 'root', |
@@ -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'; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | | |
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | -$di->set('error', function () { |
|
| 45 | +$di->set('error', function() { |
|
| 46 | 46 | return include_once APPLICATION_PATH."configs/error.php"; |
| 47 | 47 | }); |
| 48 | 48 | |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | include_once _if(APPLICATION_PATH."configs", "database.php") |
| 92 | 92 | ); |
| 93 | 93 | |
| 94 | -foreach ($dbConfig->databases as $name => $dbConfig ) { |
|
| 94 | +foreach ($dbConfig->databases as $name => $dbConfig) { |
|
| 95 | 95 | $di->set($name, function() use ($dbConfig, $di){ |
| 96 | 96 | $className = $dbConfig["type"]; |
| 97 | - $database = new $className($dbConfig["config"]->toArray()); |
|
| 97 | + $database = new $className($dbConfig["config"]->toArray()); |
|
| 98 | 98 | $database->connect(); |
| 99 | 99 | return $database; |
| 100 | 100 | }); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | | |
| 171 | 171 | */ |
| 172 | 172 | |
| 173 | -$di->set('assets', function () { |
|
| 173 | +$di->set('assets', function() { |
|
| 174 | 174 | $assetManager = new \Phalcon\Assets\Manager(); |
| 175 | 175 | return $assetManager; |
| 176 | 176 | }, true); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | |
| 189 | 189 | if (PHP_SAPI !== 'cli') { |
| 190 | - $di->set('url', function () { |
|
| 190 | + $di->set('url', function() { |
|
| 191 | 191 | global $di; |
| 192 | 192 | $appConfig = $di->get('config'); |
| 193 | 193 | $url = new \Phalcon\Mvc\Url(); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | | |
| 209 | 209 | */ |
| 210 | 210 | |
| 211 | -$di->set('crypt', function () { |
|
| 211 | +$di->set('crypt', function() { |
|
| 212 | 212 | global $di; |
| 213 | 213 | $appConfig = $di->get('config'); |
| 214 | 214 | $crypt = new \Phalcon\Crypt(); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | if (PHP_SAPI !== 'cli') { |
| 285 | 285 | |
| 286 | - $di->set('router', function () { |
|
| 286 | + $di->set('router', function() { |
|
| 287 | 287 | global $di; |
| 288 | 288 | $appConfig = $di->get('config'); |
| 289 | 289 | $router = new \Phalcon\Mvc\Router\Annotations(false); |