Pinq\Caching\CacheAdapter::__construct PHP Method

__construct() public method

public __construct ( $namespace )
    public function __construct($namespace)
    {
        $this->namespace = $namespace;
    }

Usage Example

Beispiel #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);
         }
     }
 }
All Usage Examples Of Pinq\Caching\CacheAdapter::__construct