Download the PHP package satana.konst/next-cloud-web-dav-sdk without Composer
On this page you can find all versions of the php package satana.konst/next-cloud-web-dav-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download satana.konst/next-cloud-web-dav-sdk
More information about satana.konst/next-cloud-web-dav-sdk
Files in satana.konst/next-cloud-web-dav-sdk
Package next-cloud-web-dav-sdk
Short Description Sdk for NextCloud WebDav Api
License GPL-3.0-or-later
Informations about the package next-cloud-web-dav-sdk
NextCloudWebDavSdk
Обертка на классы WebDav и Share
$sdk = new \NextCloudWebDavSdk\NextCloudWebDavSdk( 'http://192.168.0.1', 'login', 'pass' ); $response = $sdk->webDav->getListingFolder(); $response = $sdk->share->createShare();
Все методы классов расписаны ниже.
WebDav
Документация по работе с WebDav https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/index.html
Авторизация
$webDav = new \NextCloudWebDavSdk\WebDav\Server( 'host', 'login', 'pass' );
Получить список файлов
$response = $webDav->getListingFolder( '/path/to/file' );
Скачать файл
$response = $webDav->downloadFile( '/path/to/download/file', 'path/to/save/file' );
Загрузка файлов
$response = $webDav->uploadFile( 'path/to/upload/file/test_upload_pdf.pdf', '/path/for/save/file/' );
Создать папку
$response = $webDav->createFolder( '/path/to/new/folder/', );
Удалить файл или директорию
$response = $webDav->removeFileOrDirectory( '/path/to/file/or/directory', );
Переместить файл или дирректорию
$response = $webDav->moveFileOrDirectory( '/path/file/to/move', '/path/file/to/destination' );
Копировать файл или директорию
$response = $webDav->copyFileOrDirectory( '/path/file/to/copy', '/path/file/to/destination' );
Поиск файлов и папок
Выбираемые свойства искомых элементов
Область поиска относительно корневой папки пользователя
Уровень вложенности поиска
Условия поиска
Сортировка
Share
Документация по шарингу https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html
Авторизация
$share = new \NextCloudWebDavSdk\OCS\Share( 'host', 'login', 'pass' );
Расшарить файл
$response = $share->createShare( 'path/to/share/file' );
Удалить шару
$response = $share->removeShare( 'shareID' );
Получить шару
$response = $share->getShares( 'path/to/share/file' );
Обновить шару
$response = $share->updateShare( 'shareID' );