dev-master
9999999-dev https://pix.st/PHP implementation of Pix Street API
MIT
The Requires
- php >=5.4.0
by Dev Team
v1.0.0
1.0.0.0 https://pix.st/PHP implementation of Pix Street API
MIT
The Requires
- php >=5.4.0
by Dev Team
PHP implementation of Pix Street API
This is the native PHP implementation of Pix Street API. Pix Street is a cloud-based image hosting with advanced features., (*1)
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)
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();
PHP implementation of Pix Street API
MIT
PHP implementation of Pix Street API
MIT