mirror of
https://github.com/nextcloud/server.git
synced 2026-03-27 04:43:20 -04:00
allow creating Cache objects with only the storage id instead of the whole storage object
This commit is contained in:
parent
706bb3ccd6
commit
e7bed5ddab
1 changed files with 10 additions and 9 deletions
19
lib/files/cache/cache.php
vendored
19
lib/files/cache/cache.php
vendored
|
|
@ -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…
Reference in a new issue