Skip to content

Latest commit

 

History

History
35 lines (31 loc) · 927 Bytes

README.md

File metadata and controls

35 lines (31 loc) · 927 Bytes

PHP Storage

Usage

Create storage object

$storage = StorageFactory::create(
    StorageTypeEnum::WEB_DAV(),
    'https://webdav.example.com',
    [
        'prefix' => 'basePathToWebDAV/',
        'userName' => 'user',
        'password' => 'password',
    ]
);

Stream remote file to local file system

$this->storage->download('remotePathInsideWebDAV/test.txt', 'localPath/test.txt');

Get remote file content

$content = $this->storage->downloadContent('remotePathInsideWebDAV/test.txt');

Sync remote folder structure to local filesystem (recursive)

$localFile = new \SplFileInfo('localPath/');
storage->syncRemoteToLocal('remotePathInsideWebDAVRoot/', $localFile,true);

Credits