Represent google drive.
class GoogleDrive extends \Hazaar\File\Backend\Client implements \Hazaar\File\Backend\BackendInterface , \Hazaar\File\Backend\DriverInterface
Store the separator.
public string $separator = '/'
private array $scope = array (
0 => 'https://www.googleapis.com/auth/drive',
)
Store the cache.
Store the cursor.
Create a new instance.
public __construct(array $options): void
| Parameter | Type | Description |
|---|
$options | array | |
Clean up resources before destruction.
public __destruct(): void
Return the human-readable label for this backend implementation.
Reload backend state from the configured remote service.
Clear cached backend state and rebuild runtime metadata.
Run the authorization flow required by the remote backend service.
public authorise(?string $redirectUri): bool
| Parameter | Type | Description |
|---|
$redirectUri | string | |
Authorise with code.
public authoriseWithCode(string $code, ?string $redirectUri, string $grantType = 'authorization_code'): bool
| Parameter | Type | Description |
|---|
$code | string | |
$redirectUri | string | |
$grantType | string | |
Check whether this backend currently has valid authorization credentials.
public authorised(): bool
Build auth u r l.
public buildAuthURL(?string $redirectUri): string
| Parameter | Type | Description |
|---|
$redirectUri | string | |
Refresh the remote authorization token used by this backend.
public refresh(bool $reset): bool
| Parameter | Type | Description |
|---|
$reset | bool | |
List directory entries for a path in backend storage.
public scandir(string $path, ?string $regexFilter, int $sort = 'SCANDIR_SORT_ASCENDING', bool $showHidden, ?string $relativePath, bool $): void
| Parameter | Type | Description |
|---|
$path | string | |
$regexFilter | string | |
$sort | int | |
$showHidden | bool | |
$relativePath | string | |
$ | bool | |
Determine whether a path exists in backend storage.
public exists(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Resolve a logical backend path to its canonical remote representation.
public realpath(string $path): ?string
| Parameter | Type | Description |
|---|
$path | string | |
Check whether the instance readable.
public isReadable(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Check whether the instance writable.
public isWritable(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Check whether the instance dir.
public isDir(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Check whether the instance link.
public isLink(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Check whether the instance file.
public isFile(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Return the file type for a backend path.
public filetype(string $path): string
| Parameter | Type | Description |
|---|
$path | string | |
Return the creation timestamp for a backend path.
public filectime(string $path): int
| Parameter | Type | Description |
|---|
$path | string | |
Return the last-modified timestamp for a backend path.
public filemtime(string $path): int
| Parameter | Type | Description |
|---|
$path | string | |
Create a file or update modification time for a backend path.
public touch(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Return the last-access timestamp for a backend path.
public fileatime(string $path): int
| Parameter | Type | Description |
|---|
$path | string | |
Return the file size in bytes for a backend path.
public filesize(string $path): int
| Parameter | Type | Description |
|---|
$path | string | |
Return permission metadata for a backend path when available.
public fileperms(string $path): int
| Parameter | Type | Description |
|---|
$path | string | |
Update permission metadata for a backend path when supported.
public chmod(string $path, int $mode): bool
| Parameter | Type | Description |
|---|
$path | string | |
$mode | int | |
Update owner metadata for a backend path when supported.
public chown(string $path, string $user): bool
| Parameter | Type | Description |
|---|
$path | string | |
$user | string | |
Update group metadata for a backend path when supported.
public chgrp(string $path, string $group): bool
| Parameter | Type | Description |
|---|
$path | string | |
$group | string | |
Return the current working directory for this backend.
Delete a file at the supplied backend path.
public unlink(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Mime content type.
public mimeContentType(string $path): ?string
| Parameter | Type | Description |
|---|
$path | string | |
Md5 checksum.
public md5Checksum(string $path): ?string
| Parameter | Type | Description |
|---|
$path | string | |
Create a directory at the supplied backend path.
public mkdir(string $path): bool
| Parameter | Type | Description |
|---|
$path | string | |
Remove a directory at the supplied backend path.
public rmdir(string $path, bool $recurse): bool
| Parameter | Type | Description |
|---|
$path | string | |
$recurse | bool | |
Copy a file or directory within backend storage.
public copy(string $src, string $dst, bool $overwrite): bool
| Parameter | Type | Description |
|---|
$src | string | |
$dst | string | |
$overwrite | bool | |
Create a link or alias to a backend object when supported.
public link(string $src, string $dst): bool
| Parameter | Type | Description |
|---|
$src | string | |
$dst | string | |
Move or rename a backend object.
public move(string $src, string $dst): bool
| Parameter | Type | Description |
|---|
$src | string | |
$dst | string | |
Read and return file contents from backend storage.
public read(string $path, int $offset = -1, ?int $maxlen): string
| Parameter | Type | Description |
|---|
$path | string | |
$offset | int | |
$maxlen | int | |
Write content to a backend path and return bytes written.
public write(string $file, string $data, ?string $contentType, bool $overwrite): ?int
| Parameter | Type | Description |
|---|
$file | string | |
$data | string | |
$contentType | string | |
$overwrite | bool | |
public upload(string $path, array $file, bool $overwrite = true): bool
| Parameter | Type | Description |
|---|
$path | string | |
$file | array | |
$overwrite | bool | |
public setMeta(string $path, array $values): bool
| Parameter | Type | Description |
|---|
$path | string | |
$values | array | |
Get the meta.
public getMeta(string $path, ?string $key, string $): void
| Parameter | Type | Description |
|---|
$path | string | |
$key | string | |
$ | string | |
public previewURL(string $path, array $param): string
| Parameter | Type | Description |
|---|
$path | string | |
$param | array | |
Direct u r l.
public directURL(string $path): string
| Parameter | Type | Description |
|---|
$path | string | |
Thumbnail u r l.
public thumbnailURL(string $path, int $width = 100, int $height = 100, string $format = 'jpeg', array $params): string
| Parameter | Type | Description |
|---|
$path | string | |
$width | int | |
$height | int | |
$format | string | |
$params | array | |
Open stream.
public openStream(string $path, string $mode): mixed
| Parameter | Type | Description |
|---|
$path | string | |
$mode | string | |
public writeStream(resource $stream, string $bytes, ?int $length): int
| Parameter | Type | Description |
|---|
$stream | resource | |
$bytes | string | |
$length | int | |
public readStream(resource $stream, int $length): string
| Parameter | Type | Description |
|---|
$stream | resource | |
$length | int | |
public seekStream(mixed $stream, int $offset, int $whence = 'SEEK_SET'): int
| Parameter | Type | Description |
|---|
$stream | mixed | |
$offset | int | |
$whence | int | |
public tellStream(mixed $stream): int
| Parameter | Type | Description |
|---|
$stream | mixed | |
public eofStream(mixed $stream): bool
| Parameter | Type | Description |
|---|
$stream | mixed | |
public truncateStream(mixed $stream, int $size): bool
| Parameter | Type | Description |
|---|
$stream | mixed | |
$size | int | |
public lockStream(mixed $stream, int $operation, ?int $wouldblock): bool
| Parameter | Type | Description |
|---|
$stream | mixed | |
$operation | int | |
$wouldblock | int | |
public flushStream(mixed $stream): bool
| Parameter | Type | Description |
|---|
$stream | mixed | |
public getsStream(mixed $stream, ?int $length): string
| Parameter | Type | Description |
|---|
$stream | mixed | |
$length | int | |
public closeStream(resource $stream): bool
| Parameter | Type | Description |
|---|
$stream | resource | |
Search backend storage for entries matching the supplied pattern.
public find(?string $search, string $path = '/', bool $caseInsensitive, false $): void
| Parameter | Type | Description |
|---|
$search | string | |
$path | string | |
$caseInsensitive | bool | |
$ | false | |
Run a backend consistency check and return diagnostic results.
public fsck(bool $skipRoot_reload): bool
| Parameter | Type | Description |
|---|
$skipRoot_reload | bool | |
Send request.
private sendRequest(Request $request, bool $isMeta = true, string $): void
| Parameter | Type | Description |
|---|
$request | Request | |
$isMeta | bool | |
$ | string | |
Item has parent.
private itemHasParent(\stdClass $item, string $parentId): bool
| Parameter | Type | Description |
|---|
$item | \stdClass | |
$parentId | string | |
Resolve path.
private resolvePath(string $path): \stdClass
| Parameter | Type | Description |
|---|
$path | string | |
private resolveItem(\stdClass $item): void
| Parameter | Type | Description |
|---|
$item | \stdClass | |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000