erwane/openagenda-wrapper-guzzle

Guzzle wrapper for erwane/openagenda-api package.

2.0.1 2025-01-21 14:25 UTC

This package is auto-updated.

Last update: 2025-01-21 14:25:50 UTC


README

Software License codecov Build Status Packagist Downloads Packagist Version

Guzzle wrapper for erwane/openagenda-api package.

Version map

use OpenAgenda\OpenAgenda;
use OpenAgenda\Wrapper\GuzzleWrapper

// PSR-18 Http client.
$guzzleOptions = ['timeout' => 2.0];
$wrapper = new GuzzleWrapper($guzzleOptions);

// PSR-16 Simple cache. Optional
$cache = new Psr16Cache();

// Create the OpenAgenda client. The public key is required for reading data (GET)
// The private key is optional and only needed for writing data (POST, PUT, DELETE)
$oa = new OpenAgenda([
    'public_key' => 'my public key', // Required
    'secret_key' => 'my secret key', // Optional, only for create/update/delete
    'wrapper' => $wrapper, // Required
    'cache' => $cache, // Optional
    'defaultLang' => 'fr', // Optional
]);

Check OpenAgenda API lib for details.