2017 © Pedro Peláez
 

library pixst

PHP implementation of Pix Street API

image

pixst/pixst

PHP implementation of Pix Street API

  • Friday, November 6, 2015
  • by PixSt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Pix Street API native PHP library

This is the native PHP implementation of Pix Street API. Pix Street is a cloud-based image hosting with advanced features., (*1)

Installation

The preferred way to install the library is through composer., (*2)

Run, (*3)

composer.phar require pixst/pixst

or add, (*4)

"pixst/pixst": "~1.0.0",

to the require section of composer.json., (*5)

Usage

Create album and store images, (*6)

use pixst\ClientJson;

// Pix Street API ID
$apiID = 'example@domain.com';

// Pix Street API key
$apiKey = 'abcdef0123456789';

// Create API client
$pix = new ClientRest($apiID, $apiKey);

// Create public image with ID "testImage-1" from remote URL "https://cdn.pix.st/a.jpg"
// and put it in album "Test album"
$pix->imageCreate()
    ->setId('testImage-1')
    ->setSourceUrl('https://cdn.pix.st/a.jpg'])
    ->setPublic(true)
    ->execute();

// Create public image with ID "testImage-2" from local file, rotate clockwise by 90°,
// resize to 640 x 480 and create short URL for it
$pix->imageCreate()
    ->setId('testImage-2')
    ->setSourceFile('local-image-file.jpg')
    ->setPublic(true)
    ->setShorthen(true)
    ->setTags(['test', 'image'])
    ->setRotate(90, true)
    ->setResize(640, 480)
    ->setJpegQuality(98)
    ->execute();

Download image, (*7)

use pixst\ClientJson;

// Pix Street API ID
$apiID = 'example@domain.com';

// Pix Street API key
$apiKey = 'abcdef0123456789';

// Create API client
$pix = new ClientRest($apiID, $apiKey);

// Download image
$binary = $pix->imageDownload()->setId('testImage-1')->execute();
file_put_contents('test-image.jpg', $binary);

Delete image, (*8)

use pixst\ClientJson;

// Pix Street API ID
$apiID = 'example@domain.com';

// Pix Street API key
$apiKey = 'abcdef0123456789';

// Create API client
$pix = new ClientRest($apiID, $apiKey);

// Delete image
$pix->imageDelete()
    ->setId('testImage-1')
    ->execute();

The Versions

06/11 2015

dev-master

9999999-dev https://pix.st/

PHP implementation of Pix Street API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Dev Team

02/11 2015

v1.0.0

1.0.0.0 https://pix.st/

PHP implementation of Pix Street API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Dev Team