cacheFile = $file; $this->parser = $parser; $this->registry = $parser->parse($file); } public function exists($name) { return isset($this->registry[$name]); } public function get($name) { return $this->exists($name) ? $this->registry[$name] : null; } public function hasChange($name, $driver) { return $this->exists($name) ? $this->registry[$name] !== $driver : true; } public function save($name, $driver) { $this->registry[$name] = $driver; $datas = $this->parser->dump($this->registry); file_put_contents($this->cacheFile->getPathname(), $datas); } }