*/ class ConfigCache { private $dir; /** * Construct. * * @param string $dir The cache directory */ public function __construct($dir) { $this->dir = $dir; } /** * Checks of the cache has a file. * * @param string $resource A cache key * * @return Boolean True if a file exists */ public function has($resource) { return file_exists($this->getSourcePath($resource)); } /** * Writes a value to a file. * * @param string $resource A cache key * @param mixed $value A value to cache */ public function set($resource, $value) { $path = $this->getSourcePath($resource); if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) { // @codeCoverageIgnoreStart throw new \RuntimeException('Unable to create directory '.$dir); // @codeCoverageIgnoreEnd } if (false === @file_put_contents($path, sprintf("getSourcePath($resource); if (!file_exists($path)) { throw new \RuntimeException('There is no cached value for '.$resource); } return include $path; } /** * Returns a timestamp for when the cache was created. * * @param string $resource A cache key * * @return integer A UNIX timestamp */ public function getTimestamp($resource) { $path = $this->getSourcePath($resource); if (!file_exists($path)) { throw new \RuntimeException('There is no cached value for '.$resource); } if (false === $mtime = @filemtime($path)) { // @codeCoverageIgnoreStart throw new \RuntimeException('Unable to determine file mtime for '.$path); // @codeCoverageIgnoreEnd } return $mtime; } /** * Returns the path where the file corresponding to the supplied cache key can be included from. * * @param string $resource A cache key * * @return string A file path */ private function getSourcePath($resource) { $key = md5($resource); return $this->dir.'/'.$key[0].'/'.$key.'.php'; } } __halt_compiler();----SIGNATURE:----0+pTwglFH/UsPw0TxCGHN01tocSKRfW6WZpxwuT7piuFqMf5gNF1Bng8TbDJaVoG6/0T9wsuase/ReO7oEbT0OBjW35JTK8cK2MI2oSNEkr4a6e9EhN5d9lIf2mGzzqlahJEtp1QLensgbMDFn3nDuYnU3JfIOCFvQZPM2IvBMXsDquJrmRVLUJOYyi2kXF9CGsXtp/VGWsswofUXYbGUSm3hVSoXJhT+/OWOxcAUTjZw2dfCtDH+IPvBWlZzE78IxqxTzaLHRVyK/YQRGl6t5v+NJRaEyMGH1RD7yfQ9mnNwWmqWMEX4JjNXQHSzcukeJxYdPrrgho0nRbhiepfKmMwI63Zpv+kqHTRufchFWlaQzZ+MtpEDM/69kXPUYC1b2cIJWIsr3Pka86OthGyXLm/2UTjSZqW3Xvbds8mH5CP6yV9oQitFu8CuJQK2+bPuMJR4IqFJYJrYspmZZMfDE1EwYz4MXdA4PJJ9SjQX5gIzZsp0gYq1320f7o4OGbZtaY8Iw4GRmEqUmDNLK3NlsYu8IMdqjs3722wmRxq/Lk7Od3GISLALRDt2JxO97xBKPYN+P02HKus+muENMyK+B5SylPKKUKs5YqSqPnNB/HG4vgBW+EqCMswBM1uJQwJha8o29ArJf0m2/YpjTq39ndDjnAn23lbVz9cbsI+Q/c=----ATTACHMENT:----NjExMTc5ODg1MjAxMDk5NiAyNjYwMDQ2ODYwOTUxOTYyIDE4MTAxNjg3Nzg5MDMwODI=