diff --git a/src/CacheInclude.php b/src/CacheInclude.php index ab75bf4..1b86b0f 100644 --- a/src/CacheInclude.php +++ b/src/CacheInclude.php @@ -53,10 +53,14 @@ class CacheInclude * @param ConfigInterface $config * @param bool $forceExpire */ - public function __construct(ConfigInterface $config, $forceExpire = false) + public function __construct(ConfigInterface $config = null, $forceExpire = false) { $this->cache = Injector::inst()->get(CacheInterface::class . '.CacheInclude'); - $this->config = $config; + + if ($config) { + $this->config = $config; + } + $this->forceExpire = $forceExpire; }