function __construct($dir = null, $time = 0) { if (!file_exists($dir)) { mkdir($dir, 0755); } $this->cacheDir = $dir; $this->cache = $time; $this->finish = time() + $time; }