@@ -123,8 +123,8 @@ |
||
| 123 | 123 | |
| 124 | 124 | // replace this example code with whatever you need |
| 125 | 125 | return $this->render('default/index.html.twig', [ |
| 126 | - 'pfc_test' => $pfc_test, |
|
| 127 | - 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'), |
|
| 126 | + 'pfc_test' => $pfc_test, |
|
| 127 | + 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'), |
|
| 128 | 128 | ]); |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | \ No newline at end of file |
@@ -97,11 +97,11 @@ |
||
| 97 | 97 | $configClass = $driverClass::getConfigClass(); |
| 98 | 98 | if(\class_exists($configClass)){ |
| 99 | 99 | $this->createInstance( |
| 100 | - $name, |
|
| 101 | - CacheManager::getInstance( |
|
| 100 | + $name, |
|
| 101 | + CacheManager::getInstance( |
|
| 102 | 102 | $this->config[ 'drivers' ][ $name ][ 'type' ], |
| 103 | 103 | new $configClass($this->config[ 'drivers' ][ $name ][ 'parameters' ]) |
| 104 | - ) |
|
| 104 | + ) |
|
| 105 | 105 | ); |
| 106 | 106 | }else{ |
| 107 | 107 | throw new PhpfastcacheInvalidConfigurationException('Invalid configuration class name: ' . $configClass); |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | public function getTokenParsers() |
| 60 | 60 | { |
| 61 | 61 | return [ |
| 62 | - new TokenParser\Cache(), |
|
| 62 | + new TokenParser\Cache(), |
|
| 63 | 63 | ]; |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public function getFilters() |
| 29 | 29 | { |
| 30 | 30 | return [ |
| 31 | - new \Twig_SimpleFilter('sizeFormat', [$this, 'size_format']), |
|
| 31 | + new \Twig_SimpleFilter('sizeFormat', [$this, 'size_format']), |
|
| 32 | 32 | ]; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | public function __construct(\Twig_Node_Expression $annotation, \Twig_Node_Expression $keyInfo, \Twig_Node $body, $lineno, $tag = null) |
| 37 | 37 | { |
| 38 | 38 | parent::__construct([ |
| 39 | - 'key_info' => $keyInfo, |
|
| 40 | - 'body' => $body, |
|
| 41 | - 'annotation' => $annotation |
|
| 39 | + 'key_info' => $keyInfo, |
|
| 40 | + 'body' => $body, |
|
| 41 | + 'annotation' => $annotation |
|
| 42 | 42 | ], [], $lineno, $tag); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -65,35 +65,35 @@ |
||
| 65 | 65 | } |
| 66 | 66 | $stats[ $instanceName ] = $cache->getStats(); |
| 67 | 67 | $instances[ $instanceName ] = [ |
| 68 | - 'driverName' => $cache->getDriverName(), |
|
| 69 | - 'configClassName' => \get_class( $cache->getConfig()), |
|
| 70 | - 'driverConfig' => $cache->getConfig()->toArray() |
|
| 68 | + 'driverName' => $cache->getDriverName(), |
|
| 69 | + 'configClassName' => \get_class( $cache->getConfig()), |
|
| 70 | + 'driverConfig' => $cache->getConfig()->toArray() |
|
| 71 | 71 | ]; |
| 72 | 72 | $driverUsed[ $cache->getDriverName() ] = \get_class($cache); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $this->data = [ |
| 76 | - 'twigCacheBlocks' => $this->twig_cache_blocks, |
|
| 77 | - 'apiVersion' => PhpfastcacheApi::getVersion(), |
|
| 78 | - 'pfcVersion' => PhpfastcacheApi::getPhpFastCacheVersion(), |
|
| 79 | - 'bundleVersion' => phpFastCacheBundle::VERSION, |
|
| 80 | - 'apiChangelog' => PhpfastcacheApi::getChangelog(), |
|
| 81 | - 'driverUsed' => $driverUsed, |
|
| 82 | - 'instances' => $instances, |
|
| 83 | - 'stats' => $stats, |
|
| 84 | - 'size' => $size, |
|
| 85 | - 'hits' => [ |
|
| 76 | + 'twigCacheBlocks' => $this->twig_cache_blocks, |
|
| 77 | + 'apiVersion' => PhpfastcacheApi::getVersion(), |
|
| 78 | + 'pfcVersion' => PhpfastcacheApi::getPhpFastCacheVersion(), |
|
| 79 | + 'bundleVersion' => phpFastCacheBundle::VERSION, |
|
| 80 | + 'apiChangelog' => PhpfastcacheApi::getChangelog(), |
|
| 81 | + 'driverUsed' => $driverUsed, |
|
| 82 | + 'instances' => $instances, |
|
| 83 | + 'stats' => $stats, |
|
| 84 | + 'size' => $size, |
|
| 85 | + 'hits' => [ |
|
| 86 | 86 | 'read' => (int) CacheManager::$ReadHits, |
| 87 | 87 | 'write' => (int) CacheManager::$WriteHits, |
| 88 | - ], |
|
| 89 | - 'coreConfig' => [ |
|
| 88 | + ], |
|
| 89 | + 'coreConfig' => [ |
|
| 90 | 90 | 'driverList' => CacheManager::getDriverList(true), |
| 91 | 91 | 'namespacePath (deprecated)' => CacheManager::getNamespacePath(), |
| 92 | - ], |
|
| 93 | - 'projectConfig' => [ |
|
| 92 | + ], |
|
| 93 | + 'projectConfig' => [ |
|
| 94 | 94 | 'twig_driver' => $this->phpfastcache->getConfig()['twig_driver'], |
| 95 | 95 | 'twig_block_debug' => $this->phpfastcache->getConfig()['twig_block_debug'], |
| 96 | - ], |
|
| 96 | + ], |
|
| 97 | 97 | ]; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | if ($this->cacheCollector instanceof CacheCollector) { |
| 80 | 80 | $this->cacheCollector->setTwigCacheBlock($unprefixedKey, [ |
| 81 | - 'cacheHit' => $cacheData !== null, |
|
| 82 | - 'cacheTtl' => $key[ 'lifetime' ], |
|
| 83 | - 'cacheSize' => mb_strlen((string)$cacheData), |
|
| 84 | - 'cacheGenTime' => $generationTime, |
|
| 85 | - 'cacheFileName' => $sourceContext->getName(), |
|
| 86 | - 'cacheFilePath' => $sourceContext->getPath(), |
|
| 81 | + 'cacheHit' => $cacheData !== null, |
|
| 82 | + 'cacheTtl' => $key[ 'lifetime' ], |
|
| 83 | + 'cacheSize' => mb_strlen((string)$cacheData), |
|
| 84 | + 'cacheGenTime' => $generationTime, |
|
| 85 | + 'cacheFileName' => $sourceContext->getName(), |
|
| 86 | + 'cacheFilePath' => $sourceContext->getPath(), |
|
| 87 | 87 | ]); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | return [ |
| 107 | - 'lifetime' => $value, |
|
| 108 | - 'key' => $this->twigCachePrefix . $annotation, |
|
| 107 | + 'lifetime' => $value, |
|
| 108 | + 'key' => $this->twigCachePrefix . $annotation, |
|
| 109 | 109 | ]; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -118,12 +118,12 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | if ($this->cacheCollector instanceof CacheCollector) { |
| 120 | 120 | $this->cacheCollector->setTwigCacheBlock($unprefixedKey, [ |
| 121 | - 'cacheHit' => false, |
|
| 122 | - 'cacheTtl' => $key[ 'lifetime' ], |
|
| 123 | - 'cacheSize' => \mb_strlen((string)$block), |
|
| 124 | - 'cacheGenTime' => $generationTime, |
|
| 125 | - 'cacheFileName' => $sourceContext->getName(), |
|
| 126 | - 'cacheFilePath' => $sourceContext->getPath(), |
|
| 121 | + 'cacheHit' => false, |
|
| 122 | + 'cacheTtl' => $key[ 'lifetime' ], |
|
| 123 | + 'cacheSize' => \mb_strlen((string)$block), |
|
| 124 | + 'cacheGenTime' => $generationTime, |
|
| 125 | + 'cacheFileName' => $sourceContext->getName(), |
|
| 126 | + 'cacheFilePath' => $sourceContext->getPath(), |
|
| 127 | 127 | ]); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $this->cacheInstance->save($cacheItem); |
| 71 | 71 | $cacheResponse = $response; |
| 72 | 72 | }else{ |
| 73 | - throw new PhpfastcacheLogicException('Your callback response MUST return a valid Symfony HTTP Foundation Response object'); |
|
| 73 | + throw new PhpfastcacheLogicException('Your callback response MUST return a valid Symfony HTTP Foundation Response object'); |
|
| 74 | 74 | } |
| 75 | 75 | }else{ |
| 76 | 76 | $cacheResponse->isNotModified($this->request); |
@@ -53,19 +53,19 @@ |
||
| 53 | 53 | protected function configure() |
| 54 | 54 | { |
| 55 | 55 | $this |
| 56 | - ->setName('phpfastcache:del') |
|
| 57 | - ->setAliases([ 'phpfastcache:delete', 'phpfastcache:rem', 'phpfastcache:remove']) |
|
| 58 | - ->setDescription('Delete phpfastcache cache value') |
|
| 59 | - ->addArgument( |
|
| 56 | + ->setName('phpfastcache:del') |
|
| 57 | + ->setAliases([ 'phpfastcache:delete', 'phpfastcache:rem', 'phpfastcache:remove']) |
|
| 58 | + ->setDescription('Delete phpfastcache cache value') |
|
| 59 | + ->addArgument( |
|
| 60 | 60 | 'driver', |
| 61 | 61 | InputArgument::REQUIRED, |
| 62 | 62 | 'Cache name to clear' |
| 63 | - ) |
|
| 64 | - ->addArgument( |
|
| 63 | + ) |
|
| 64 | + ->addArgument( |
|
| 65 | 65 | 'key', |
| 66 | 66 | InputArgument::REQUIRED, |
| 67 | 67 | 'Cache key' |
| 68 | - ); |
|
| 68 | + ); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |