IScanner
in
Scan files from the storage and save to the cache
Tags
Table of Contents
Constants
- REUSE_ETAG = 1
- REUSE_NONE = 0
- REUSE_SIZE = 2
- SCAN_RECURSIVE = true
- SCAN_RECURSIVE_INCOMPLETE = 2
- SCAN_SHALLOW = false
Methods
- 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<string|int, mixed>|null
- scan a folder and all its children
- scanFile() : array<string|int, mixed>|null
- scan a single file and store it in the cache
Constants
REUSE_ETAG
public
mixed
REUSE_ETAG
= 1
Tags
REUSE_NONE
public
mixed
REUSE_NONE
= 0
Tags
REUSE_SIZE
public
mixed
REUSE_SIZE
= 2
Tags
SCAN_RECURSIVE
public
mixed
SCAN_RECURSIVE
= true
Tags
SCAN_RECURSIVE_INCOMPLETE
public
mixed
SCAN_RECURSIVE_INCOMPLETE
= 2
Tags
SCAN_SHALLOW
public
mixed
SCAN_SHALLOW
= false
Tags
Methods
backgroundScan()
walk over any folders that are not fully scanned yet and scan them
public
backgroundScan() : mixed
Tags
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
boolscan()
scan a folder and all its children
public
scan(string $path[, bool $recursive = self::SCAN_RECURSIVE ][, int $reuse = -1 ][, bool $lock = true ]) : array<string|int, mixed>|null
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<string|int, mixed>|null —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 = 0 ][, int $parentId = -1 ][, array<string|int, mixed>|null $cacheData = null ][, bool $lock = true ]) : array<string|int, mixed>|null
Parameters
- $file : string
- $reuseExisting : int = 0
- $parentId : int = -1
- $cacheData : array<string|int, mixed>|null = null
-
existing data in the cache for the file to be scanned
- $lock : bool = true
-
set to false to disable getting an additional read lock during scanning
Tags
Return values
array<string|int, mixed>|null —an array of metadata of the scanned file