Download the PHP package soulssoft/phraseanet-php-sdk without Composer

On this page you can find all versions of the php package soulssoft/phraseanet-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phraseanet-php-sdk

Phraseanet API PHP-SDK

License Packagist Travis Scrutinizer Coverage Scrutinizer Packagist

The Phraseanet PHP SDK is an OO library to interact with Phraseanet API.

Install

The recommended way to install Phraseanet PHP SDK is through composer.

Basic Usage

Create the application

Here is the minimum to create the Phraseanet SDK Application ; please note that client client-id, url and secret a required. Please refer to the online documentation to get more more information about generating those.

Getting an oauth token

Once the application is created, a token is required to query the API. There are two ways :

Developer token

The developer token can be retrieved from Phraseanet developer application panel (My account > developer > applications).

OAuth2 authentication flow

Phraseanet SDK provides a convenient way to retrieve an oauth token. Use the OAuth2Connector for that :

Note that extra parameters can be passed to the getAuthorizationUrl method. Please refer to the online documentation about available parameters.

Once you have the token, you can use the EntityManager.

Use the EntityManager

The EntityManager is the entry point to retrieve Phraseanet entities.

Uploading files to Phraseanet

Files can be uploaded to Phraseanet using the uploader instance exposed via the Application object:

$base_id can be either a base_id value or a PhraseanetSDK\Entity\DataboxCollection entity.

Please note that you can force the behavior with the third argument and pass a Phraseanet record status (binary string) as fourth argument :

Behavior can be either :

Configuration

Extended API Response format

The Phraseanet API (v1.4.1) can provide extended Response format for Record Object.

In this case all relations to Record object (permalink, sub-definitions, caption, status) are included in the response.

The result is that with this feature you need only one request to populate a whole Record object instead of five.

The time to hydrate record object is slightly higher but is ridiculously tiny compared to the time spent over HTTP protocol to fetch relations data.

Log

Request can be logged for monitor or debug purpose by setting a PSR Logger in the configuration. See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md

See http://guzzle3.readthedocs.org/plugins/log-plugin.html for log plugin configuration

Cache

For performance, it is strongly recommended to use a cache system. This can be easily done using the following configuration.

See http://guzzle3.readthedocs.org/plugins/cache-plugin.html for cache plugin configuration.

Silex Provider

A Silex provider is bundled within this package.

Basic usage

Record / Play requests

Recorder

Recorder can be enabled per requests through service provider using the following code :

Requests can be store either in memcache, memcached or file. To use file, configuration should look like :

Player

To replay stored requests, use the player

Please note that, in order to play request without using cache (to warm it for example), you must use the deny cache re-validation strategy :

Monitor

SDK provides a tool to monitor Phraseanet :

License

Phraseanet SDK is released under the MIT license.


All versions of phraseanet-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
doctrine/cache Version ~1.0
doctrine/collections Version ~1.0
guzzle/guzzle Version ~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package soulssoft/phraseanet-php-sdk contains the following files

Loading the files please wait ....