RemoteStorageRequest
in package
Table of Contents
Properties
- $davUrlRootPrefix : mixed
- $appContext : mixed
- $fileNameExpression : mixed
- $webDAVNamespace : mixed
Methods
- checkWebDAVStorageConnection() : bool
- Check if remote storage is reacheable on setted configuration.
- deleteFromWebDAVStorage() : array{0: int, 1: string}
- getAppContext() : mixed
- getProfile() : mixed
- getRemoteFile() : mixed
- getRemoteUrl() : null|string
- Return the WebDav Url or null if fails The function assumes that the last part of the url is the filename and is defined as "file_name(@selected_file_path)".
- isFileRemoteWebDAVResource() : bool
- check if resource is a file on remote webdav storage.
- uploadToWebDAVStorage() : array{0: null|string, 1: int, 2: string}
- buildClient() : Client
- Create HttpClient for webDav requests.
Properties
$davUrlRootPrefix
public
static mixed
$davUrlRootPrefix
= 'dav/'
$appContext
protected
static mixed
$appContext
$fileNameExpression
protected
static mixed
$fileNameExpression
= '/file_name\(\s*@selected_file_path\s*\)/'
$webDAVNamespace
protected
static mixed
$webDAVNamespace
= 'DAV:'
Methods
checkWebDAVStorageConnection()
Check if remote storage is reacheable on setted configuration.
public
static checkWebDAVStorageConnection() : bool
Return values
booldeleteFromWebDAVStorage()
public
static deleteFromWebDAVStorage(string $storageUrl, string $fileName) : array{0: int, 1: string}
Parameters
- $storageUrl : string
-
storage url
- $fileName : string
-
the file to delete
Return values
array{0: int, 1: string} —Array HTTP code(0: int), message (1: string)
getAppContext()
public
static getAppContext() : mixed
getProfile()
public
static getProfile(mixed $storageType[, mixed $profileName = 'default' ]) : mixed
Parameters
- $storageType : mixed
- $profileName : mixed = 'default'
getRemoteFile()
public
static getRemoteFile(mixed $storageUrl, mixed $fileName) : mixed
Parameters
- $storageUrl : mixed
- $fileName : mixed
getRemoteUrl()
Return the WebDav Url or null if fails The function assumes that the last part of the url is the filename and is defined as "file_name(@selected_file_path)".
public
static getRemoteUrl(string $storageUrl[, null|string $filename = null ]) : null|string
Parameters
- $storageUrl : string
-
remote destination folder
- $filename : null|string = null
-
file name, if null return the base path
Return values
null|stringisFileRemoteWebDAVResource()
check if resource is a file on remote webdav storage.
public
static isFileRemoteWebDAVResource(string $storageUrl, string $fileName) : bool
Parameters
- $storageUrl : string
-
remote destination path
- $fileName : string
-
the file to check
Return values
booluploadToWebDAVStorage()
public
static uploadToWebDAVStorage(string $storageUrl, string $file) : array{0: null|string, 1: int, 2: string}
Parameters
- $storageUrl : string
-
remote destination path
- $file : string
-
the file path to upload
Return values
array{0: null|string, 1: int, 2: string} —Array url of the uploaded file (0: string), HTTP code (1: int), message (2: string)
buildClient()
Create HttpClient for webDav requests.
protected
static buildClient(array<string|int, mixed> $profile) : Client
Parameters
- $profile : array<string|int, mixed>
-
The webDav profile