/** * @param string $cache_dir * @param int $cache_time seconds (0, cache never expires) */ public function __construct($cache_dir = '', $cache_time = 0) { parent::__construct(); $this->cache_time = (int) $cache_time; $cache_dir = rtrim($cache_dir, '/') . '/'; if (is_writable($cache_dir)) { $this->cache_dir = $cache_dir; } else { throw new \Exception('Not writable cache_dir: ' . $cache_dir); } }