IScanner
Scan files from the storage and save to the cache
Tags
Table of Contents
- REUSE_ETAG = 1
- REUSE_NONE = 0
- REUSE_SIZE = 2
- SCAN_RECURSIVE = true
- SCAN_RECURSIVE_INCOMPLETE = 2
- SCAN_SHALLOW = false
- backgroundScan() : mixed
- walk over any folders that are not fully scanned yet and scan them
- isPartialFile() : bool
- check if the file should be ignored when scanning NOTE: files with a '.part' extension are ignored as well! prevents unfinished put requests to be scanned
- scan() : array
- scan a folder and all its children
- scanFile() : array
- scan a single file and store it in the cache
Constants
REUSE_ETAG
public
mixed
REUSE_ETAG
= 1
REUSE_NONE
public
mixed
REUSE_NONE
= ""
REUSE_SIZE
public
mixed
REUSE_SIZE
= 2
SCAN_RECURSIVE
public
mixed
SCAN_RECURSIVE
= true
SCAN_RECURSIVE_INCOMPLETE
public
mixed
SCAN_RECURSIVE_INCOMPLETE
= 2
SCAN_SHALLOW
public
mixed
SCAN_SHALLOW
= false
Methods
backgroundScan()
walk over any folders that are not fully scanned yet and scan them
public
backgroundScan() : mixed
Tags
Return values
mixed —isPartialFile()
check if the file should be ignored when scanning NOTE: files with a '.part' extension are ignored as well! prevents unfinished put requests to be scanned
public
static isPartialFile(string $file) : bool
Parameters
- $file : string
Tags
Return values
bool —scan()
scan a folder and all its children
public
scan(string $path[, bool $recursive = self::SCAN_RECURSIVE ][, int $reuse = -1 ][, bool $lock = true ]) : array
Parameters
- $path : string
- $recursive : bool = self::SCAN_RECURSIVE
- $reuse : int = -1
- $lock : bool = true
-
set to false to disable getting an additional read lock during scanning
Tags
Return values
array —an array of the meta data of the scanned file or folder
scanFile()
scan a single file and store it in the cache
public
scanFile(string $file, int $reuseExisting[, int $parentId = -1 ][, mixed $cacheData = null ][, bool $lock = true ]) : array
Parameters
- $file : string
- $reuseExisting : int
- $parentId : int = -1
- $cacheData : mixed = null
- $lock : bool = true
-
set to false to disable getting an additional read lock during scanning
Tags
Return values
array —an array of metadata of the scanned file