CacheWrapper¶
-
class
OC\Files\Cache\Wrapper\
CacheWrapper
¶ Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#38 Parent: OC\Files\Cache\Cache
Properties¶
-
protected static property
OC\Files\Cache\Wrapper\CacheWrapper::$
cache
¶ Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#42 Type: \OCP\Files\Cache\ICache
Methods¶
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
__construct
($cache)¶ Source: Parameters: - $cache (
OCP\Files\Cache\ICache
)
- $cache (
-
protected
OC\Files\Cache\Wrapper\CacheWrapper::
getCache
()¶ Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#51
-
protected
OC\Files\Cache\Wrapper\CacheWrapper::
formatCacheEntry
($entry)¶ - Make it easy for wrappers to modify every returned cache entry
Source: Parameters: - $entry (
OCP\Files\Cache\ICacheEntry
)
Returns: - $entry (
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
get
($file)¶ - get the stored metadata of a file or folder
Source: Parameters: - $file (string | int)
Returns: \OCP\Files\Cache\ICacheEntry
| bool
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getFolderContents
($folder)¶ - get the metadata of all files stored in $folder
Source: Parameters: - $folder (string)
Returns:
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getFolderContentsById
($fileId)¶ - get the metadata of all files stored in $folder
Source: Parameters: - $fileId (int) the file id of the folder
Returns: array
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
put
($file, $data)¶ - insert or update meta data for a file or folder
Source: Parameters: - $file (string)
- $data (array)
Returns: int file id
Throws: \RuntimeException
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
insert
($file, $data)¶ - insert meta data for a new file or folder
Source: Parameters: - $file (string)
- $data (array)
Returns: int file id
Throws: \RuntimeException
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
update
($id, $data)¶ - update the metadata in the cache
Source: Parameters: - $id (int)
- $data (array)
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getId
($file)¶ - get the file id for a file
Source: Parameters: - $file (string)
Returns: int
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getParentId
($file)¶ - get the id of the parent folder of a file
Source: Parameters: - $file (string)
Returns: int
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
inCache
($file)¶ - check if a file is available in the cache
Source: Parameters: - $file (string)
Returns: bool
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
remove
($file)¶ - remove a file or folder from the cache
Source: Parameters: - $file (string)
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
move
($source, $target)¶ - Move a file or folder in the cache
Source: Parameters: - $source (string)
- $target (string)
-
protected
OC\Files\Cache\Wrapper\CacheWrapper::
getMoveInfo
($path)¶ Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#193
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
moveFromCache
($sourceCache, $sourcePath, $targetPath)¶ Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#199
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
clear
()¶ - remove all entries for files that are stored on the storage from the cache
Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#206
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getStatus
($file)¶ Source: Parameters: - $file (string)
Returns: int Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
search
($pattern)¶ - search for files matching $pattern
Source: Parameters: - $pattern (string)
Returns: \OCP\Files\Cache\ICacheEntry[]
an array of file data
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
searchByMime
($mimetype)¶ - search for files by mimetype
Source: Parameters: - $mimetype (string)
Returns:
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
searchQuery
($query)¶ Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#241
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
correctFolderSize
($path, $data=null, $isBackgroundScan=false)¶ - update the folder size and the size of all parent folders
Source: Parameters: - $path (string | bool)
- $data (array) (optional) meta data of the folder
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
calculateFolderSize
($path, $entry=null)¶ - get the size of a folder and set it in the cache
Source: Parameters: - $path (string)
- $entry (array) (optional) meta data of the folder
Returns: int
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getAll
()¶ - get all file ids on the files on the storage
Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#278 Returns: int[]
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getIncomplete
()¶ - find a folder in the cache which has not been fully scannedIf multiple incomplete folders are in the cache, the one with the highest id will be returned,use the one with the highest id gives the best result with the background scanner, since that is mostlikely the folder where we stopped scanning previously
Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#291 Returns: string | bool the path of the folder or false when no folder matched
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getPathById
($id)¶ - get the path of a file on this storage by it’s id
Source: Parameters: - $id (int)
Returns: string | null
-
public
OC\Files\Cache\Wrapper\CacheWrapper::
getNumericStorageId
()¶ - Returns the numeric storage id
Source: lib/private/Files/Cache/Wrapper/CacheWrapper.php#310 Returns: int
-
public static
OC\Files\Cache\Wrapper\CacheWrapper::
getById
($id)¶ - get the storage id of the storage for a file and the internal path of the fileunlike getPathById this does not limit the search to files on this storage andinstead does a global search in the cache table
Source: Parameters: - $id (int)
Returns: array first element holding the storage id, second the path