Backend
Backend
Define the contract for backend.
interface BackendMethods
refresh
Refreshes the backend state.
public refresh(bool $reset): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$reset | bool |
scandir
public scandir(string $path, ?string $regexFilter, int $sort = 'SCANDIR_SORT_ASCENDING', bool $showHidden, ?string $relativePath): array|boolReturns: array|bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$regexFilter | string | |
$sort | int | |
$showHidden | bool | |
$relativePath | string |
touch
Updates the access and modification time of the file at the given path.
public touch(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
exists
Checks if the file or path exists.
public exists(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
realpath
Returns the real path of the given file or directory.
public realpath(string $path): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
isReadable
Checks if the file or directory is readable.
public isReadable(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
isWritable
Checks if the file or directory is writable.
public isWritable(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
isDir
Checks if the path is a directory.
public isDir(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
isLink
Checks if the path is a symbolic link.
public isLink(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
isFile
Checks if the path is a regular file.
public isFile(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
filetype
Returns the type of the file.
public filetype(string $path): false|stringReturns: false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
filectime
Returns the creation time of the file.
public filectime(string $path): false|intReturns: false|int
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
filemtime
Returns the modification time of the file.
public filemtime(string $path): false|intReturns: false|int
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
fileatime
Returns the access time of the file.
public fileatime(string $path): false|intReturns: false|int
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
filesize
Returns the size of the file in bytes.
public filesize(string $path): false|intReturns: false|int
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
fileperms
Returns the permissions of the file.
public fileperms(string $path): false|intReturns: false|int
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
chmod
Changes the permissions of the file.
public chmod(string $path, int $mode): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$mode | int |
chown
Changes the owner of the file.
public chown(string $path, string $user): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$user | string |
chgrp
Changes the group of the file.
public chgrp(string $path, string $group): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$group | string |
unlink
Deletes the file at the given path.
public unlink(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
mimeContentType
Returns the MIME content type of the file.
public mimeContentType(string $path): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
md5Checksum
Returns the MD5 checksum of the file.
public md5Checksum(string $path): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
cwd
Gets the current working directory.
public cwd(): stringReturns: string
mkdir
Creates a directory at the given path.
public mkdir(string $path): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
rmdir
Removes a directory at the given path.
public rmdir(string $path, bool $recurse): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$recurse | bool |
copy
Copies a file from source to destination.
public copy(string $src, string $dst, bool $overwrite): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$src | string | |
$dst | string | |
$overwrite | bool |
move
Moves a file from source to destination.
public move(string $src, string $dst): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$src | string | |
$dst | string |
link
Creates a link from source to destination.
public link(string $src, string $dst): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$src | string | |
$dst | string |
read
Reads the contents of a file.
public read(string $path, int $offset = -1, ?int $maxlen): false|stringReturns: false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$offset | int | |
$maxlen | int |
write
Writes data to a file.
public write(string $path, string $bytes, ?string $contentType, bool $overwrite): ?intReturns: int
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$bytes | string | |
$contentType | string | |
$overwrite | bool |
find
public find(?string $search, string $path = '/', bool $caseInsensitive): array|falseReturns: array|false
Parameters
| Parameter | Type | Description |
|---|---|---|
$search | string | |
$path | string | |
$caseInsensitive | bool |
fsck
Performs a filesystem check.
public fsck(bool $skipRoot_reload): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$skipRoot_reload | bool |
upload
Upload a file that was uploaded with a POST.
public upload(string $path, array $file, bool $overwrite): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$file | array | |
$overwrite | bool |
setMeta
public setMeta(string $path, array $values): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$values | array |
getMeta
public getMeta(string $path, ?string $key): array|false|stringReturns: array|false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$key | string |
previewURL
public previewURL(string $path, array $params): false|stringReturns: false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$params | array |
directURL
Direct u r l.
public directURL(string $path): false|stringReturns: false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string |
thumbnailURL
public thumbnailURL(string $path, int $width = 100, int $height = 100, string $format = 'jpeg', array $params): false|stringReturns: false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$width | int | |
$height | int | |
$format | string | |
$params | array |
authorise
Authorises the backend, optionally with a redirect URI.
public authorise(?string $redirectUri): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$redirectUri | string |
authoriseWithCode
Authorises the backend using an authorization code.
public authoriseWithCode(string $code, ?string $redirectUri, string $grantType = 'authorization_code', array $options): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$code | string | |
$redirectUri | string | |
$grantType | string | |
$options | array |
authorised
Checks if the backend is authorised.
public authorised(): boolReturns: bool
buildAuthURL
Builds the authorisation URL for the backend.
public buildAuthURL(?string $callbackUrl): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$callbackUrl | string |
openStream
Opens a stream to the file at the given path.
public openStream(string $path, string $mode): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | |
$mode | string |
writeStream
Writes data to a stream.
public writeStream(mixed $stream, string $bytes, ?int $length): intReturns: int
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed | |
$bytes | string | |
$length | int |
readStream
Reads data from a stream.
public readStream(mixed $stream, int $length): false|stringReturns: false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed | |
$length | int |
seekStream
Seeks to a position in a stream.
public seekStream(mixed $stream, int $offset, int $whence = 'SEEK_SET'): intReturns: int
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed | |
$offset | int | |
$whence | int |
tellStream
Returns the current position in a stream.
public tellStream(mixed $stream): false|intReturns: false|int
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed |
eofStream
Checks if the stream is at end-of-file.
public eofStream(mixed $stream): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed |
truncateStream
Truncates a stream to the given size.
public truncateStream(mixed $stream, int $size): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed | |
$size | int |
lockStream
Locks a stream for reading or writing.
public lockStream(mixed $stream, int $operation, ?int $wouldblock): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed | |
$operation | int | |
$wouldblock | int |
flushStream
Flushes the output of a stream.
public flushStream(mixed $stream): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed |
getsStream
Gets a line from a stream.
public getsStream(mixed $stream, ?int $length): false|stringReturns: false|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed | |
$length | int |
closeStream
Closes a stream.
public closeStream(mixed $stream): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | mixed |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000