allow creating Cache objects with only the storage id instead of the whole storage object

remotes/origin/stable5
Robin Appelman 13 years ago
parent 706bb3ccd6
commit e7bed5ddab
  1. 19
      lib/files/cache/cache.php

@ -19,24 +19,25 @@ class Cache {
const SHALLOW = 2; //folder in cache, but not all child files are completely scanned
const COMPLETE = 3;
/**
* @var \OC\Files\Storage\Storage
*/
private $storage;
/**
* @var array partial data for the cache
*/
private $partial = array();
/**
* @var string
*/
private $storageId;
/**
* @param \OC\Files\Storage\Storage $storage
* @param \OC\Files\Storage\Storage|string $storage
*/
public function __construct(\OC\Files\Storage\Storage $storage) {
$this->storage = $storage;
$this->storageId = $storage->getId();
public function __construct($storage) {
if($storage instanceof \OC\Files\Storage\Storage){
$this->storageId = $storage->getId();
}else{
$this->storageId = $storage;
}
}
/**

Loading…
Cancel
Save