Simple wrapper for xdevapi getSession function in PHP pecl extension
The recommended method to install NEXILO XDevAPI-PHP is through Composer.
-
Add
nexilo/xdevapi-php
as a dependency in your project'scomposer.json
file:{ "require": { "nexilo/xdevapi-php": "~1.1" } }
-
Download and install Composer:
curl -s http://getcomposer.org/installer | php
-
Install your dependencies:
php composer.phar install
-
Require Composer's autoloader
Composer also prepares an autoload file that's capable of autoloading all the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:
<?php use Nexilo\XdevApiClientBuilder; require 'vendor/autoload.php'; $session = XdevApiClientBuilder::getInstance('yourDsnHere')->getSession();
You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.