Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: implements Pinq\Caching\ICacheAdapter
Exemplo n.º 1
0
 public function __construct($directory, $fileExtension = self::DEFAULT_EXTENSION, $namespace = null)
 {
     parent::__construct($namespace);
     $this->rootDirectory = $directory . DIRECTORY_SEPARATOR;
     $this->fileExtension = $fileExtension;
     if ($namespace !== null) {
         $this->directory = $this->rootDirectory . md5($namespace) . DIRECTORY_SEPARATOR;
     } else {
         $this->directory = $this->rootDirectory;
     }
     if (!is_dir($this->directory)) {
         if (!@mkdir($this->directory, 0777, true)) {
             throw new PinqException('Invalid cache directory: %s does not exist and could not be created', $this->directory);
         }
     }
 }
Exemplo n.º 2
0
 public function __construct(DoctrineCacheProvider $doctrineCache, $namespace = null)
 {
     parent::__construct($namespace);
     $this->doctrineCache = $doctrineCache;
 }