承接 scratcher28/flysystem-mailru-cloud 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

scratcher28/flysystem-mailru-cloud

Composer 安装命令:

composer require scratcher28/flysystem-mailru-cloud

包简介

Flysystem Adapter for the mail.ru cloud

README 文档

README

This package contains a Flysystem adapter for Mail.ru Cloud. Under the hood, the Friday14/mailru-cloud-php is used.

Installation

You can install the package via composer:

composer require freecod/flysystem-mailru-cloud

Usage

This package used unofficial API client for cloud.mail.ru - Friday14/mailru-cloud-php

To initialize the client, enter your login (without @domain), domain (mail.ru, list.ru, etc) and password to work with the cloud.

use Friday14\Mailru\Cloud;
use Freecod\FlysystemMailRuCloud\MailRuCloudAdapter;

$client = new Cloud('login', 'password', 'mail.ru');

$adapter = new MailRuCloudAdapter($client);

$filesystem = new Filesystem($adapter);

Usage in Laravel

To used this package as driver for Laravel Storage drive, you must make Service Provider for extend storage drivers

<?php

namespace App\Providers;

use Freecod\FlysystemMailRuCloud\MailRuCloudAdapter;
use Friday14\Mailru\Cloud;
use League\Flysystem\Filesystem;
use Illuminate\Support\ServiceProvider;

class MailRuCloudServiceProvider extends ServiceProvider
{
    public function boot()
    {
        \Storage::extend('mailru', function ($app, $config) {
            $client = new Cloud(
                $config['login'],
                $config['password'],
                $config['domain']
            );
            
            return new Filesystem(new MailRuCloudAdapter($client));
        });
    }
}

Now add this Service Provider to config/app.php in section "providers":

App\Providers\MailRuCloudServiceProvider::class,

Final step - add to config/filesystems.php in section "disks"

    'mailru' => [
        'driver' => 'mailru',
        'login' => env('MAIL_RU_CLOUD_LOGIN'),
        'domain' => env('MAIL_RU_CLOUD_DOMAIN'),
        'password' => env('MAIL_RU_CLOUD_PASSWORD'),
    ],

Usage

    $data = \Storage::disk('mailru')->files();

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 162
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固