If you are using composer, just add oahu/oahu
this to your composer.json
file :
{
"name" : "my/awesome-oahu-app",
"version" : "0.1.0",
"require" : {
"oahu/oahu": "dev-master"
}
}
<?php
set_include_path(dirname(__FILE__) . ":");
require('vendor/autoload.php');
$config = array(
'oahu' => array(
"host" => "api.example.com",
"clientId" => 'OAHU_CLIENT_ID',
"appId" => 'OAHU_APP_ID',
"appSecret" => 'OAHU_APP_SECRET')
)
);
$oahu = new Oahu_Client($config);
API (GET) responses will be cached in Memcached if caching is enabled.
<?php
set_include_path(dirname(__FILE__) . ":");
require('vendor/autoload.php');
$config = array(
'oahu' => array(
"host" => "api.example.com",
"clientId" => 'OAHU_CLIENT_ID',
"appId" => 'OAHU_APP_ID',
"appSecret" => 'OAHU_APP_SECRET'),
"cache" => "true",
"cacheHost" => "127.0.0.1",
"cachePort" => 11211,
"cacheExpiration" => 120 // in seconds
)
);
$oahu = new Oahu_Client($config);
get
, put
, post
methods are directly available on your instance of Oahu_Client.
<?php
$oahu->get('projects');
<?php
// where ':project_id' is a valid project_id
$oahu->get('projects/:project_id/apps');
<?php
// where ':project_id' is a valid project_id
$oahu->get('projects/:project_id/pub_accounts');
<?php
$oahu->get('projects', array('limit' => 10, 'page' => 2))
$accountInfos = $oahu->getAccount($accountId);
$accountInfos = $oahu->getCurrentAccount();
Returns a list of Projects for the current Client
Returns a Project's infos
Creates a new Project
Update a Project's infos
Set the Project's Poster (default image)
Sets the Project's Trailer (default video)
Get all Projects resources (Image, Video, ImageList, VideoList)
Get all Project's Image resources
Get all Project's Video resources
Get all Project's PubAccounts (Facebook pages, Twitter accounts)
Create a new Resource (Image, Video, ImageList, VideoList)
Update a single Resource
Helper to create an ImageList
Helper to create an VideoList