Nette\Caching\Cache::__construct PHP Method

__construct() public method

public __construct ( Nette\Caching\IStorage $storage, $namespace = NULL )
$storage Nette\Caching\IStorage
    public function __construct(IStorage $storage, $namespace = NULL)
    {
        $this->storage = $storage;
        $this->namespace = $namespace . self::NAMESPACE_SEPARATOR;
    }

Usage Example

Exemplo n.º 1
0
 public function __construct(Settings $settings)
 {
     $storage = new FileStorage($settings->temp_dir);
     $this->settings = $settings;
     parent::__construct($storage);
     $this->cache_data = $this->load($this->settings->cache_name);
     if ($this->cache_data === null) {
         $this->save($this->settings->cache_name, array());
         $this->cache_data = array();
     }
 }
All Usage Examples Of Nette\Caching\Cache::__construct