@@ -5,8 +5,8 @@ |
||
| 5 | 5 | # you like. |
| 6 | 6 | |
| 7 | 7 | # Install PSR-0-compatible class autoloader |
| 8 | -spl_autoload_register(function($class){ |
|
| 9 | - require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; |
|
| 8 | +spl_autoload_register(function($class) { |
|
| 9 | + require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')) . '.php'; |
|
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | 12 | # Get Markdown class |
@@ -51,18 +51,18 @@ |
||
| 51 | 51 | */ |
| 52 | 52 | public function setContext($context = 'development') { |
| 53 | 53 | |
| 54 | - switch($context) { |
|
| 54 | + switch ($context) { |
|
| 55 | 55 | |
| 56 | 56 | case 'production': |
| 57 | 57 | |
| 58 | 58 | break; |
| 59 | 59 | |
| 60 | 60 | case 'development': |
| 61 | - error_reporting(-1); // Report all type of errors |
|
| 62 | - ini_set('display_errors', 1); // Display all errors |
|
| 63 | - ini_set('output_buffering', 0); // Do not buffer output |
|
| 61 | + error_reporting(-1); // Report all type of errors |
|
| 62 | + ini_set('display_errors', 1); // Display all errors |
|
| 63 | + ini_set('output_buffering', 0); // Do not buffer output |
|
| 64 | 64 | |
| 65 | - set_exception_handler(function ($exception) { |
|
| 65 | + set_exception_handler(function($exception) { |
|
| 66 | 66 | echo "Anax: Uncaught exception: <p>" . |
| 67 | 67 | $exception->getMessage() . "</p><pre>" . |
| 68 | 68 | $exception->getTraceAsString() . "</pre>"; |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | * |
| 18 | 18 | */ |
| 19 | 19 | private $views = []; // Array for all views |
| 20 | - private $suffix; // Template file suffix |
|
| 21 | - private $path; // Base path for views |
|
| 20 | + private $suffix; // Template file suffix |
|
| 21 | + private $path; // Base path for views |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | return $this; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - mergesort($this->views[$region], function ($a, $b) { |
|
| 158 | + mergesort($this->views[$region], function($a, $b) { |
|
| 159 | 159 | $sa = $a->sortOrder(); |
| 160 | 160 | $sb = $b->sortOrder(); |
| 161 | 161 | |
@@ -16,10 +16,10 @@ |
||
| 16 | 16 | * Properties |
| 17 | 17 | * |
| 18 | 18 | */ |
| 19 | - private $template; // Template file or array |
|
| 19 | + private $template; // Template file or array |
|
| 20 | 20 | private $templateData = []; // Data to send to template file |
| 21 | - private $sortOrder; // For sorting views |
|
| 22 | - private $type; // Type of view |
|
| 21 | + private $sortOrder; // For sorting views |
|
| 22 | + private $type; // Type of view |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | * Properties |
| 15 | 15 | * |
| 16 | 16 | */ |
| 17 | - public $loaded = []; // Store all lazy loaded services, ready to be instantiated |
|
| 18 | - public $active = []; // A service is instantiated into this array, once its accessed |
|
| 17 | + public $loaded = []; // Store all lazy loaded services, ready to be instantiated |
|
| 18 | + public $active = []; // A service is instantiated into this array, once its accessed |
|
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | |
@@ -26,25 +26,25 @@ discard block |
||
| 26 | 26 | $this->set('route', '\Anax\Route\CRouteBasic'); |
| 27 | 27 | $this->set('view', '\Anax\View\CViewBasic'); |
| 28 | 28 | |
| 29 | - $this->set('ErrorController', function () { |
|
| 29 | + $this->set('ErrorController', function() { |
|
| 30 | 30 | $controller = new \Anax\MVC\ErrorController(); |
| 31 | 31 | $controller->setDI($this); |
| 32 | 32 | return $controller; |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | - $this->setShared('log', function () { |
|
| 35 | + $this->setShared('log', function() { |
|
| 36 | 36 | $log = new \Anax\Log\CLogger(); |
| 37 | 37 | $log->setContext('development'); |
| 38 | 38 | return $log; |
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | - $this->setShared('request', function () { |
|
| 41 | + $this->setShared('request', function() { |
|
| 42 | 42 | $request = new \Anax\Request\CRequestBasic(); |
| 43 | 43 | $request->init(); |
| 44 | 44 | return $request; |
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | - $this->setShared('url', function () { |
|
| 47 | + $this->setShared('url', function() { |
|
| 48 | 48 | $url = new \Anax\Url\CUrl(); |
| 49 | 49 | $url->setSiteUrl($this->request->getSiteUrl()); |
| 50 | 50 | $url->setBaseUrl($this->request->getBaseUrl()); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return $url; |
| 56 | 56 | }); |
| 57 | 57 | |
| 58 | - $this->setShared('views', function () { |
|
| 58 | + $this->setShared('views', function() { |
|
| 59 | 59 | $views = new \Anax\View\CViewContainerBasic(); |
| 60 | 60 | $views->setBasePath(ANAX_APP_PATH . 'view'); |
| 61 | 61 | $views->setFileSuffix('.tpl.php'); |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | return $views; |
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | - $this->setShared('router', function () { |
|
| 66 | + $this->setShared('router', function() { |
|
| 67 | 67 | |
| 68 | 68 | $router = new \Anax\Route\CRouterBasic(); |
| 69 | 69 | $router->setDI($this); |
| 70 | 70 | |
| 71 | - $router->addInternal('403', function () { |
|
| 71 | + $router->addInternal('403', function() { |
|
| 72 | 72 | $this->dispatcher->forward([ |
| 73 | 73 | 'controller' => 'error', |
| 74 | 74 | 'action' => 'statusCode', |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ]); |
| 80 | 80 | })->setName('403'); |
| 81 | 81 | |
| 82 | - $router->addInternal('404', function () { |
|
| 82 | + $router->addInternal('404', function() { |
|
| 83 | 83 | $this->dispatcher->forward([ |
| 84 | 84 | 'controller' => 'error', |
| 85 | 85 | 'action' => 'statusCode', |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | ]); |
| 91 | 91 | })->setName('404'); |
| 92 | 92 | |
| 93 | - $router->addInternal('500', function () { |
|
| 93 | + $router->addInternal('500', function() { |
|
| 94 | 94 | $this->dispatcher->forward([ |
| 95 | 95 | 'controller' => 'error', |
| 96 | 96 | 'action' => 'statusCode', |
@@ -104,13 +104,13 @@ discard block |
||
| 104 | 104 | return $router; |
| 105 | 105 | }); |
| 106 | 106 | |
| 107 | - $this->setShared('dispatcher', function () { |
|
| 107 | + $this->setShared('dispatcher', function() { |
|
| 108 | 108 | $dispatcher = new \Anax\MVC\CDispatcherBasic(); |
| 109 | 109 | $dispatcher->setDI($this); |
| 110 | 110 | return $dispatcher; |
| 111 | 111 | }); |
| 112 | 112 | |
| 113 | - $this->setShared('session', function () { |
|
| 113 | + $this->setShared('session', function() { |
|
| 114 | 114 | $session = new \Anax\Session\CSession(); |
| 115 | 115 | $session->configure(ANAX_APP_PATH . 'config/session.php'); |
| 116 | 116 | $session->name(); |
@@ -118,27 +118,27 @@ discard block |
||
| 118 | 118 | return $session; |
| 119 | 119 | }); |
| 120 | 120 | |
| 121 | - $this->setShared('theme', function () { |
|
| 121 | + $this->setShared('theme', function() { |
|
| 122 | 122 | $themeEngine = new \Anax\ThemeEngine\CThemeBasic(); |
| 123 | 123 | $themeEngine->setDI($this); |
| 124 | 124 | $themeEngine->configure(ANAX_APP_PATH . 'config/theme.php'); |
| 125 | 125 | return $themeEngine; |
| 126 | 126 | }); |
| 127 | 127 | |
| 128 | - $this->setShared('navbar', function () { |
|
| 128 | + $this->setShared('navbar', function() { |
|
| 129 | 129 | $navbar = new \Anax\Navigation\CNavbar(); |
| 130 | 130 | $navbar->setDI($this); |
| 131 | 131 | $navbar->configure(ANAX_APP_PATH . 'config/navbar.php'); |
| 132 | 132 | return $navbar; |
| 133 | 133 | }); |
| 134 | 134 | |
| 135 | - $this->set('fileContent', function () { |
|
| 135 | + $this->set('fileContent', function() { |
|
| 136 | 136 | $fc = new \Anax\Content\CFileContent(); |
| 137 | 137 | $fc->setBasePath(ANAX_APP_PATH . 'content/'); |
| 138 | 138 | return $fc; |
| 139 | 139 | }); |
| 140 | 140 | |
| 141 | - $this->setShared('textFilter', function () { |
|
| 141 | + $this->setShared('textFilter', function() { |
|
| 142 | 142 | $filter = new \Anax\Content\CTextFilter(); |
| 143 | 143 | $filter->setDI($this); |
| 144 | 144 | $filter->configure(ANAX_APP_PATH . 'config/text_filter.php'); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * Properties |
| 13 | 13 | * |
| 14 | 14 | */ |
| 15 | - public $data = []; // Store all configuration options here |
|
| 15 | + public $data = []; // Store all configuration options here |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | parent::__construct(); |
| 18 | 18 | |
| 19 | - $this->set('documentation', function () { |
|
| 19 | + $this->set('documentation', function() { |
|
| 20 | 20 | $fc = new \Anax\Content\CFileContent(); |
| 21 | 21 | $fc->setBasePath(ANAX_INSTALL_PATH . 'docs/documentation'); |
| 22 | 22 | return $fc; |
@@ -10,9 +10,9 @@ discard block |
||
| 10 | 10 | * @param string $class The fully-qualified class name. |
| 11 | 11 | * @return void |
| 12 | 12 | */ |
| 13 | -spl_autoload_register(function ($class) { |
|
| 13 | +spl_autoload_register(function($class) { |
|
| 14 | 14 | $path = ANAX_SOURCE_PATH . "/{$class}/{$class}.php"; |
| 15 | - if(is_file($path)) { |
|
| 15 | + if (is_file($path)) { |
|
| 16 | 16 | require($path); |
| 17 | 17 | } |
| 18 | 18 | }); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param string $class The fully-qualified class name. |
| 31 | 31 | * @return void |
| 32 | 32 | */ |
| 33 | -spl_autoload_register(function ($className) { |
|
| 33 | +spl_autoload_register(function($className) { |
|
| 34 | 34 | |
| 35 | 35 | $path = ANAX_SOURCE_PATH . DIRECTORY_SEPARATOR; |
| 36 | 36 | $className = ltrim($className, '\\'); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; |
| 46 | 46 | |
| 47 | - if(is_file($fileName)) { |
|
| 47 | + if (is_file($fileName)) { |
|
| 48 | 48 | require $fileName; |
| 49 | 49 | } |
| 50 | 50 | }); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @param string $class The fully-qualified class name. |
| 59 | 59 | * @return void |
| 60 | 60 | */ |
| 61 | -spl_autoload_register(function ($class) { |
|
| 61 | +spl_autoload_register(function($class) { |
|
| 62 | 62 | |
| 63 | 63 | // project-specific namespace prefix |
| 64 | 64 | $prefix = 'Anax\\'; |