/** * @param Config $config OPTIONAL override default config * @param LoggerInterface $logger OPTIONAL override default logger * @param CacheInterface $cache OPTIONAL override default cache */ public function __construct(Config $config = null, LoggerInterface $logger = null, CacheInterface $cache = null) { parent::__construct(); if ($config) { foreach ($config as $key => $value) { $this->{$key} = $value; } } $this->config = $config ?: $this; $this->logger = empty($logger) ? new Logger($this->debug) : $logger; $this->cache = empty($cache) ? new Cache($this->config, $this->logger) : $cache; $this->pages = new Pages($this->config, $this->cache, $this->logger); $this->cache->purge(); }