@@ -109,7 +109,7 @@ |
||
| 109 | 109 | /** |
| 110 | 110 | * Saves the GD image resource to the file path indicated. |
| 111 | 111 | * |
| 112 | - * @param image $imageResource The GD image resource to save |
|
| 112 | + * @param resource $imageResource The GD image resource to save |
|
| 113 | 113 | * @param string $type The image type (jpg, png, or gif) |
| 114 | 114 | * @param string $destination The desination file path of the image file to create |
| 115 | 115 | * |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | list($originalWidth, $originalHeight) = $imageInfo; |
| 96 | 96 | |
| 97 | 97 | if ($originalWidth > $originalHeight) { |
| 98 | - $originalX = floor(($originalWidth - $originalHeight) / 2); |
|
| 98 | + $originalX = floor(($originalWidth-$originalHeight)/2); |
|
| 99 | 99 | $sourceWidth = $sourceHeight = $originalHeight; |
| 100 | 100 | } else { |
| 101 | 101 | $sourceWidth = $sourceHeight = $originalWidth; |
@@ -182,6 +182,7 @@ |
||
| 182 | 182 | * not exist. |
| 183 | 183 | * |
| 184 | 184 | * @since 1.1 |
| 185 | + * @param string $stepName |
|
| 185 | 186 | */ |
| 186 | 187 | public function logStep($stepName) |
| 187 | 188 | { |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | $this->endTime = microtime(true); |
| 169 | 169 | |
| 170 | - $this->duration = $this->endTime - $this->startTime; |
|
| 170 | + $this->duration = $this->endTime-$this->startTime; |
|
| 171 | 171 | |
| 172 | 172 | $logfile = new LogProviderFile(); |
| 173 | 173 | $logfile->setPath($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv'); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $this->endTime = microtime(true); |
| 191 | 191 | |
| 192 | - $this->duration = $this->endTime - $this->startTime; |
|
| 192 | + $this->duration = $this->endTime-$this->startTime; |
|
| 193 | 193 | |
| 194 | 194 | $logfile = new LogProviderFile(); |
| 195 | 195 | $logfile->setPath($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv'); |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | /** |
| 133 | 133 | * Returns the size in megabytes of the log file on disc. |
| 134 | 134 | * |
| 135 | - * @return float |
|
| 135 | + * @return integer |
|
| 136 | 136 | * |
| 137 | 137 | * @since 1.0 |
| 138 | 138 | */ |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | { |
| 141 | 141 | $size = filesize($this->path); |
| 142 | 142 | |
| 143 | - return ($size / 1024) / 1024; |
|
| 143 | + return ($size/1024)/1024; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -63,11 +63,11 @@ |
||
| 63 | 63 | * A static method that attempts to return a SearchProviderInterface instance |
| 64 | 64 | * based on the name of the provider class supplied. |
| 65 | 65 | * |
| 66 | - * @param $providerName The class name of the provider class, should be fully-qualified. |
|
| 66 | + * @param string $providerName The class name of the provider class, should be fully-qualified. |
|
| 67 | 67 | * |
| 68 | 68 | * @throws Alpha\Exception\IllegalArguementException; |
| 69 | 69 | * |
| 70 | - * @return Alpha\Util\Search\SearchProviderInterface |
|
| 70 | + * @return SearchProviderInterface|null |
|
| 71 | 71 | * |
| 72 | 72 | * @since 1.2.3 |
| 73 | 73 | */ |
@@ -1013,7 +1013,7 @@ |
||
| 1013 | 1013 | /** |
| 1014 | 1014 | * Get the current view renderer provider. |
| 1015 | 1015 | * |
| 1016 | - * @return Alpha\View\Renderer\RendererProviderInterface |
|
| 1016 | + * @return RendererProviderInterface |
|
| 1017 | 1017 | * |
| 1018 | 1018 | * @since 2.0 |
| 1019 | 1019 | */ |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | * Get the ViewState instance. Loads from $_SESSION if its not already in memory, otherwise |
| 110 | 110 | * a new instance will be returned with empty properties. |
| 111 | 111 | * |
| 112 | - * @return Alpha\View\ViewState |
|
| 112 | + * @return string |
|
| 113 | 113 | * |
| 114 | 114 | * @since 1.0 |
| 115 | 115 | */ |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | /** |
| 154 | 154 | * The constructor. |
| 155 | 155 | * |
| 156 | - * @param $source |
|
| 156 | + * @param string $source |
|
| 157 | 157 | * @param $width |
| 158 | 158 | * @param $height |
| 159 | 159 | * @param $sourceType |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | } else { |
| 244 | 244 | // make a cache dir for the article |
| 245 | - $cacheDir = $config->get('app.file.store.dir').'cache/images/article_'.mb_substr($this->source, mb_strpos($this->source, 'attachments/article_') + 20, 11); |
|
| 245 | + $cacheDir = $config->get('app.file.store.dir').'cache/images/article_'.mb_substr($this->source, mb_strpos($this->source, 'attachments/article_')+20, 11); |
|
| 246 | 246 | if (!file_exists($cacheDir)) { |
| 247 | 247 | $success = mkdir($cacheDir); |
| 248 | 248 | |
@@ -300,11 +300,11 @@ discard block |
||
| 300 | 300 | $targetScreenY = $targetScreenResolution[1]; |
| 301 | 301 | |
| 302 | 302 | // calculate the new units we will scale by |
| 303 | - $xu = $targetScreenX / $originalScreenX; |
|
| 304 | - $yu = $targetScreenY / $originalScreenY; |
|
| 303 | + $xu = $targetScreenX/$originalScreenX; |
|
| 304 | + $yu = $targetScreenY/$originalScreenY; |
|
| 305 | 305 | |
| 306 | - $this->width = new Integer(intval($this->width->getValue() * $xu)); |
|
| 307 | - $this->height = new Integer(intval($this->height->getValue() * $yu)); |
|
| 306 | + $this->width = new Integer(intval($this->width->getValue()*$xu)); |
|
| 307 | + $this->height = new Integer(intval($this->height->getValue()*$yu)); |
|
| 308 | 308 | |
| 309 | 309 | // need to update the cache filename as the dimensions have changed |
| 310 | 310 | $this->setFilename(); |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | if ($this->sourceType->getValue() == 'png' && $config->get('cms.images.perserve.png')) { |
| 369 | 369 | imagepng($new_image); |
| 370 | 370 | } else { |
| 371 | - imagejpeg($new_image, null, 100 * $this->quality->getValue()); |
|
| 371 | + imagejpeg($new_image, null, 100*$this->quality->getValue()); |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | $this->cache($new_image); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | if ($this->sourceType->getValue() == 'png' && $config->get('cms.images.perserve.png')) { |
| 393 | 393 | imagepng($image, $this->filename); |
| 394 | 394 | } else { |
| 395 | - imagejpeg($image, $this->filename, 100 * $this->quality->getValue()); |
|
| 395 | + imagejpeg($image, $this->filename, 100*$this->quality->getValue()); |
|
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | |
@@ -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') != '')
|
| 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 | |
@@ -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 |