The Evoliz PHP library provides convenient access to the Evoliz API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the Evoliz API.
PHP 7.0.0 and later.
You can install the package via Composer. Run the following command:
composer require evoliz/evoliz-php
To use the package, use Composer's autoload:
require_once('vendor/autoload.php');
The package require the following extensions in order to work properly:
guzzlehttp/guzzle
, from release 6.5.5 to the latest release before 7.0.0json
If you use Composer, these dependencies should be handled automatically.
Simple usage looks like:
$config = new Evoliz\Client\Config('YOUR_COMPANYID', 'YOUR_PUBLIC_KEY', 'YOUR_SECRET_KEY');
$clientRepository = new ClientRepository($config);
$client = $clientRepository->create(new Client([
'name' => 'Evoliz',
'type' => 'Particulier',
'address' => [
'postcode' => '83130',
'town' => 'La Garde',
'iso2' => 'FR'
]
]));
You can find all the examples for each endpoint in the examples folder.
See the PHP API docs.
See the API changelog to see all the changes made to the API.
If you are using a version earlier than PHP 7.0.0, you need to upgrade your environment to use Evoliz.
Get Composer.
Install dependencies:
composer install
Install dependencies as mentioned above (which will resolve PHPUnit), then you can run the test suite:
./vendor/bin/phpunit
Disable Guzzle SSL verification:
HttpClient::setInstance(['verify' => false], [], true);