Properties

$KEYBASED

$KEYBASED : bool

If set to true, Adapter is ID based

Type

bool

$_connectionID

$_connectionID : int

Type

int — Current Connection ID

$_currentDir

$_currentDir : string

Contain current Directory

Type

string

$_currentPathKey

$_currentPathKey : string

Contain current Directory Key

Type

string

$RequireCurl

$RequireCurl : bool

If set to true, Adapter need Curl

Type

bool

$RequireMcrypt

$RequireMcrypt : bool

If set to true, Adapter need MCrypt

Type

bool

$UNLINKABLE

$UNLINKABLE : bool

If set to tue, adapter support Unlink Connections

Type

bool

$loginFields

$loginFields : bool

If set to true, adapter support individual login fields

Type

bool

$hasRootFolder

$hasRootFolder : bool

If set to true, adapter have set a Root Folder

Type

bool

$_connection

$_connection : \CloudFile\Connection

Use getConnection() to get current Connection

Type

\CloudFile\Connection

Methods

__construct()

__construct(bool $connectionID, array $settings)

Base constructor.

Parameters

bool $connectionID

ID of the Connection to manage

array $settings

Configuration of this Connection

mkdir()

mkdir(mixed $name)

Create a Folder within the current directory

Parameters

mixed $name

string Name of new folder

chdir()

chdir(mixed $directory, bool $currentPathKey)

Change current directory to the one in parameter

Parameters

mixed $directory

string Absolute Path to new current directory

bool $currentPathKey

upload()

upload(string $localFilename, string $newFilename, bool $overwrite)

Upload a file

Parameters

string $localFilename

Local filepath to upload

string $newFilename

Filename within current directory of uploaded file

bool $overwrite

Should file overwrite existing file?

downloadTo()

downloadTo(string $filename, string $key, mixed $outputFile)

Download a file from current folder and store it to local file

Parameters

string $filename

Filename to download

string $key

Filekey to download

mixed $outputFile

string Filepath to store the file

file_get_contents()

file_get_contents(string $filename, bool $output, string $key) : mixed

Download a file from current folder and return the file content

Parameters

string $filename

Filename to download

bool $output

Should the file directly send to user

string $key

Filekey to download

Returns

mixed

getFiles()

getFiles() : array

Get all files within the current directory

Throws

\Exception

When connection throw an error

Returns

array

getCurrentPathKey()

getCurrentPathKey() : string

Get the current path key

Returns

string

isUnlinkable()

isUnlinkable() : bool

Have Provider feature to be unlinked (Remove OAUTH Token, for example)

Returns

bool

hasRootFolder()

hasRootFolder() : bool

Did the connection have a Root Folder

Returns

bool

getRootPath()

getRootPath() : string

Get the curent Root FolderPath of Connection

Returns

string

getRootKey()

getRootKey() : string

Get the currnt Root Folder Key of Connection

Returns

string

hasLoginFields()

hasLoginFields() : bool

Function will check if current Adapter support User based Login Fields

Returns

bool

requireCurl()

requireCurl() : bool

Adapter require Curl Library

Returns

bool

requireMCrypt()

requireMCrypt() : bool

Adapter require MCrypt

Returns

bool

generateKey()

generateKey(mixed $path) : string

Generate a Key from Filepath Works very slow and should only be used if you really don't have the Key

Parameters

mixed $path

string Filepath

Returns

string —

FileKey

getParentKey()

getParentKey(string $key) : string

Function to get the parent File Key of a File Key

Parameters

string $key

File Key

Returns

string —

Parent Key

getFile()

getFile(string $filename, string $fileKey) : array|bool

Get single file with metadata

Parameters

string $filename

Filename within current directory

string $fileKey

Filekey to load

Throws

\Exception

Returns

array|bool —

false, when file don't exist

externalClearCache()

externalClearCache(mixed $key) : bool

Clear the Cache for one directory

Parameters

mixed $key

Returns

bool

clearCache()

clearCache(bool $onlyCurrentDir) : bool

Clear the cache for one directory

Parameters

bool $onlyCurrentDir

Only clear cache of current directory?

Returns

bool

deleteFile()

deleteFile(string $filename, string $filekey)

Delete a File

Parameters

string $filename

Filename to delete

string $filekey

Filekey to delete

unlinkBackend()

unlinkBackend()

Adapter Function is called, when Provider should be unlinked Possible functions: Remove OAUTH2 Token

getCurrentDir()

getCurrentDir(bool $urlencode, bool $relative) : mixed|string

Get the current filepath

Parameters

bool $urlencode

bool Return the Path URLEncoded

bool $relative

bool Return the path relative to root Path if configured

Returns

mixed|string

_moveFile()

_moveFile(mixed $srcFile, mixed $targetFile)

Adapter Function is called, when File should be moved

Parameters

mixed $srcFile
mixed $targetFile

_deleteFile()

_deleteFile(mixed $filename, string $filekey)

Adapter Function is called, to create a directory

Parameters

mixed $filename
string $filekey

_mkdir()

_mkdir(mixed $path)

Adapter Function is called, to create a directory

Parameters

mixed $path

_chdir()

_chdir(mixed $path) : mixed

Adapter Function is called, when current directory will be changed

Parameters

mixed $path

Returns

mixed

_unlink()

_unlink(mixed $filename) : mixed

Adapter Function is called, when File should be unlinked

Parameters

mixed $filename

Returns

mixed

_upload()

_upload(mixed $localFilename, mixed $newFilename, bool $overwrite) : mixed

Adapter Function is called, to upload a file

Parameters

mixed $localFilename
mixed $newFilename
bool $overwrite

Returns

mixed

_getFiles()

_getFiles() : mixed

Adapter Function is called, to get the files list

Returns

mixed

_file_get_contents()

_file_get_contents(mixed $filename, bool $output, string $key) : mixed

Adapter Function is called, to get the file content

Parameters

mixed $filename
bool $output
string $key

Returns

mixed