@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | protected static function cleanFileName($filename): string |
195 | 195 | { |
196 | 196 | $regex = [ |
197 | - '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/', |
|
198 | - '/\.$/', |
|
199 | - '/^\./', |
|
197 | + '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/', |
|
198 | + '/\.$/', |
|
199 | + '/^\./', |
|
200 | 200 | ]; |
201 | 201 | $replace = ['-', '', '']; |
202 | 202 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $tmpFilename = Directory::getAbsolutePath(\dirname($file) . '/tmp_' . \md5( |
293 | 293 | \str_shuffle(\uniqid($this->getDriverName(), false)) |
294 | 294 | . \str_shuffle(\uniqid($this->getDriverName(), false)) |
295 | - )); |
|
295 | + )); |
|
296 | 296 | |
297 | 297 | $f = \fopen($tmpFilename, 'w+'); |
298 | 298 | \flock($f, \LOCK_EX); |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | } |
335 | 335 | |
336 | 336 | $stat->setData(\implode(', ', \array_keys($this->itemInstances))) |
337 | - ->setRawData([ |
|
337 | + ->setRawData([ |
|
338 | 338 | 'tmp' => $this->tmp, |
339 | - ]) |
|
340 | - ->setSize(Directory::dirSize($path)) |
|
341 | - ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
339 | + ]) |
|
340 | + ->setSize(Directory::dirSize($path)) |
|
341 | + ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
342 | 342 | |
343 | 343 | return $stat; |
344 | 344 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | use Phpfastcache\Config\ConfigurationOption; |
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheDriverCheckException, PhpfastcacheDriverException, PhpfastcacheDriverNotFoundException, PhpfastcacheInstanceNotFoundException, PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidConfigurationException, PhpfastcacheLogicException, PhpfastcacheUnsupportedOperationException |
|
21 | + PhpfastcacheDriverCheckException, PhpfastcacheDriverException, PhpfastcacheDriverNotFoundException, PhpfastcacheInstanceNotFoundException, PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidConfigurationException, PhpfastcacheLogicException, PhpfastcacheUnsupportedOperationException |
|
22 | 22 | }; |
23 | 23 | use Phpfastcache\Util\ClassNamespaceResolverTrait; |
24 | 24 | |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | if (\is_array($config)) { |
116 | 116 | $config = new ConfigurationOption($config); |
117 | 117 | \trigger_error( |
118 | - 'The CacheManager will drops the support of primitive configuration arrays, use a "\Phpfastcache\Config\ConfigurationOption" object instead', |
|
119 | - E_USER_DEPRECATED |
|
118 | + 'The CacheManager will drops the support of primitive configuration arrays, use a "\Phpfastcache\Config\ConfigurationOption" object instead', |
|
119 | + E_USER_DEPRECATED |
|
120 | 120 | ); |
121 | 121 | } elseif ($config === null) { |
122 | 122 | $config = self::getDefaultConfig(); |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | |
139 | 139 | if (!is_a($driverClass, ExtendedCacheItemPoolInterface::class, true)) { |
140 | 140 | throw new PhpfastcacheDriverException(\sprintf( |
141 | - 'Class "%s" does not implement "%s"', |
|
142 | - $driverClass, |
|
143 | - ExtendedCacheItemPoolInterface::class |
|
141 | + 'Class "%s" does not implement "%s"', |
|
142 | + $driverClass, |
|
143 | + ExtendedCacheItemPoolInterface::class |
|
144 | 144 | )); |
145 | 145 | } |
146 | 146 | try { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $fallback = $config->getFallback(); |
158 | 158 | $config->setFallback(''); |
159 | 159 | \trigger_error(\sprintf('The "%s" driver is unavailable at the moment, the fallback driver "%s" has been used instead.', $driver, |
160 | - $fallback), E_USER_WARNING); |
|
160 | + $fallback), E_USER_WARNING); |
|
161 | 161 | return self::getInstance($fallback, $config->getFallbackConfig()); |
162 | 162 | } catch (PhpfastcacheInvalidArgumentException $e) { |
163 | 163 | throw new PhpfastcacheInvalidConfigurationException('Invalid fallback driver configuration', 0, $e); |
@@ -332,29 +332,29 @@ discard block |
||
332 | 332 | public static function getStaticSystemDrivers(): array |
333 | 333 | { |
334 | 334 | \trigger_error(\sprintf('Method "%s" is deprecated as of the V7 and will be removed soon or later, use CacheManager::getDriverList() instead.', |
335 | - __METHOD__), E_USER_DEPRECATED); |
|
335 | + __METHOD__), E_USER_DEPRECATED); |
|
336 | 336 | return [ |
337 | - 'Apc', |
|
338 | - 'Apcu', |
|
339 | - 'Cassandra', |
|
340 | - 'Couchbase', |
|
341 | - 'Couchdb', |
|
342 | - 'Devnull', |
|
343 | - 'Files', |
|
344 | - 'Leveldb', |
|
345 | - 'Memcache', |
|
346 | - 'Memcached', |
|
347 | - 'Memstatic', |
|
348 | - 'Mongodb', |
|
349 | - 'Predis', |
|
350 | - 'Redis', |
|
351 | - 'Riak', |
|
352 | - 'Ssdb', |
|
353 | - 'Sqlite', |
|
354 | - 'Wincache', |
|
355 | - 'Xcache', |
|
356 | - 'Zenddisk', |
|
357 | - 'Zendshm', |
|
337 | + 'Apc', |
|
338 | + 'Apcu', |
|
339 | + 'Cassandra', |
|
340 | + 'Couchbase', |
|
341 | + 'Couchdb', |
|
342 | + 'Devnull', |
|
343 | + 'Files', |
|
344 | + 'Leveldb', |
|
345 | + 'Memcache', |
|
346 | + 'Memcached', |
|
347 | + 'Memstatic', |
|
348 | + 'Mongodb', |
|
349 | + 'Predis', |
|
350 | + 'Redis', |
|
351 | + 'Riak', |
|
352 | + 'Ssdb', |
|
353 | + 'Sqlite', |
|
354 | + 'Wincache', |
|
355 | + 'Xcache', |
|
356 | + 'Zenddisk', |
|
357 | + 'Zendshm', |
|
358 | 358 | ]; |
359 | 359 | } |
360 | 360 | |
@@ -365,11 +365,11 @@ discard block |
||
365 | 365 | public static function getStaticAllDrivers(): array |
366 | 366 | { |
367 | 367 | \trigger_error(\sprintf('Method "%s" is deprecated as of the V7 and will be removed soon or later, use CacheManager::getDriverList() instead.', |
368 | - __METHOD__), E_USER_DEPRECATED); |
|
368 | + __METHOD__), E_USER_DEPRECATED); |
|
369 | 369 | return \array_merge(self::getStaticSystemDrivers(), [ |
370 | - 'Devtrue', |
|
371 | - 'Devfalse', |
|
372 | - 'Cookie', |
|
370 | + 'Devtrue', |
|
371 | + 'Devfalse', |
|
372 | + 'Cookie', |
|
373 | 373 | ]); |
374 | 374 | } |
375 | 375 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | |
449 | 449 | if (!\class_exists($className)) { |
450 | 450 | throw new PhpfastcacheInvalidArgumentException( |
451 | - \sprintf("Can't add '%s' because the class '%s' does not exists", $driverName, $className) |
|
451 | + \sprintf("Can't add '%s' because the class '%s' does not exists", $driverName, $className) |
|
452 | 452 | ); |
453 | 453 | } |
454 | 454 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | |
503 | 503 | if (!\class_exists($className)) { |
504 | 504 | throw new PhpfastcacheInvalidArgumentException( |
505 | - \sprintf("Can't override '%s' because the class '%s' does not exists", $driverName, $className) |
|
505 | + \sprintf("Can't override '%s' because the class '%s' does not exists", $driverName, $className) |
|
506 | 506 | ); |
507 | 507 | } |
508 | 508 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | |
517 | 517 | if (!\is_subclass_of($className, self::CORE_DRIVER_NAMESPACE . $driverName . '\\Driver', true)) { |
518 | 518 | throw new PhpfastcacheLogicException( |
519 | - \sprintf("Can't override '%s' because the class '%s' MUST extend '%s'", $driverName, $className, |
|
519 | + \sprintf("Can't override '%s' because the class '%s' MUST extend '%s'", $driverName, $className, |
|
520 | 520 | self::CORE_DRIVER_NAMESPACE . $driverName . '\\Driver') |
521 | 521 | ); |
522 | 522 | } |