GoogleDrive
GoogleDrive
- Full name:
\Hazaar\File\Backend\GoogleDrive
- Parent class:
\Hazaar\HTTP\Client
- This class implements:
\Hazaar\File\Backend\Interfaces\Backend
,\Hazaar\File\Backend\Interfaces\Driver
Properties
separator
public string $separator
manager
protected \Hazaar\File\Manager $manager
scope
private string[] $scope
options
private \Hazaar\Map $options
cache
private \Hazaar\Cache $cache
meta
private array $meta
meta_items
private string[] $meta_items
cursor
private int $cursor
oauth2ID
private string $oauth2ID
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 |
__destruct
public __destruct(): mixed
label
public static label(): string
- This method is static.
reload
public reload(): bool
reset
public reset(): bool
authorise
public authorise(?string $redirect_uri = null): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$redirect_uri | ?string |
authorised
public authorised(): bool
buildAuthURL
public buildAuthURL(?string $redirect_uri = null): string
Parameters:
Parameter | Type | Description |
---|---|---|
$redirect_uri | ?string |
refresh
public refresh(bool $reset = false): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$reset | bool |
scandir
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 |
exists
public exists(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
realpath
public realpath(string $path): ?string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isReadable
public isReadable(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isWritable
public isWritable(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isDir
public isDir(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isLink
public isLink(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
isFile
public isFile(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filetype
public filetype(string $path): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filectime
public filectime(string $path): false|int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filemtime
public filemtime(string $path): false|int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
touch
public touch(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
fileatime
public fileatime(string $path): false|int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
filesize
public filesize(string $path): false|int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
fileperms
public fileperms(string $path): false|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
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
public mkdir(string $path): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
rmdir
public rmdir(string $path, bool $recurse = false): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$recurse | 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 |
read
public read(string $path, int $offset = -1, ?int $maxlen = null): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$offset | int | |
$maxlen | ?int |
write
public write(string $file, string $data, ?string $content_type = null, bool $overwrite = false): ?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 |
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|false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$key | ?string |
previewURL
public previewURL(string $path, array<string,int|string> $param = []): false|string
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string | |
$param | array<string,int|string> |
directURL
public directURL(string $path): 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|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): 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 |
sendRequest
private sendRequest(\Hazaar\HTTP\Request $request, bool $is_meta = true): \Hazaar\Map|string
Parameters:
Parameter | Type | Description |
---|---|---|
$request | \Hazaar\HTTP\Request | |
$is_meta | bool |
itemHasParent
private itemHasParent(array $item, string $parentId): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$item | array | |
$parentId | string |
resolvePath
private resolvePath(string $path): array|false
Parameters:
Parameter | Type | Description |
---|---|---|
$path | string |
resolveItem
private resolveItem(array<string,int|string> $item): string[]
Parameters:
Parameter | Type | Description |
---|---|---|
$item | array<string,int|string> |
Inherited methods
__construct
public __construct(?string $localCert = null, ?string $passphrase = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$localCert | ?string | |
$passphrase | ?string |
auth
public auth(string $username, string $password): void
Parameters:
Parameter | Type | Description |
---|---|---|
$username | string | |
$password | string |
authorisation
public authorisation(\Hazaar\Auth\Adapter $auth): void
Parameters:
Parameter | Type | Description |
---|---|---|
$auth | \Hazaar\Auth\Adapter |
setHeader
public setHeader(string $header, string $value): void
Parameters:
Parameter | Type | Description |
---|---|---|
$header | string | |
$value | string |
options
public options(string $url): false|\Hazaar\HTTP\Response
Parameters:
Parameter | Type | Description |
---|---|---|
$url | string |
get
public get(string|\Hazaar\HTTP\URL $url, int $redirectLimit = 10, int $offset = -1, ?int $maxlen = null): false|\Hazaar\HTTP\Response
Parameters:
Parameter | Type | Description |
---|---|---|
$url | string|\Hazaar\HTTP\URL | |
$redirectLimit | int | |
$offset | int | |
$maxlen | ?int |
head
public head(string|\Hazaar\HTTP\URL $url, int $redirectLimit = 10): false|\Hazaar\HTTP\Response
Parameters:
Parameter | Type | Description |
---|---|---|
$url | string|\Hazaar\HTTP\URL | |
$redirectLimit | int |
post
public post(string|\Hazaar\HTTP\URL $url, mixed $data = null, ?string $dataType = null, int $redirectLimit): false|\Hazaar\HTTP\Response
Parameters:
Parameter | Type | Description |
---|---|---|
$url | string|\Hazaar\HTTP\URL | |
$data | mixed | |
$dataType | ?string | |
$redirectLimit | int |
delete
public delete(string|\Hazaar\HTTP\URL $url): false|\Hazaar\HTTP\Response
Parameters:
Parameter | Type | Description |
---|---|---|
$url | string|\Hazaar\HTTP\URL |
trace
public trace(string|\Hazaar\HTTP\URL $url): false|\Hazaar\HTTP\Response
Parameters:
Parameter | Type | Description |
---|---|---|
$url | string|\Hazaar\HTTP\URL |
send
Send a request to the desination host.
public send(\Hazaar\HTTP\Request $request, int $redirectLimit = 10): false|\Hazaar\HTTP\Response
Parameters:
Parameter | Type | Description |
---|---|---|
$request | \Hazaar\HTTP\Request | The request to send |
$redirectLimit | int | The number of allowed redirects. To disable automated redirects on this request, set to FALSE. |
getLastError
public getLastError(): string
getCookies
public getCookies(): array
getCookie
public getCookie(string $name): null|string[]|string
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string |
hasCookie
public hasCookie(string $name): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string |
deleteCookie
public deleteCookie(string $name): void
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string |
setCookie
public setCookie(string[]|string $cookie): array
Parameters:
Parameter | Type | Description |
---|---|---|
$cookie | string[]|string |
cacheCookie
public cacheCookie(\Hazaar\Cache $cache, bool $cacheAll = false): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$cache | \Hazaar\Cache | |
$cacheAll | bool |
uncacheCookie
public uncacheCookie(\Hazaar\Cache $cache): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$cache | \Hazaar\Cache |
deleteCookies
public deleteCookies(): void
disableRedirect
public disableRedirect(): void
enableEncryption
public enableEncryption(?string $key = null, ?string $cipher = null): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | ?string | |
$cipher | ?string |
applyCookies
private applyCookies(\Hazaar\HTTP\Request $request): \Hazaar\HTTP\Request
Parameters:
Parameter | Type | Description |
---|---|---|
$request | \Hazaar\HTTP\Request |
Automatically generated on 2024-11-14