Storage

class OC\Files\Cache\Storage
Handle the mapping between the string and numeric storage ids
Each storage has 2 different ids
a string id which is generated by the storage backend and reflects the configuration of the storage (e.g. ‘smb://user@host/share‘)
and a numeric storage id which is referenced in the file cache

A mapping between the two storage ids is stored in the database and accessible trough this class
Source:lib/private/Files/Cache/Storage.php#46

Properties

Methods

public static OC\Files\Cache\Storage::getGlobalCache()
Source:lib/private/Files/Cache/Storage.php#55
Returns:\OC\Files\Cache\StorageGlobal
public OC\Files\Cache\Storage::__construct($storage, $isAvailable=true)
Source:

lib/private/Files/Cache/Storage.php#67

Parameters:
Throws:

\RuntimeException

public static OC\Files\Cache\Storage::getStorageById($storageId)
Source:

lib/private/Files/Cache/Storage.php#96

Parameters:
  • $storageId (string)
Returns:

array

public static OC\Files\Cache\Storage::adjustStorageId($storageId)
Adjusts the storage id to use md5 if too long
Source:

lib/private/Files/Cache/Storage.php#106

Parameters:
  • $storageId (string) storage id
Returns:

string unchanged $storageId if its length is less than 64 characters, else returns the md5 of $storageId

public OC\Files\Cache\Storage::getNumericId()
Get the numeric id for the storage
Source:lib/private/Files/Cache/Storage.php#118
Returns:int
public static OC\Files\Cache\Storage::getStorageId($numericId)
Get the string id for the storage
Source:

lib/private/Files/Cache/Storage.php#128

Parameters:
  • $numericId (int)
Returns:

string | null either the storage id string or null if the numeric id is not known

public static OC\Files\Cache\Storage::getNumericStorageId($storageId)
Get the numeric of the storage with the provided string id
Source:

lib/private/Files/Cache/Storage.php#149

Parameters:
  • $storageId
Returns:

int | null either the numeric storage id or null if the storage id is not knwon

public OC\Files\Cache\Storage::getAvailability()
Source:lib/private/Files/Cache/Storage.php#162
Returns:array | null [ available, last_checked ]
public OC\Files\Cache\Storage::setAvailability($isAvailable, $delay=0)
Source:

lib/private/Files/Cache/Storage.php#177

Parameters:
  • $isAvailable (bool)
  • $delay (int) amount of seconds to delay reconsidering that storage further
public static OC\Files\Cache\Storage::exists($storageId)
Check if a string storage id is known
Source:

lib/private/Files/Cache/Storage.php#197

Parameters:
  • $storageId (string)
Returns:

bool

public static OC\Files\Cache\Storage::remove($storageId)
remove the entry for the storage
Source:

lib/private/Files/Cache/Storage.php#206

Parameters:
  • $storageId (string)