friday14/cloud-mail-ru

此包已被废弃,不再维护。未建议替代包。
此包的最新版本(0.0.1)没有可用的许可证信息。

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) - 上传文件到云端(如果路径中指定的文件夹不存在,将在下载前创建)

    $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