Local
Local
- Full name:
\Hazaar\File\Backend\Local
- This class implements:
\Hazaar\File\Backend\Interfaces\Backend
,\Hazaar\File\Backend\Interfaces\Driver
Properties
separator
public string $separator
manager
protected \Hazaar\File\Manager $manager
options
private \Hazaar\Map $options
meta
private array $meta
Methods
__construct
public __construct(array|\Hazaar\Map $options, \Hazaar\File\Manager $manager): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$options | array|\Hazaar\Map | |
$manager | \Hazaar\File\Manager |
label
public static label(): string
- This method is static.
refresh
public refresh(bool $reset = false): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$reset | bool |
resolvePath
public resolvePath(string $path, ?string $file = null): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$file | ?string |
scandir
Get a directory listing.
public scandir(string $path, ?string $regex_filter = null, int $sort = SCANDIR_SORT_ASCENDING, bool $show_hidden = false, ?string $relative_path = null): string[]|bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$regex_filter | ?string | |
$sort | int | |
$show_hidden | bool | |
$relative_path | ?string |
read
public read(string $file, int $offset = -1, ?int $maxlen = null): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$file | string | |
$offset | int | |
$maxlen | ?int |
write
public write(string $file, string $data, ?string $content_type = null, bool $overwrite = true): ?int
Parameters:
Parameter | Type | Description |
---|---|---|
$file | string | |
$data | string | |
$content_type | ?string | |
$overwrite | bool |
upload
Upload a file that was uploaded with a POST.
public upload(string $path, string[] $file, bool $overwrite = true): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$file | string[] | |
$overwrite | bool |
copy
public copy(string $src, string $dst, bool $recursive = false): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$src | string | |
$dst | string | |
$recursive | bool |
link
public link(string $src, string $dst): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$src | string | |
$dst | string |
move
public move(string $src, string $dst): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$src | string | |
$dst | string |
unlink
public unlink(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
mimeContentType
public mimeContentType(string $path): ?string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
md5Checksum
public md5Checksum(string $path): ?string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
mkdir
Makes directory.
public mkdir(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
rmdir
Removes directory.
public rmdir(string $path, bool $recurse = false): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$recurse | bool |
exists
Checks whether a file or directory exists.
public exists(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
realpath
Returns canonicalized absolute pathname.
public realpath(string $path): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isReadable
true if path is a readable.
public isReadable(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isWritable
true if path is writable.
public isWritable(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isDir
true if path is a directory.
public isDir(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isLink
true if path is a symlink.
public isLink(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isFile
true if path is a normal file.
public isFile(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filetype
Returns the file type.
public filetype(string $path): string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filectime
Returns the file create time.
public filectime(string $path): int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filemtime
Returns the file modification time.
public filemtime(string $path): int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
touch
Sets access and modification time of file.
public touch(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
fileatime
public fileatime(string $path): int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filesize
public filesize(string $path): int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
fileperms
public fileperms(string $path): int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
chmod
public chmod(string $path, int $mode): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$mode | int |
chown
public chown(string $path, string $user): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$user | string |
chgrp
public chgrp(string $path, string $group): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$group | string |
cwd
public cwd(): string
setMeta
public setMeta(string $path, array $values): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$values | array |
getMeta
public getMeta(string $path, ?string $key = null): array|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$key | ?string |
previewURL
public previewURL(string $path, array<string,int|string> $params = []): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$params | array<string,int|string> |
directURL
public directURL(string $path): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
authorise
public authorise(?string $redirect_uri = null): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$redirect_uri | ?string |
authorised
public authorised(): bool
buildAuthURL
public buildAuthURL(?string $callback_url = null): ?string
Parameters:
Parameter | Type | Description |
---|---|---|
$callback_url | ?string |
thumbnailURL
public thumbnailURL(string $path, int $width = 100, int $height = 100, string $format = 'jpeg', array $params = []): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$width | int | |
$height | int | |
$format | string | |
$params | array |
openStream
Direct stream read/write methods.
public openStream(string $path, string $mode): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$mode | string |
writeStream
public writeStream(resource $stream, string $bytes, ?int $length = null): int
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource | |
$bytes | string | |
$length | ?int |
readStream
public readStream(resource $stream, int $length): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource | |
$length | int |
seekStream
public seekStream(resource $stream, int $offset, int $whence = SEEK_SET): int
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource | |
$offset | int | |
$whence | int |
tellStream
public tellStream(resource $stream): false|int
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource |
eofStream
public eofStream(resource $stream): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource |
truncateStream
public truncateStream(resource $stream, int $size): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource | |
$size | int |
lockStream
public lockStream(resource $stream, int $operation, ?int& $wouldblock = null): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource | |
$operation | int | |
$wouldblock | ?int |
flushStream
public flushStream(resource $stream): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource |
getsStream
public getsStream(resource $stream, ?int $length = null): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource | |
$length | ?int |
closeStream
public closeStream(resource $stream): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$stream | resource |
meta
private meta(string $fullpath): \Hazaar\File\BTree
Parameters:
Parameter | Type | Description |
---|---|---|
$fullpath | string |
Automatically generated on 2024-11-14