@@ -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); |
@@ -238,14 +238,14 @@ discard block |
||
| 238 | 238 | self::$logger->debug('<<__construct()'); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - /** |
|
| 242 | - * Facade method which will invoke our custom markdown class rather than the standard one. |
|
| 243 | - * |
|
| 244 | - * @since 1.0 |
|
| 245 | - */ |
|
| 246 | - private function markdown($text, $attachURL = '') |
|
| 247 | - { |
|
| 248 | - $config = ConfigProvider::getInstance(); |
|
| 241 | + /** |
|
| 242 | + * Facade method which will invoke our custom markdown class rather than the standard one. |
|
| 243 | + * |
|
| 244 | + * @since 1.0 |
|
| 245 | + */ |
|
| 246 | + private function markdown($text, $attachURL = '') |
|
| 247 | + { |
|
| 248 | + $config = ConfigProvider::getInstance(); |
|
| 249 | 249 | |
| 250 | 250 | /* |
| 251 | 251 | * Initialize the parser and return the result of its transform method. |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | static $parser; |
| 255 | 255 | |
| 256 | - if (!isset($parser)) { |
|
| 257 | - $parser = new \Alpha\Util\Extension\Markdown(); |
|
| 258 | - } |
|
| 256 | + if (!isset($parser)) { |
|
| 257 | + $parser = new \Alpha\Util\Extension\Markdown(); |
|
| 258 | + } |
|
| 259 | 259 | |
| 260 | 260 | /* |
| 261 | 261 | * Replace all instances of $sysURL in the text with the app.url setting from config |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | // transform text using parser. |
| 267 | 267 | return $parser->transform($text); |
| 268 | - } |
|
| 268 | + } |
|
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * Fetter for the content. |
@@ -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') != '')
|
| 46 | - $response->getHeader('X-Frame-Options', $config->get('security.http.header.x.frame.options'));
|
|
| 46 | + $response->getHeader('X-Frame-Options', $config->get('security.http.header.x.frame.options'));
|
|
| 47 | 47 | |
| 48 | 48 | echo $response->send(); |
| 49 | 49 | |
@@ -42,8 +42,9 @@ |
||
| 42 | 42 | $response = new Response(403, View::renderErrorPage(403, $rnae->getMessage(), array('Content-Type' => 'text/html')));
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -if ($config->get('security.http.header.x.frame.options') != '')
|
|
| 46 | - $response->getHeader('X-Frame-Options', $config->get('security.http.header.x.frame.options'));
|
|
| 45 | +if ($config->get('security.http.header.x.frame.options') != '') { |
|
| 46 | + $response->getHeader('X-Frame-Options', $config->get('security.http.header.x.frame.options')); |
|
| 47 | +} |
|
| 47 | 48 | |
| 48 | 49 | echo $response->send(); |
| 49 | 50 | |
@@ -158,14 +158,15 @@ discard block |
||
| 158 | 158 | # Reading alignement from header underline. |
| 159 | 159 | $separators = preg_split('/ *[|] */', $underline); |
| 160 | 160 | foreach ($separators as $n => $s) { |
| 161 | - if (preg_match('/^ *-+: *$/', $s)) |
|
| 162 | - $attr[$n] = $this->_doTable_makeAlignAttr('right'); |
|
| 163 | - else if (preg_match('/^ *:-+: *$/', $s)) |
|
| 164 | - $attr[$n] = $this->_doTable_makeAlignAttr('center'); |
|
| 165 | - else if (preg_match('/^ *:-+ *$/', $s)) |
|
| 166 | - $attr[$n] = $this->_doTable_makeAlignAttr('left'); |
|
| 167 | - else |
|
| 168 | - $attr[$n] = ''; |
|
| 161 | + if (preg_match('/^ *-+: *$/', $s)) { |
|
| 162 | + $attr[$n] = $this->_doTable_makeAlignAttr('right'); |
|
| 163 | + } else if (preg_match('/^ *:-+: *$/', $s)) { |
|
| 164 | + $attr[$n] = $this->_doTable_makeAlignAttr('center'); |
|
| 165 | + } else if (preg_match('/^ *:-+ *$/', $s)) { |
|
| 166 | + $attr[$n] = $this->_doTable_makeAlignAttr('left'); |
|
| 167 | + } else { |
|
| 168 | + $attr[$n] = ''; |
|
| 169 | + } |
|
| 169 | 170 | } |
| 170 | 171 | |
| 171 | 172 | # Parsing span elements, including code spans, character escapes, |
@@ -179,8 +180,9 @@ discard block |
||
| 179 | 180 | $text = "<table class=\"table table-bordered\">\n"; |
| 180 | 181 | $text .= "<thead>\n"; |
| 181 | 182 | $text .= "<tr>\n"; |
| 182 | - foreach ($headers as $n => $header) |
|
| 183 | - $text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n"; |
|
| 183 | + foreach ($headers as $n => $header) { |
|
| 184 | + $text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n"; |
|
| 185 | + } |
|
| 184 | 186 | $text .= "</tr>\n"; |
| 185 | 187 | $text .= "</thead>\n"; |
| 186 | 188 | |
@@ -198,8 +200,9 @@ discard block |
||
| 198 | 200 | $row_cells = array_pad($row_cells, $col_count, ''); |
| 199 | 201 | |
| 200 | 202 | $text .= "<tr>\n"; |
| 201 | - foreach ($row_cells as $n => $cell) |
|
| 202 | - $text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n"; |
|
| 203 | + foreach ($row_cells as $n => $cell) { |
|
| 204 | + $text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n"; |
|
| 205 | + } |
|
| 203 | 206 | $text .= "</tr>\n"; |
| 204 | 207 | } |
| 205 | 208 | $text .= "</tbody>\n"; |