2017 © Pedro Peláez
 

library yandex-disk-flysystem

The flysystem adapter for yandex disk rest api.

image

arhitector/yandex-disk-flysystem

The flysystem adapter for yandex disk rest api.

  • Wednesday, January 3, 2018
  • by Arhitector
  • Repository
  • 3 Watchers
  • 4 Stars
  • 608 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Адаптер thephpleague/flysystem для Яндекс.Диск REST API (Flysystem Adapter for Yandex.Disk REST API).

В разработке, (*1)

Посетите https://oauth.yandex.ru, создайте приложение и получите отладочный OAuth-токен., (*2)

Visit https://oauth.yandex.com and create application. Get your OAuth token., (*3)

Установка (Installation)

$ composer require arhitector/yandex-disk-flysystem dev-master

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

Вы можете использовать папку приложения в качестве корневого пути, для этого используйте Arhitector\Yandex\Disk\Adapter::PREFIX_APP (значение "app:/") вторым параметром $prefix. По умолчанию используется Arhitector\Yandex\Disk\Adapter::PREFIX_FULL, что эквивалентно "disk:/" - доступ ко всему диску., (*4)

public __construct(Disk $client [, $prefix = 'disk:/'])

$client экземпляр объекта Arhitector\Yandex\Disk с уже установленным OAuth-токеном., (*5)

$prefix чтобы использовать папку приложения передайте Arhitector\Yandex\Disk\Adapter::PREFIX_APP, (*6)

Arhitector\Yandex\Disk\Adapter::PREFIX_FULL access to the entire disc (default)., (*7)

Arhitector\Yandex\Disk\Adapter::PREFIX_APP see more info https://tech.yandex.com/disk/api/concepts/app-folders-docpage/, (*8)

// set a token before creation of the adapter
$client = new Arhitector\Yandex\Disk([string $accessToken]);

// or
$client->setAccessToken(string $accessToken);

// create adapter
$adapter = new Arhitector\Yandex\Disk\Adapter\Flysystem($client);

// or with app folder
$adapter = new Arhitector\Yandex\Disk\Adapter\Flysystem($client, Arhitector\Yandex\Disk\Adapter\Flysystem::PREFIX_APP);

// create Filesystem
$filesystem = new League\Flysystem\Filesystem($adapter);

// and use
$contents = $filesystem->listContents();

var_dump($contents);

Регистрация слушателей событий, (*9)

$filesystem->write('path', 'contents', [
    'events' => [
        'event-name 1' => 'listener', /* function, etc. */
        'event-name 2' => 'other listener'
    ]
]);

Регистрация более чем одного слушателя, (*10)

$filesystem->write('path', 'contents', [
    'events' => [
        'event-name' => [
            'listener 1' /* function, etc. */,
            'listener 2' /* function, etc. */,
            'listener 3' /* function, etc. */
        ]
    ]
]);

Лицензия (License)

MIT License (MIT), (*11)

The Versions

03/01 2018

dev-master

9999999-dev

The flysystem adapter for yandex disk rest api.

  Sources   Download

MIT

The Requires

 

by Dmitry Arhitector

filesystem cloud yandex disk яндекс диск cloud files filesystems file systems

07/08 2017

1.0.1

1.0.1.0

The flysystem adapter for yandex disk rest api.

  Sources   Download

MIT

The Requires

 

by Dmitry Arhitector

filesystem cloud yandex disk яндекс диск cloud files filesystems file systems

05/10 2016

1.0.0

1.0.0.0

The flysystem adapter for yandex disk rest api.

  Sources   Download

MIT

The Requires

 

by Dmitry Arhitector

filesystem cloud yandex disk яндекс диск cloud files filesystems file systems