nicoswd/putio

PHP 5.4 wrapper for PutIO's OAuth API (v2)

0.3.1 2015-02-19 19:36 UTC

This package is auto-updated.

Last update: 2024-12-06 08:47:00 UTC


README

Latest Stable Version Build Status Code Coverage Scrutinizer Code Quality

Put.io Logo

This is a powerful PHP library for put.io's OAuth2 API. It supports all features that put.io's API provides natively, including file uploads, downloads, transfers, friends, etc... No dependencies required.

Take a look at the Wiki and put.io's API documentation to get started.

Find me on Twitter: @nicoSWD

Take a look at the experimental branch for PHP 7 with strict type hints and return types

Install

Via Composer

$ composer require "nicoswd/putio": "0.3.*"

Via git

$ git clone git@github.com:nicoSWD/put.io-api-v2.git

Usage

$putio = new PutIO\API($accessToken);

// Retrieve a an array of files on your account.
$files = $putio->files->listall();

// Upload a file.
$file = 'path/to/file.jpg';
$putio->files->upload($file);

// Download a file.
$fileID = 1234;
$saveAs = 'my-file.jpg';
$putio->files->download($fileID, $saveAs);

// Search for files you have access to.
$query = 'my file';
$files = $putio->files->search($query);

// Add a new transfer (file or torrent)
$url = 'http://torrent.site.com/legal_video.torrent';
$putio->transfers->add($url);

// Get status of a transfer
$transferID = 1234;
$info = $putio->transfers->info($transferID);

// And a lot more...

Security

If you discover any security related issues, please email security@nic0.me instead of using the issue tracker.

Testing

$ phpunit

Contributing

Pull requests are very welcome! If they include tests, even better. This project follows PSR-2 coding standards, please make sure your pull requestst do too.

License

License