Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
hueyl77 committed May 17, 2017
1 parent 36ef440 commit 191070e
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 32 deletions.
11 changes: 5 additions & 6 deletions README.md
Expand Up @@ -6,7 +6,6 @@ This is the official PHP SDK for Filestack - API and content management system t

* [Filestack](https://www.filestack.com)
* [Documentation](https://www.filestack.com/docs)
* [API Reference](https://filestack.github.io/)

## Installing

Expand All @@ -26,17 +25,17 @@ or download from GitHub

## Usage

Filestack library gives you access to two useful classes:
Filestack library gives you access to three useful classes:

* `FilestackClient` - for easy file upload (creates Filelink objects)
* `Filelink` - for file handling (downloading, converting etc.)
* `FileSecurity` - for applying policy and signature values to your API calls

### Uploading files
First, you need to create an instance of FilestackClient

```php
use Filestack\FilestackClient;
use Filestack\Filelink;

$client = new FilestackClient('YOUR_API_KEY');
```
Expand All @@ -57,7 +56,7 @@ $filelink = $client->upload($filepath);

### Manipulating files

Filelink objects can be created in three ways:
Filelink objects can be created in two ways:

- by uploading a file with using FilestackClient
- by initializing Filelink with file handle and api_key
Expand All @@ -71,7 +70,7 @@ $file = new Filelink('pGj2wWfBTMuXhWe2J3bL', 'YOUR_API_KEY');
$transformed_filelink = $filelink
->circle()
->blur(['amount' => '20'])
->store();
->save();
```

For more examples, see the [examples/](examples/) folder in this project.
Expand Down Expand Up @@ -116,7 +115,7 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## Credits

Thank you to all the [contributors](https://github.com/filepicker/filestack-php/graphs/contributors).
Thank you to all the [contributors](https://github.com/filestack/filestack-php/graphs/contributors).

## Other Resources

Expand Down
2 changes: 1 addition & 1 deletion examples/client-no-security.php
Expand Up @@ -3,7 +3,7 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'AefuF1HdTzGBlwfxk1FYWz';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_filepath = __DIR__ . '/../tests/testfiles/calvinandhobbes.jpg';

# Filestack client examples
Expand Down
4 changes: 2 additions & 2 deletions examples/client-transformations.php
Expand Up @@ -4,8 +4,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$test_filepath = __DIR__ . '/../tests/testfiles/calvinandhobbes.jpg';

# Filestack client examples
Expand Down
4 changes: 2 additions & 2 deletions examples/client-with-security.php
Expand Up @@ -4,8 +4,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$test_filepath = __DIR__ . '/../tests/testfiles/calvinandhobbes.jpg';

# Filestack client examples
Expand Down
4 changes: 2 additions & 2 deletions examples/converting-file-formats.php
Expand Up @@ -4,8 +4,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$test_filepath = __DIR__ . '/../tests/testfiles/calvinandhobbes.jpg';

/**
Expand Down
4 changes: 2 additions & 2 deletions examples/create-collages.php
Expand Up @@ -4,8 +4,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$test_filepath = __DIR__ . '/../tests/testfiles/calvinandhobbes.jpg';

$sources = [
Expand Down
4 changes: 2 additions & 2 deletions examples/create-screenshots.php
Expand Up @@ -4,8 +4,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';

$security = new FilestackSecurity($test_secret);
$client = new FilestackClient($test_api_key, $security);
Expand Down
4 changes: 2 additions & 2 deletions examples/filelink-no-security.php
Expand Up @@ -2,8 +2,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'AefuF1HdTzGBlwfxk1FYWz';
$test_handle = 'AxBBQ4MFRIyDz6rZn2AW';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$test_filepath = __DIR__ . '/../tests/testfiles/testing-download.jpg';

# Filestack client examples
Expand Down
4 changes: 2 additions & 2 deletions examples/filelink-transformations.php
Expand Up @@ -2,8 +2,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'AefuF1HdTzGBlwfxk1FYWz';
$test_handle = 'AxBBQ4MFRIyDz6rZn2AW';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$test_filepath = __DIR__ . '/../tests/testfiles/testing-download.jpg';

# Filestack client examples
Expand Down
4 changes: 2 additions & 2 deletions examples/filelink-with-security.php
Expand Up @@ -4,8 +4,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$test_filepath = __DIR__ . '/../tests/testfiles/calvinandhobbes.jpg';

// upload a file to test
Expand Down
6 changes: 3 additions & 3 deletions examples/video-audio-transcoding.php
Expand Up @@ -4,8 +4,8 @@
use Filestack\Filelink;
use Filestack\FilestackException;

$test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$test_api_key = 'YOUR_FILESTACK_API_KEY';
$test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';

$security = new FilestackSecurity($test_secret);
$client = new FilestackClient($test_api_key, $security);
Expand Down Expand Up @@ -182,4 +182,4 @@
"timestamp":"1456384626",
"uuid":"57694303a5d29c148154d5f706b4c256"
}
*/
*/
3 changes: 0 additions & 3 deletions filestack/mixins/TransformationMixin.php
Expand Up @@ -92,10 +92,8 @@ public function sendDebug($transform_url, $security=null)

// handle response
if ($status_code == 200) {

$json_response = json_decode($response->getBody(), true);
return $json_response;

} else {
throw new FilestackException($response->getBody(), $status_code);
}
Expand Down Expand Up @@ -167,7 +165,6 @@ public function sendTransform($resource, $transform_tasks, $security=null)
*/
public function sendVideoConvert($resource, $transform_tasks, $security=null)
{

$tasks_str = $this->createTransformStr($transform_tasks);

// build url
Expand Down
6 changes: 3 additions & 3 deletions tests/BaseTest.php
Expand Up @@ -18,14 +18,14 @@ class BaseTest extends \PHPUnit_Framework_TestCase

public function __construct()
{
$this->test_api_key = 'A5lEN6zU8SemSBWiwcGJhz';
$this->test_api_key = 'YOUR_FILESTACK_API_KEY';
$this->test_file_handle = 'IIkUk9D8TWKHldxmMVRt';

$this->test_api_key_no_sec = 'AefuF1HdTzGBlwfxk1FYWz';
$this->test_api_key_no_sec = 'YOUR_FILESTACK_API_KEY';
$this->test_file_handle_no_sec = 'AxBBQ4MFRIyDz6rZn2AW';

$this->test_file_url = FilestackConfig::CDN_URL . '/' . $this->test_file_handle;
$this->test_secret = '3UAQ64UWMNCCRF36CY2NSRSPSU';
$this->test_secret = 'YOUR_FILESTACK_SECURITY_SECRET';
$this->test_filepath = __DIR__ . '/testfiles/calvinandhobbes.jpg';
$this->test_security = new FilestackSecurity($this->test_secret);

Expand Down

0 comments on commit 191070e

Please sign in to comment.