@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | /* |
| 73 | 73 | * Skip if Existing Caching in Options |
| 74 | 74 | */ |
| 75 | - if (isset($option[ 'skipExisting' ]) && $option[ 'skipExisting' ] == true && file_exists($file_path)) { |
|
| 75 | + if (isset($option['skipExisting']) && $option['skipExisting'] == true && file_exists($file_path)) { |
|
| 76 | 76 | $content = $this->readfile($file_path); |
| 77 | 77 | $old = $this->decode($content); |
| 78 | 78 | $toWrite = false; |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | public static function isValidOption($optionName, $optionValue) |
| 219 | 219 | { |
| 220 | 220 | parent::isValidOption($optionName, $optionValue); |
| 221 | - switch($optionName) |
|
| 221 | + switch ($optionName) |
|
| 222 | 222 | { |
| 223 | 223 | case 'path': |
| 224 | 224 | return is_string($optionValue); |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | if (!is_dir($path)) { |
| 275 | 275 | throw new phpFastCacheDriverException("Can't read PATH:" . $path, 94); |
| 276 | - }else{ |
|
| 276 | + } else { |
|
| 277 | 277 | $size = Directory::dirSize($path); |
| 278 | 278 | } |
| 279 | 279 | |
@@ -39,11 +39,11 @@ |
||
| 39 | 39 | { |
| 40 | 40 | $count = 0; |
| 41 | 41 | $objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::SELF_FIRST); |
| 42 | - foreach($objects as $name => $object){ |
|
| 42 | + foreach ($objects as $name => $object) { |
|
| 43 | 43 | /** |
| 44 | 44 | * @var \SplFileInfo $object |
| 45 | 45 | */ |
| 46 | - if($object->isFile()) |
|
| 46 | + if ($object->isFile()) |
|
| 47 | 47 | { |
| 48 | 48 | $count++; |
| 49 | 49 | } |
@@ -34,27 +34,27 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $tmp_dir = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir(); |
| 36 | 36 | |
| 37 | - if (!isset($this->config[ 'path' ]) || $this->config[ 'path' ] == '') { |
|
| 37 | + if (!isset($this->config['path']) || $this->config['path'] == '') { |
|
| 38 | 38 | if (self::isPHPModule()) { |
| 39 | 39 | $path = $tmp_dir; |
| 40 | 40 | } else { |
| 41 | - $document_root_path = rtrim($_SERVER[ 'DOCUMENT_ROOT' ], '/') . '/../'; |
|
| 42 | - $path = isset($_SERVER[ 'DOCUMENT_ROOT' ]) && is_writable($document_root_path) ? $document_root_path : rtrim(__DIR__, '/') . '/'; |
|
| 41 | + $document_root_path = rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/../'; |
|
| 42 | + $path = isset($_SERVER['DOCUMENT_ROOT']) && is_writable($document_root_path) ? $document_root_path : rtrim(__DIR__, '/') . '/'; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if ($this->config[ 'path' ] != '') { |
|
| 46 | - $path = $this->config[ 'path' ]; |
|
| 45 | + if ($this->config['path'] != '') { |
|
| 46 | + $path = $this->config['path']; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | } else { |
| 50 | - $path = $this->config[ 'path' ]; |
|
| 50 | + $path = $this->config['path']; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $securityKey = array_key_exists('securityKey', $this->config) ? $this->config[ 'securityKey' ] : ''; |
|
| 53 | + $securityKey = array_key_exists('securityKey', $this->config) ? $this->config['securityKey'] : ''; |
|
| 54 | 54 | if ($securityKey == "" || $securityKey == 'auto') { |
| 55 | - $securityKey = $this->config[ 'securityKey' ]; |
|
| 55 | + $securityKey = $this->config['securityKey']; |
|
| 56 | 56 | if ($securityKey == 'auto' || $securityKey == '') { |
| 57 | - $securityKey = isset($_SERVER[ 'HTTP_HOST' ]) ? preg_replace('/^www./', '', strtolower($_SERVER[ 'HTTP_HOST' ])) : "default"; |
|
| 57 | + $securityKey = isset($_SERVER['HTTP_HOST']) ? preg_replace('/^www./', '', strtolower($_SERVER['HTTP_HOST'])) : "default"; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | if ($securityKey != '') { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $full_pathx = md5($full_path); |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - if (!isset($this->tmp[ $full_pathx ])) { |
|
| 70 | + if (!isset($this->tmp[$full_pathx])) { |
|
| 71 | 71 | |
| 72 | 72 | if (!@file_exists($full_path) || !@is_writable($full_path)) { |
| 73 | 73 | if (!@file_exists($full_path)) { |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $this->tmp[ $full_pathx ] = true; |
|
| 95 | - $this->htaccessGen($full_path, array_key_exists('htaccess', $this->config) ? $this->config[ 'htaccess' ] : false); |
|
| 94 | + $this->tmp[$full_pathx] = true; |
|
| 95 | + $this->htaccessGen($full_path, array_key_exists('htaccess', $this->config) ? $this->config['htaccess'] : false); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return realpath($full_path); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $path = $this->getPath() . '/files'; |
| 129 | 129 | |
| 130 | - if($keyword === false) |
|
| 130 | + if ($keyword === false) |
|
| 131 | 131 | { |
| 132 | 132 | return $path; |
| 133 | 133 | } |
@@ -156,10 +156,10 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function setChmodAuto() |
| 158 | 158 | { |
| 159 | - if (!isset($this->config[ 'default_chmod' ]) || $this->config[ 'default_chmod' ] == '' || is_null($this->config[ 'default_chmod' ])) { |
|
| 159 | + if (!isset($this->config['default_chmod']) || $this->config['default_chmod'] == '' || is_null($this->config['default_chmod'])) { |
|
| 160 | 160 | return 0777; |
| 161 | 161 | } else { |
| 162 | - return $this->config[ 'default_chmod' ]; |
|
| 162 | + return $this->config['default_chmod']; |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |