friday14/cloud-mail-ru

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (0.0.1) of this package.

Client for Cloud mail.ru

0.0.1 2018-04-29 14:14 UTC

This package is not auto-updated.

Last update: 2021-03-20 08:56:37 UTC


README

Установка с помощью composer:

composer require friday14/cloud-mail-ru dev-master

Использование

$cloud = new \Friday14\Mailru\Cloud('yourLogin', 'yourPassword', 'yourDomain');

Пример:

$cloud = new \Friday14\Mailru\Cloud('friday14', 'password', 'mail.ru');

Методы

files($path) - Получить все файлы из заданного каталога

$cloud->files('/cloud-root');

createFile($path, $content) - Создать файл с заданным контентом

$cloud->createFile('/ololo.txt','Hello World');

createFolder($path) - Создать папку в облаке

$cloud->createFolder('/foldername');

delete($path) - Удалить папку/файл

$cloud->delete('/wallaper.jpg');

rename($path, $name) - Переименновать папку/файл

$cloud->rename('/cloud-folder/wallaper.jpg', 'newName.jpg');

upload(SplFileObject $file, $filename = null) - Uploads your files in Cloud (If you specify a folder in the path that does not exist, it will be created before the download)

    $file = new SplFileObject($_SERVER['DOCUMENT_ROOT'] . '/teremok.jpg');
    $cloud->upload($file, '/wallapers/super-teremok.jpg');

download($path, $savePath) - Загрузить файл.

  $cloud->download('/wallapers/super-teremok.jpg', $_SERVER['DOCUMENT_ROOT'] . '/folder/filename.format');

publishFile($path) - Сделать файл общедоступным

  $cloud->publishFile('/wallapers/super-teremok.jpg');

getLink($path) - Сделать файл общедоступным и получить ссылку на файл

  $cloud->getLink('/wallapers/super-teremok.jpg') // return https://cloclo4.cloud.mail.ru/thumb/xw1/wallapers/super-teremok.jpg