dev-master
9999999-devIWEventos api client
MIT
The Requires
api client guzzle iweventos
1.0.0
1.0.0.0IWEventos api client
MIT
The Requires
api client guzzle iweventos
Wallogit.com
2017 © Pedro Peláez
IWEventos api client
PHP Library based on Guzzle to consume IWEventos API., (*1)
The biggest advantage in using Guzzle is that you can easely attach Guzzle plugins to your client. Here, for example,you can see how to attach the log plugin and write all your requests to a file., (*2)
For more information about api methods, see Official documentation for IWEventos API, (*3)
To use this api you must have an access token and the server ip authenticated next to IWEventos, (*4)
The recommended way to install this library is through Composer. For information about Composer and how to install in look here., (*5)
From the command line run, (*6)
composer require dmandrade/iweventos-api-client
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$iweventos = new \Dmandrade\IWEventos\Api\Client("insert_here_api_base_url", "insert_here_api_access_token");
$response = $iweventos->eventos();
print_r($response);
If you want to set a specific timeout, sust set the cURL timeout options in the client:, (*7)
$iweventos = new \Dmandrade\IWEventos\Api\Client("insert_here_api_base_url", "insert_here_api_access_token"); // set cURL timeout, you can specify any cURL options $iweventos->setConfig(array( 'curl.options' => array( CURLOPT_TIMEOUT => 2, CURLOPT_CONNECTTIMEOUT => 2 ) )); $response = $iweventos->eventos(); print_r($response);
Here you can see how to attach Guzzle Log plug to your client and save all your requests to a file., (*8)
NB: To run this script you need monolog/monolog, (*9)
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
use Guzzle\Log\MessageFormatter;
use Guzzle\Log\MonologLogAdapter;
use Guzzle\Plugin\Log\LogPlugin;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
$logger = new Logger('client');
$logger->pushHandler(new StreamHandler('/tmp/iweventos_api.log'));
$adapter = new MonologLogAdapter($logger);
$logPlugin = new LogPlugin($adapter, MessageFormatter::DEBUG_FORMAT);
$iweventos = new \Dmandrade\IWEventos\Api\Client("insert_here_api_base_url", "insert_here_api_access_token");;
$iweventos->addSubscriber($logPlugin);
$response = $iweventos->eventos();
print_r($response);
Now in /tmp/iweventos_api.log you can see all your requests., (*10)
IWEventos api client
MIT
api client guzzle iweventos
IWEventos api client
MIT
api client guzzle iweventos