Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PHP CSS JavaScript Python Shell
Branch: master
Pull request Compare This branch is 227 commits behind alchemy-fr:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
src/PhraseanetSDK
tests
.gitignore
.travis.yml
README.md
composer.json
composer.lock
phpunit.xml.dist

README.md

Phraseanet API PHP-SDK

Build Status

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

Documentation

Read the documentation at http://phraseanet-php-sdk.readthedocs.org/

Silex Provider

A Silex provider is available at Phraseanet SDK Silex Provider

Use Example

<?php
use PhraseanetSDK\EntityManager;
use PhraseanetSDK\Client;
use PhraseanetSDK\HttpAdapter\Guzzle as GuzzleAdapter;

$HttpAdapter = GuzzleAdapter::create();
$HttpAdapter->setBaseUrl('http://url-to-phraseanet.net/');

$client = new Client($apikey, $apiSecret, $HttpAdapter);
$client->setAccessToken($token);

$em = new EntityManager($client);

$query = $$em->getRepository('Record')->search(array(
    'query' => 'animals'
    'offset_start' => 0,
    'per_page' => 20,
    'bases' => array(1, 4),
    'record_type' => 'image'
));

echo $query->getTotalResults() . " items found in " . $query->getQueryTime() . " seconds\n";

foreach($query->getResults() as $record) {
    echo "Sub definition " . $subdef->getName() . " has URL " . $subdef->getPermalink()->getUrl() . "\n";
}

License

MIT licensed

Something went wrong with that request. Please try again.