@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use Alpha\Model\Type\Boolean; |
| 9 | 9 | use Alpha\Model\Type\Relation; |
| 10 | 10 | use Alpha\Util\Logging\Logger; |
| 11 | -use Alpha\Util\Config\Configprovider; |
|
| 12 | 11 | use Alpha\Util\Http\Session\SessionProviderFactory; |
| 13 | 12 | use Alpha\Exception\ValidationException; |
| 14 | 13 | use Alpha\Exception\FileNotFoundException; |
@@ -2,15 +2,15 @@ |
||
| 2 | 2 | |
| 3 | 3 | require_once __DIR__.'/../vendor/autoload.php'; |
| 4 | 4 | |
| 5 | -use Alpha\Controller\Front\FrontController; |
|
| 6 | -use Alpha\Util\Config\ConfigProvider; |
|
| 7 | -use Alpha\Util\Http\Filter\ClientBlacklistFilter; |
|
| 8 | -use Alpha\Util\Http\Filter\IPBlacklistFilter; |
|
| 9 | -use Alpha\Util\Http\Filter\ClientTempBlacklistFilter; |
|
| 10 | -use Alpha\Util\Http\Request; |
|
| 11 | -use Alpha\Util\Http\Response; |
|
| 12 | -use Alpha\Exception\ResourceNotFoundException; |
|
| 13 | -use Alpha\Exception\ResourceNotAllowedException; |
|
| 5 | +use Alpha\Controller\Front\FrontController; |
|
| 6 | +use Alpha\Util\Config\ConfigProvider; |
|
| 7 | +use Alpha\Util\Http\Filter\ClientBlacklistFilter; |
|
| 8 | +use Alpha\Util\Http\Filter\IPBlacklistFilter; |
|
| 9 | +use Alpha\Util\Http\Filter\ClientTempBlacklistFilter; |
|
| 10 | +use Alpha\Util\Http\Request; |
|
| 11 | +use Alpha\Util\Http\Response; |
|
| 12 | +use Alpha\Exception\ResourceNotFoundException; |
|
| 13 | +use Alpha\Exception\ResourceNotAllowedException; |
|
| 14 | 14 | use Alpha\View\View; |
| 15 | 15 | |
| 16 | 16 | try {
|
@@ -14,36 +14,36 @@ |
||
| 14 | 14 | use Alpha\View\View; |
| 15 | 15 | |
| 16 | 16 | try {
|
| 17 | - $config = ConfigProvider::getInstance(); |
|
| 17 | + $config = ConfigProvider::getInstance(); |
|
| 18 | 18 | |
| 19 | - set_exception_handler('Alpha\Util\ErrorHandlers::catchException');
|
|
| 20 | - set_error_handler('Alpha\Util\ErrorHandlers::catchError', $config->get('php.error.log.level'));
|
|
| 19 | + set_exception_handler('Alpha\Util\ErrorHandlers::catchException');
|
|
| 20 | + set_error_handler('Alpha\Util\ErrorHandlers::catchError', $config->get('php.error.log.level'));
|
|
| 21 | 21 | |
| 22 | - $front = new FrontController(); |
|
| 22 | + $front = new FrontController(); |
|
| 23 | 23 | |
| 24 | - if ($config->get('security.client.blacklist.filter.enabled')) {
|
|
| 25 | - $front->registerFilter(new ClientBlacklistFilter()); |
|
| 26 | - } |
|
| 24 | + if ($config->get('security.client.blacklist.filter.enabled')) {
|
|
| 25 | + $front->registerFilter(new ClientBlacklistFilter()); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - if ($config->get('security.ip.blacklist.filter.enabled')) {
|
|
| 29 | - $front->registerFilter(new IPBlacklistFilter()); |
|
| 30 | - } |
|
| 28 | + if ($config->get('security.ip.blacklist.filter.enabled')) {
|
|
| 29 | + $front->registerFilter(new IPBlacklistFilter()); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - if ($config->get('security.client.temp.blacklist.filter.enabled')) {
|
|
| 33 | - $front->registerFilter(new ClientTempBlacklistFilter()); |
|
| 34 | - } |
|
| 32 | + if ($config->get('security.client.temp.blacklist.filter.enabled')) {
|
|
| 33 | + $front->registerFilter(new ClientTempBlacklistFilter()); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - $request = new Request(); |
|
| 37 | - $response = $front->process($request); |
|
| 36 | + $request = new Request(); |
|
| 37 | + $response = $front->process($request); |
|
| 38 | 38 | |
| 39 | 39 | } catch (ResourceNotFoundException $rnfe) {
|
| 40 | - $response = new Response(404, View::renderErrorPage(404, $rnfe->getMessage(), array('Content-Type' => 'text/html')));
|
|
| 40 | + $response = new Response(404, View::renderErrorPage(404, $rnfe->getMessage(), array('Content-Type' => 'text/html')));
|
|
| 41 | 41 | } catch (ResourceNotAllowedException $rnae) {
|
| 42 | - $response = new Response(403, View::renderErrorPage(403, $rnae->getMessage(), array('Content-Type' => 'text/html')));
|
|
| 42 | + $response = new Response(403, View::renderErrorPage(403, $rnae->getMessage(), array('Content-Type' => 'text/html')));
|
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if ($config->get('security.http.header.x.frame.options') != '' && $response->getHeader('X-Frame-Options') == null) {
|
| 46 | - $response->setHeader('X-Frame-Options', $config->get('security.http.header.x.frame.options'));
|
|
| 46 | + $response->setHeader('X-Frame-Options', $config->get('security.http.header.x.frame.options'));
|
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | echo $response->send(); |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | $config = ConfigProvider::getInstance(); |
| 10 | 10 | |
| 11 | 11 | $dirs = array( |
| 12 | - $config->get('app.file.store.dir').'logs', |
|
| 13 | - $config->get('app.file.store.dir').'cache', |
|
| 14 | - $config->get('app.file.store.dir').'cache/html', |
|
| 15 | - $config->get('app.file.store.dir').'cache/images', |
|
| 16 | - $config->get('app.file.store.dir').'cache/pdf', |
|
| 17 | - $config->get('app.file.store.dir').'cache/xls', |
|
| 18 | - $config->get('app.file.store.dir').'attachments', |
|
| 19 | - ); |
|
| 12 | + $config->get('app.file.store.dir').'logs', |
|
| 13 | + $config->get('app.file.store.dir').'cache', |
|
| 14 | + $config->get('app.file.store.dir').'cache/html', |
|
| 15 | + $config->get('app.file.store.dir').'cache/images', |
|
| 16 | + $config->get('app.file.store.dir').'cache/pdf', |
|
| 17 | + $config->get('app.file.store.dir').'cache/xls', |
|
| 18 | + $config->get('app.file.store.dir').'attachments', |
|
| 19 | + ); |
|
| 20 | 20 | |
| 21 | 21 | foreach ($dirs as $dir) { |
| 22 | - if (!file_exists($dir)) { |
|
| 23 | - mkdir($dir, 0774); |
|
| 24 | - } |
|
| 22 | + if (!file_exists($dir)) { |
|
| 23 | + mkdir($dir, 0774); |
|
| 24 | + } |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | ?> |
| 28 | 28 | \ No newline at end of file |
@@ -615,7 +615,7 @@ |
||
| 615 | 615 | } |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | - // route URIs with params missing (will attempt to layer on defaults later on in Request class) |
|
| 618 | + // route URIs with params missing (will attempt to layer on defaults later on in Request class) |
|
| 619 | 619 | foreach ($this->routes as $route => $callback) { |
| 620 | 620 | $pattern = '#^'.$route.'$#s'; |
| 621 | 621 | $pattern = preg_replace('#\/\{\S+\}#', '\/?', $pattern); |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Alpha\Util\Config\ConfigProvider; |
| 7 | 7 | use Alpha\Util\Http\Request; |
| 8 | 8 | use Alpha\Util\Http\Response; |
| 9 | -use Alpha\Util\Http\Session\SessionProviderFactory; |
|
| 10 | 9 | use Alpha\View\View; |
| 11 | 10 | use Alpha\Controller\Front\FrontController; |
| 12 | 11 | |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Alpha\Model\Type\Integer; |
| 7 | 7 | use Alpha\Model\Type\Timestamp; |
| 8 | 8 | use Alpha\Model\Type\TypeInterface; |
| 9 | -use Alpha\Model\Type\Enum; |
|
| 10 | 9 | use Alpha\Model\Type\Relation; |
| 11 | 10 | use Alpha\Util\Config\ConfigProvider; |
| 12 | 11 | use Alpha\Util\Logging\Logger; |
@@ -234,16 +234,16 @@ discard block |
||
| 234 | 234 | self::$logger->debug('<<__construct()'); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - /** |
|
| 238 | - * Facade method which will invoke our custom markdown class rather than the standard one. |
|
| 239 | - * |
|
| 240 | - * @param $text The markdown content to parse |
|
| 241 | - * |
|
| 242 | - * @since 1.0 |
|
| 243 | - */ |
|
| 244 | - private function markdown($text) |
|
| 245 | - { |
|
| 246 | - $config = ConfigProvider::getInstance(); |
|
| 237 | + /** |
|
| 238 | + * Facade method which will invoke our custom markdown class rather than the standard one. |
|
| 239 | + * |
|
| 240 | + * @param $text The markdown content to parse |
|
| 241 | + * |
|
| 242 | + * @since 1.0 |
|
| 243 | + */ |
|
| 244 | + private function markdown($text) |
|
| 245 | + { |
|
| 246 | + $config = ConfigProvider::getInstance(); |
|
| 247 | 247 | |
| 248 | 248 | /* |
| 249 | 249 | * Initialize the parser and return the result of its transform method. |
@@ -251,9 +251,9 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | static $parser; |
| 253 | 253 | |
| 254 | - if (!isset($parser)) { |
|
| 255 | - $parser = new Markdown(); |
|
| 256 | - } |
|
| 254 | + if (!isset($parser)) { |
|
| 255 | + $parser = new Markdown(); |
|
| 256 | + } |
|
| 257 | 257 | |
| 258 | 258 | /* |
| 259 | 259 | * Replace all instances of $sysURL in the text with the app.url setting from config |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | // transform text using parser. |
| 265 | 265 | return $parser->transform($text); |
| 266 | - } |
|
| 266 | + } |
|
| 267 | 267 | |
| 268 | 268 | /** |
| 269 | 269 | * Fetter for the content. |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | */ |
| 120 | 120 | public function render() |
| 121 | 121 | { |
| 122 | - $value = $this->dateObject->getValue(); |
|
| 122 | + $value = $this->dateObject->getValue(); |
|
| 123 | 123 | |
| 124 | 124 | if ($value == '0000-00-00') { |
| 125 | 125 | $value = ''; |