Git Product home page Git Product logo

mailru-cloud-php's Introduction

Sdk для работы с облаком mail.ru

Установка с помощью 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

mailru-cloud-php's People

Contributors

ginsengs avatar scratcher28 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

daitkhealex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.