This SDK allows you to easily integrate Horntell in your PHP applications.
PHP 5.4 and later.
However, there's nothing (yet!) that lower version cannot do, but we don't want to support <=5.3 because it will be a thing of past very soon (or is it already?). Going forward, we can make use of some of 5.4 features like Traits, which has ability to provide more beautiful API than what 5.3 can.
Guzzle
This package depends on Guzzle HTTP client, which has the following additional requirements.
- To use the PHP stream adapter,
allow_url_fopenmust be enabled in your system'sphp.ini. - To use the cURL adapter, you must have a recent version of cURL >= 7.16.2 compiled with OpenSSL and zlib.
You can install the SDK using Composer. Add this to your composer.json file. (Or use dev-master for nightly builds).
{
"require": {
"horntell/php-sdk": "0.3.*"
}
}Then, pull the package using the following command:
composer install
You will need to include the Composer's autoloader. Simply put this statement in the file you want to use the package.
require 'vendor/autoload.php';
You need to initialize the SDK with the app's key and secret, which you can find in your account at http://app.horntell.com. Sample usage looks like this.
Horntell\App::init('YOUR_APP_KEY', 'YOUR_APP_SECRET');
(new Horntell\Profile)->create(array(
'uid' => '1337',
'first_name' => 'John',
'last_name' => 'Doe',
'signedup_at' => 1383350400
));Please see http://docs.horntell.com/api for up-to-date documentation.
The composer package to work easily with Laravel will be available soon.