@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function add(string $content) |
52 | 52 | { |
53 | - $this->driver->add($this->key . $this->index++, $content); |
|
53 | + $this->driver->add($this->key.$this->index++, $content); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $list = []; |
63 | 63 | for ($i = 0; $i < $this->index; $i++) { |
64 | - $list[] = $this->driver->get($this->key . $i); |
|
64 | + $list[] = $this->driver->get($this->key.$i); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $list; |
@@ -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 | } |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | |
182 | 182 | // テンプレートキャッシュチェック |
183 | 183 | $pageName = $this->container->coreDelegator->getPageName(); |
184 | - $cacheFile = $applicationInfo->cachePrefix . $this->camel2snake($pageName) . "-" . $this->camel2snake($method); |
|
184 | + $cacheFile = $applicationInfo->cachePrefix.$this->camel2snake($pageName)."-".$this->camel2snake($method); |
|
185 | 185 | |
186 | 186 | $factory = new CacheDriverFactory(); |
187 | 187 | $config = new Container(false); |
188 | - $config->cacheDir = $applicationInfo->applicationRoot . "/app/views/" . $applicationInfo->cacheDir; |
|
188 | + $config->cacheDir = $applicationInfo->applicationRoot."/app/views/".$applicationInfo->cacheDir; |
|
189 | 189 | $config->classPrefix = "view_cache"; |
190 | 190 | $cache = $factory->create("WebStream\Cache\Driver\TemporaryFile", $config); |
191 | 191 | $cache->inject('logger', $this->logger); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | ]); |
255 | 255 | |
256 | 256 | if ($template->cacheTime !== null) { |
257 | - $cacheFile = $applicationInfo->cachePrefix . $this->camel2snake($pageName) . "-" . $this->camel2snake($method); |
|
257 | + $cacheFile = $applicationInfo->cachePrefix.$this->camel2snake($pageName)."-".$this->camel2snake($method); |
|
258 | 258 | $view->templateCache($cacheFile, ob_get_contents(), $template->cacheTime); |
259 | 259 | } |
260 | 260 |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | $driver = $factory->create("WebStream\Cache\Driver\Apcu", $config); |
34 | 34 | break; |
35 | 35 | case "memcached": |
36 | - $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot() . '/config/cache.yml'); |
|
36 | + $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot().'/config/cache.yml'); |
|
37 | 37 | if (array_key_exists('memcached', $cacheConfig)) { |
38 | 38 | $config->servers = [[$cacheConfig['memcached']['host'], $cacheConfig['memcached']['port']]]; |
39 | 39 | $driver = $factory->create("WebStream\Cache\Driver\Memcached", $config); |
40 | 40 | } |
41 | 41 | break; |
42 | 42 | case "redis": |
43 | - $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot() . '/config/cache.yml'); |
|
43 | + $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot().'/config/cache.yml'); |
|
44 | 44 | if (array_key_exists('redis', $cacheConfig)) { |
45 | 45 | $config->host = $cacheConfig['redis']['host']; |
46 | 46 | $config->port = $cacheConfig['redis']['port']; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | break; |
50 | 50 | case "temporaryFile": |
51 | - $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot() . '/config/cache.yml'); |
|
51 | + $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot().'/config/cache.yml'); |
|
52 | 52 | if (array_key_exists('temporaryfile', $cacheConfig)) { |
53 | 53 | $config->cacheDir = $cacheConfig['temporaryfile']['path']; |
54 | 54 | $driver = $factory->create("WebStream\Cache\Driver\TemporaryFile", $config); |