Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("vendor/autoload.php");
- use Filestack\FilestackClient;
- use Filestack\FilestackSecurity;
- use Filestack\Filelink;
- use Filestack\FilestackException;
- $test_api_key = 'Ai1FXgVI1TuSvfUjidnR5z';
- $test_secret = 'just_some_random_stuff';
- $test_filepath = __DIR__ . '/tests/testfiles/calvinandhobbes.jpg';
- $sources = [
- 'https://d1wtqaffaaj63z.cloudfront.net/images/E-0510.JPG',
- "http://staging2.magicmurals.com/tools/filestack/tests/testfiles/Ultimo_TopNav041816.jpg",
- "http://staging2.magicmurals.com/tools/filestack/tests/testfiles/Ultimo_ColorScheme-041816L.jpg"
- ];
- /**
- * You can create a collage using the client
- */
- //$security = new FilestackSecurity($test_secret);
- $client = new FilestackClient($test_api_key); //, $security);
- $collage_filelink = $client->collage($sources, 800, 600);
- $destination = __DIR__ . '/tests/testfiles/collage-test.png';
- $result = $collage_filelink->download($destination);
- # or
- //$contents = $collage_filelink->getContent();
- //file_put_contents($destination, $contents);
- /**
- * Or you can create a collage using a filelink
- */
- /*
- $filelink = $client->upload($test_filepath);
- $collage_filelink = $filelink->collage($sources, 800, 600)->save();
- $result = $collage_filelink->download($destination);
- # or
- $contents = $collage_filelink->getContent();
- file_put_contents($destination, $contents);
- // delete remote file
- $filelink->delete();
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement