__construct() public method

public __construct ( $namespace )
Esempio 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);
         }
     }
 }
Esempio n. 2
0
 public function __construct(DoctrineCacheProvider $doctrineCache, $namespace = null)
 {
     parent::__construct($namespace);
     $this->doctrineCache = $doctrineCache;
 }