Nextcloud PHP API (master)

IScanner

Scan files from the storage and save to the cache

Tags
since
9.0.0

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>
scan a folder and all its children
scanFile()  : array<string|int, mixed>
scan a single file and store it in the cache

Constants

REUSE_ETAG

public mixed REUSE_ETAG = 1
Tags
since
9.0.0

REUSE_NONE

public mixed REUSE_NONE = 0
Tags
since
12.0.0

REUSE_SIZE

public mixed REUSE_SIZE = 2
Tags
since
9.0.0

SCAN_RECURSIVE

public mixed SCAN_RECURSIVE = true
Tags
since
9.0.0

SCAN_RECURSIVE_INCOMPLETE

public mixed SCAN_RECURSIVE_INCOMPLETE = 2
Tags
since
9.0.0

SCAN_SHALLOW

public mixed SCAN_SHALLOW = false
Tags
since
9.0.0

Methods

backgroundScan()

walk over any folders that are not fully scanned yet and scan them

public backgroundScan() : mixed
Tags
since
9.0.0

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
since
9.0.0
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<string|int, mixed>
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
since
9.0.0
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 ][, mixed $cacheData = null ][, bool $lock = true ]) : array<string|int, mixed>
Parameters
$file : string
$reuseExisting : int = 0
$parentId : int = -1
$cacheData : mixed = null
$lock : bool = true

set to false to disable getting an additional read lock during scanning

Tags
throws
ServerNotAvailableException
throws
LockedException
since
9.0.0
Return values
array<string|int, mixed>

| null an array of metadata of the scanned file


        
On this page

Search results