Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Service/Cache.php
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- Service/Cache.php (revision e972969478c2ad67d9befe771b5783d57aea7542)
- +++ Service/Cache.php (revision )
- @@ -26,10 +26,15 @@
- */
- class Cache
- {
- + /**
- + * @var self
- + */
- + protected static $selfInstance;
- +
- /**
- * @var array
- */
- - private $config = [];
- + protected $config = [];
- /**
- * @var Stopwatch
- @@ -41,7 +46,7 @@
- *
- * @var \phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface[]
- */
- - private $cacheInstances = [];
- + protected $cacheInstances = [];
- /**
- * Cache constructor.
- @@ -51,12 +56,26 @@
- *
- * @throws \phpFastCache\Exceptions\phpFastCacheDriverException
- */
- - public function __construct($config, Stopwatch $stopwatch = null)
- + protected function __construct($config, Stopwatch $stopwatch = null)
- {
- $this->config = (array) $config;
- $this->stopwatch = $stopwatch;
- }
- + /**
- + * Factory instance provider
- + *
- + * @param array $config
- + * @param Stopwatch $stopwatch
- + *
- + * @throws \phpFastCache\Exceptions\phpFastCacheDriverException
- + * @return self
- + */
- + public static function getInstance($config, Stopwatch $stopwatch = null)
- + {
- + return self::$selfInstance ?: self::$selfInstance = new self($config, $stopwatch);
- + }
- +
- /**
- * Set a new cache instance
- *
- Index: Resources/config/services.yml
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- --- Resources/config/services.yml (revision e972969478c2ad67d9befe771b5783d57aea7542)
- +++ Resources/config/services.yml (revision )
- @@ -7,6 +7,7 @@
- services:
- phpfastcache:
- + factory: ['%php_fast_cache.cache.class%', 'getInstance']
- class: "%php_fast_cache.cache.class%"
- arguments:
- - "%phpfastcache%"
Add Comment
Please, Sign In to add comment