@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function __construct(Container $cacheContainer) |
| 31 | 31 | { |
| 32 | 32 | $this->cacheContainer = $cacheContainer; |
| 33 | - $this->cachePrefix = $this->cacheContainer->cachePrefix . '.' . $this->cacheContainer->classPrefix . '.'; |
|
| 33 | + $this->cachePrefix = $this->cacheContainer->cachePrefix.'.'.$this->cacheContainer->classPrefix.'.'; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $this->logger->info("Execute cache save: " . $key); |
|
| 64 | + $this->logger->info("Execute cache save: ".$key); |
|
| 65 | 65 | |
| 66 | 66 | return $result; |
| 67 | 67 | } |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $result = $this->cacheContainer->driver->get($key); |
| 79 | - $this->logger->info("Execute cache read: " . $key); |
|
| 79 | + $this->logger->info("Execute cache read: ".$key); |
|
| 80 | 80 | |
| 81 | 81 | if ($result !== false) { |
| 82 | - $this->logger->info("Execute cache read: " . $key); |
|
| 82 | + $this->logger->info("Execute cache read: ".$key); |
|
| 83 | 83 | } else { |
| 84 | - $this->logger->warn("Failed to read cache: " . $key); |
|
| 84 | + $this->logger->warn("Failed to read cache: ".$key); |
|
| 85 | 85 | $result = null; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -98,10 +98,10 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ($this->cacheContainer->driver->delete($key) > 0) { |
| 101 | - $this->logger->info("Execute cache cleared: " . $key); |
|
| 101 | + $this->logger->info("Execute cache cleared: ".$key); |
|
| 102 | 102 | return true; |
| 103 | 103 | } else { |
| 104 | - $this->logger->warn("Failed to clear cache: " . $key); |
|
| 104 | + $this->logger->warn("Failed to clear cache: ".$key); |
|
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -124,10 +124,10 @@ discard block |
||
| 124 | 124 | $this->cacheContainer->driver->setOption($this->cacheContainer->redisOptPrefix, $this->cachePrefix); |
| 125 | 125 | |
| 126 | 126 | if ($result > 0) { |
| 127 | - $this->logger->info("Execute all cache cleared: " . $this->cachePrefix . "*"); |
|
| 127 | + $this->logger->info("Execute all cache cleared: ".$this->cachePrefix."*"); |
|
| 128 | 128 | return true; |
| 129 | 129 | } else { |
| 130 | - $this->logger->warn("Failed to clear all cache: " . $this->cachePrefix . "*"); |
|
| 130 | + $this->logger->warn("Failed to clear all cache: ".$this->cachePrefix."*"); |
|
| 131 | 131 | return false; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -141,7 +141,7 @@ |
||
| 141 | 141 | $cacheContainer->driver->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_IGBINARY); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $cacheContainer->driver->setOption(\Redis::OPT_PREFIX, $container->cachePrefix . '.' . $container->classPrefix); |
|
| 144 | + $cacheContainer->driver->setOption(\Redis::OPT_PREFIX, $container->cachePrefix.'.'.$container->classPrefix); |
|
| 145 | 145 | $cacheContainer->driver->setOption(\Redis::OPT_SCAN, \Redis::SCAN_RETRY); |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function __construct(Container $cacheContainer) |
| 31 | 31 | { |
| 32 | 32 | $this->cacheContainer = $cacheContainer; |
| 33 | - $this->cachePrefix = $this->cacheContainer->cachePrefix . '.' . $this->cacheContainer->classPrefix . '.'; |
|
| 33 | + $this->cachePrefix = $this->cacheContainer->cachePrefix.'.'.$this->cacheContainer->classPrefix.'.'; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | if (!$this->isAvailableCacheLibrary()) { |
| 42 | 42 | return false; |
| 43 | 43 | } |
| 44 | - $key = $this->cachePrefix . $key; |
|
| 44 | + $key = $this->cachePrefix.$key; |
|
| 45 | 45 | $result = null; |
| 46 | 46 | |
| 47 | 47 | if ($ttl > 0) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $this->logger->info("Execute cache save: " . $key); |
|
| 67 | + $this->logger->info("Execute cache save: ".$key); |
|
| 68 | 68 | $this->verifyReturnCode($this->cacheContainer->codes['success']); |
| 69 | 69 | |
| 70 | 70 | return $result; |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | if (!$this->isAvailableCacheLibrary()) { |
| 79 | 79 | return false; |
| 80 | 80 | } |
| 81 | - $key = $this->cachePrefix . $key; |
|
| 81 | + $key = $this->cachePrefix.$key; |
|
| 82 | 82 | $result = $this->cacheContainer->driver->get($key); |
| 83 | 83 | |
| 84 | 84 | if ($result !== false) { |
| 85 | - $this->logger->info("Execute cache read: " . $key); |
|
| 85 | + $this->logger->info("Execute cache read: ".$key); |
|
| 86 | 86 | } else { |
| 87 | - $this->logger->warn("Failed to read cache: " . $key); |
|
| 87 | + $this->logger->warn("Failed to read cache: ".$key); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | return $this->verifyReturnCode($this->cacheContainer->codes['success']) ? $result : null; |
@@ -98,14 +98,14 @@ discard block |
||
| 98 | 98 | if (!$this->isAvailableCacheLibrary()) { |
| 99 | 99 | return false; |
| 100 | 100 | } |
| 101 | - $key = $this->cachePrefix . $key; |
|
| 101 | + $key = $this->cachePrefix.$key; |
|
| 102 | 102 | $this->cacheContainer->driver->delete($key); |
| 103 | 103 | |
| 104 | 104 | if ($this->verifyReturnCode($this->cacheContainer->codes['notfound'])) { |
| 105 | - $this->logger->info("Execute cache cleared: " . $key); |
|
| 105 | + $this->logger->info("Execute cache cleared: ".$key); |
|
| 106 | 106 | return true; |
| 107 | 107 | } else { |
| 108 | - $this->logger->warn("Failed to clear cache: " . $key); |
|
| 108 | + $this->logger->warn("Failed to clear cache: ".$key); |
|
| 109 | 109 | return false; |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | $allKeys = $this->cacheContainer->driver->getAllKeys(); |
| 122 | 122 | if ($allKeys === false) { |
| 123 | - $this->logger->warn("Can't get cache keys: " . $this->cachePrefix . "*"); |
|
| 123 | + $this->logger->warn("Can't get cache keys: ".$this->cachePrefix."*"); |
|
| 124 | 124 | $this->cacheContainer->driver->flush(); |
| 125 | 125 | |
| 126 | 126 | return true; |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | $this->cacheContainer->driver->deleteMulti($targetKeys); |
| 138 | 138 | |
| 139 | 139 | if ($this->verifyReturnCode($this->cacheContainer->codes['notfound'])) { |
| 140 | - $this->logger->info("Execute all cache cleared: " . $this->cachePrefix . "*"); |
|
| 140 | + $this->logger->info("Execute all cache cleared: ".$this->cachePrefix."*"); |
|
| 141 | 141 | return true; |
| 142 | 142 | } else { |
| 143 | - $this->logger->warn("Failed to clear all cache: " . $this->cachePrefix . "*"); |
|
| 143 | + $this->logger->warn("Failed to clear all cache: ".$this->cachePrefix."*"); |
|
| 144 | 144 | return false; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function __construct(Container $cacheContainer) |
| 31 | 31 | { |
| 32 | 32 | $this->cacheContainer = $cacheContainer; |
| 33 | - $this->cachePrefix = $this->cacheContainer->cachePrefix . '.' . $this->cacheContainer->classPrefix . '.'; |
|
| 33 | + $this->cachePrefix = $this->cacheContainer->cachePrefix.'.'.$this->cacheContainer->classPrefix.'.'; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -41,11 +41,10 @@ discard block |
||
| 41 | 41 | if (!$this->isAvailableCacheLibrary()) { |
| 42 | 42 | return false; |
| 43 | 43 | } |
| 44 | - $key = $this->cachePrefix . $key; |
|
| 44 | + $key = $this->cachePrefix.$key; |
|
| 45 | 45 | |
| 46 | - $result = $overwrite ? $this->cacheContainer->driver->delegate("apcu_store", [$key, $value, $ttl]) : |
|
| 47 | - $this->cacheContainer->driver->delegate("apcu_add", [$key, $value, $ttl]); |
|
| 48 | - $this->logger->info("Execute cache save: " . $key); |
|
| 46 | + $result = $overwrite ? $this->cacheContainer->driver->delegate("apcu_store", [$key, $value, $ttl]) : $this->cacheContainer->driver->delegate("apcu_add", [$key, $value, $ttl]); |
|
| 47 | + $this->logger->info("Execute cache save: ".$key); |
|
| 49 | 48 | |
| 50 | 49 | return $result; |
| 51 | 50 | } |
@@ -58,13 +57,13 @@ discard block |
||
| 58 | 57 | if (!$this->isAvailableCacheLibrary()) { |
| 59 | 58 | return null; |
| 60 | 59 | } |
| 61 | - $key = $this->cachePrefix . $key; |
|
| 60 | + $key = $this->cachePrefix.$key; |
|
| 62 | 61 | $value = $this->cacheContainer->driver->delegate("apcu_fetch", [$key]); |
| 63 | 62 | |
| 64 | 63 | if ($value !== false) { |
| 65 | - $this->logger->info("Execute cache read: " . $key); |
|
| 64 | + $this->logger->info("Execute cache read: ".$key); |
|
| 66 | 65 | } else { |
| 67 | - $this->logger->warn("Failed to read cache: " . $key); |
|
| 66 | + $this->logger->warn("Failed to read cache: ".$key); |
|
| 68 | 67 | $value = null; |
| 69 | 68 | } |
| 70 | 69 | |
@@ -79,13 +78,13 @@ discard block |
||
| 79 | 78 | if (!$this->isAvailableCacheLibrary()) { |
| 80 | 79 | return false; |
| 81 | 80 | } |
| 82 | - $key = $this->cachePrefix . $key; |
|
| 81 | + $key = $this->cachePrefix.$key; |
|
| 83 | 82 | |
| 84 | 83 | if ($this->cacheContainer->driver->delegate("apcu_delete", [$key])) { |
| 85 | - $this->logger->info("Execute cache cleared: " . $key); |
|
| 84 | + $this->logger->info("Execute cache cleared: ".$key); |
|
| 86 | 85 | return true; |
| 87 | 86 | } else { |
| 88 | - $this->logger->warn("Failed to clear cache: " . $key); |
|
| 87 | + $this->logger->warn("Failed to clear cache: ".$key); |
|
| 89 | 88 | return false; |
| 90 | 89 | } |
| 91 | 90 | } |
@@ -100,17 +99,17 @@ discard block |
||
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 | if (class_exists('\APCUIterator')) { |
| 103 | - $obj = new \APCUIterator('/^' . $this->cachePrefix . '/', APC_ITER_KEY); |
|
| 102 | + $obj = new \APCUIterator('/^'.$this->cachePrefix.'/', APC_ITER_KEY); |
|
| 104 | 103 | if ($this->cacheContainer->driver->delegate("apcu_delete", [$obj])) { |
| 105 | - $this->logger->info("Execute all cache cleared: " . $this->cachePrefix . "*"); |
|
| 104 | + $this->logger->info("Execute all cache cleared: ".$this->cachePrefix."*"); |
|
| 106 | 105 | return true; |
| 107 | 106 | } |
| 108 | 107 | } elseif ($this->cacheContainer->driver->delegate("apcu_clear_cache")) { |
| 109 | - $this->logger->info("Execute all cache cleared: " . $this->cachePrefix . "*"); |
|
| 108 | + $this->logger->info("Execute all cache cleared: ".$this->cachePrefix."*"); |
|
| 110 | 109 | return true; |
| 111 | 110 | } |
| 112 | 111 | |
| 113 | - $this->logger->warn("Failed to clear all cache: " . $this->cachePrefix . "*"); |
|
| 112 | + $this->logger->warn("Failed to clear all cache: ".$this->cachePrefix."*"); |
|
| 114 | 113 | return false; |
| 115 | 114 | } |
| 116 | 115 | |