承接 gpenverne/putio-drive-sdk 相关项目开发

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

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

gpenverne/putio-drive-sdk

Composer 安装命令:

composer require gpenverne/putio-drive-sdk

包简介

A bundle for explore putio files

关键字:

README 文档

README

## Installation Install the bundle:

$ composer require gpenverne/putio-drive-sdk

Load bunle in AppKernel:

    new Gpenverne\PutioDriveBundle\PutioDriveBundle(),

Configuration

parameters:
    putio:
        client_id: your-client-id
        client_secret: your-client-secret
        callback_route: callback_route

With your custom route in callback_route (for example, to display a success message)

Add your endpoints to your routing.yml or use our controllers endpoints:

putio.callback:
    path:     /putio/callback
    defaults: { _controller: putio.drive.controller:callbackAction }

putio.redirect:
    path:     /putio/redirect
    defaults: { _controller: putio.drive.controller:redirectAction }

obtain the user token

Call the previous created route (putio.redirect) . After access granted, user will be redirected to previous configured "callback_route" parameter

retrieving the token

Once token obtained, "events.putio.token" event is dispatched.
This event is handled by putio drive service, and you can retrieve it using putio.drive service:

// In a controller:
$token = $this->container->get('putio.drive')->getToken();

using the putio php sdk

You can use our builtin file/folder finder:

$putioDrive = $this->container->get('putio.drive');
$putioDrive->setToken($token);

// Retrieving a folder
$folder = $putioDrive->findByPath('/MyMovies');

// Retrieving files in the folder
// Will return FileInterface and FolderInterface
// cf. (psr-cloud-files)[https://packagist.org/packages/gpenverne/psr-cloud-files]
$files = $folder->getFiles();

// Or retrieve a full path file
// Will return FileInterface
// cf. (psr-cloud-files)[https://packagist.org/packages/gpenverne/psr-cloud-files]
$file = $putioDrive->findByPath('/MyMovies/MyMovie.mp4');

// Retrieving the download url:
$file = $putioDrive->findByPath('/MyMovies/MyMovie.mp4');
$downloadUrl = $file->getLink();

Thanks to https://github.com/nicoSWD/put.io-api-v2, you can easily make api calls:

// In a controller, using the previous catched token:
$putioApiClient = $this->container->get('putio.drive')->getApiClient();

// In a controller, using a custom token:
$putioApiClient = $this->container->get('putio.drive')->getApiClient('custom token');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固