VERSION
VERSION
The wrapper version.
The wrapper version number.
File Management Web Service.
setWebServicesServer(string $wsserver)
Set the web services server address.
This allows the web service requests to be directed to a specific server. The default is https://ws-<cloud_id>.aculabcloud.net
string | $wsserver | The base URL of the web services server. |
setCryptoMethod(integer $method)
Set the crypto method used when connectiing to the web services server.
This allows a specific crypto method to be used when connecting to the web service server. The values should be one of the STREAM_CRYPTO_METHOD_TLSv1_N_CLIENT constants. The default is STREAM_CRYPTO_METHOD_ANY_CLIENT.
integer | $method | The crypto method to use. |
listFiles(string $filetype, string $filename = '', integer|string $start, integer $maxcount = 10000, \DateTime|string $from = null, \DateTime|string $to = null, string $prefix = '') : array
List existing files.
This lists all the files of a specified type present on the file store of a cloud account. An optional prefix can be specified to determine a subset of files to list.
string | $filetype | The file type to list. Either "media" or "rest". |
string | $filename | A filename to match. An empty string matches all files in all folders (the default). The last character can be a '*' wildcard. |
integer|string | $start | If an integer, the zero-based index of the first file to list. This enables files to be listed in batches when more than 10,000 are present on the cloud. If a string, this is the file to start listing after. The default is 0. |
integer | $maxcount | The maximum number of files to list. The default is 10,000 which is also the maximum value for this parameter. |
\DateTime|string | $from | If specified, will limit return of filenames where the modified date is after the time (exclusive) given. May be used with $to to select ranges of dates. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss". |
\DateTime|string | $to | If specified, will limit return of filenames where the modified date is up to the time (exclusive) given. May be used with $from to select ranges of dates. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss". |
string | $prefix | A prefix to match. An empty string matches all files in all folders (the default). If both filename and prefix are provided, filename takes precedence. |
Returns an array of FileDetails objects.
listFolders(string $filetype, string $foldername = '', string $prefix = '', string $start = '', integer $maxcount = 10000, \DateTime|string $from = null, \DateTime|string $to = null) : array
List existing folders and files.
This lists all the folders and files of a specified type present on the file store of a cloud account. An optional prefix can be specified to determine a subset of files to list.
string | $filetype | The file type to list. Either "media" or "rest". |
string | $foldername | The name of the folder to list. An empty string lists the root folder (the default). |
string | $prefix | A prefix to match. An empty string matches all files and folders (the default). |
string | $start | The file to start listing after. The default is ''. |
integer | $maxcount | The maximum number of files to list. The default is 10,000 which is also the maximum value for this parameter. |
\DateTime|string | $from | If specified, will limit return of filenames where the modified date is after the time (exclusive) given. May be used with $to to select ranges of dates. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss". |
\DateTime|string | $to | If specified, will limit return of filenames where the modified date is up to the time (exclusive) given. May be used with $from to select ranges of dates. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss". |
Returns a FolderListResult object.
getFileContent(string $filetype, string $filename) : string
Get the file contents.
This downloads a file present on the file store of a cloud account and returns the contents.
string | $filetype | The file type to list. Either "media" or "rest". |
string | $filename | The filename of a file on the file store on the cloud to download. This must be an exact match of the file that is to be downloaded. Only one file can be downloaded at a time. |
The file contents.
getFileToFile(string $filetype, string $filename, string $local_filename) : integer
Get the file contents to a local file.
This downloads a file present on the file store of a cloud account and stores is as a local file.
string | $filetype | The file type to list. Either "media" or "rest". |
string | $filename | The filename of a file on the file store on the cloud to download. This must be an exact match of the file that is to be downloaded. Only one file can be downloaded at a time. |
string | $local_filename | The local file to write to. |
The amount of data written to the local file.
moveFile(string $from, string $to, string $filetype = "media")
Move a file in the cloud file store.
This renames a file that is present on the file store of a cloud account.
string | $from | The filename of the file to rename, including path. |
string | $to | The target filename, including path. |
string | $filetype | The type of file being moved. |
deleteFile(string $filetype, string $filename, \DateTime|string $from = null, \DateTime|string $to = null) : string
Delete files.
This deletes one or more files from the file store of a cloud account. Use \Aculab\WebServicesWrapper\FileWebService::deleteFileProgress() to monitor the progress of the deletion of multiple files.
string | $filetype | The file type to list. Either "media" or "rest". |
string | $filename | A filename specifying the file to delete. This can be a prefix followed by a '' to match all files and directories starting with the prefix. Setting this to '' will delete all files. |
\DateTime|string | $from | If specified, will limit return of filenames where the modified date is after the time (exclusive) given. May be used with $to to select ranges of dates. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss". |
\DateTime|string | $to | If specified, will limit return of filenames where the modified date is up to the time (exclusive) given. May be used with $from to select ranges of dates. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss". |
A token that identifies the deletion requested.
deleteFileProgress(string $token) : \Aculab\WebServicesWrapper\FileDeleteStatus
Get progress of a file deletion.
This retrieves the progress of a file deletion from a cloud account initiated by \Aculab\WebServicesWrapper\FileWebService::deleteFile().
string | $token | The token returned by a call to deleteFile(). |
writeFileFromBuffer(string $data, string $filename, boolean $encrypted = false, string $time_to_live = null, string $filetype = "media", string $content_type = null)
Write data to a file in the cloud file store.
This writes to a file in the cloud file store for a cloud account. Only .wav audio and .tif image media files can be written. The .tif files are constrained to fax format images. Files that are written for the first time (unique name) will then be immediately available in the media store. Overwrites of existing files may take some time to be updated across the system.
string | $data | The content to be written to the file. |
string | $filename | The target filename on the cloud file store, including path. |
boolean | $encrypted | Indicates if the content is encrypted. |
string | $time_to_live | The time to live (TTL) of the file, expressed as "Xm" (X minutes), "Xh" (X hours), or "Xd" (X days). |
string | $filetype | The file type being written. |
string | $content_type | The media (MIME) type of the file. |
writeFileFromFile(string $local_filename, string $filename, boolean $encrypted = false, string $time_to_live = null, string $filetype = "media", string $content_type = null)
Write a local file to a file in the cloud file store.
This writes to a file in the cloud file store for a cloud account. Only .wav audio and .tif image media files can be written. The .tif files are constrained to fax format images. Files that are written for the first time (unique name) will then be immediately available in the media store. Overwrites of existing files may take some time to be updated across the system.
string | $local_filename | The local file to be written to the cloud file store. |
string | $filename | The target filename on the cloud file store, including path. |
boolean | $encrypted | Indicates if the local file is encrypted. |
string | $time_to_live | The time to live (TTL) of the written file, expressed as "Xm" (X minutes), "Xh" (X hours), or "Xd" (X days). |
string | $filetype | The file type being written. |
string | $content_type | The media (MIME) type of the file. |