erwane/openagenda-api
最新稳定版本:3.1.2
Composer 安装命令:
composer require erwane/openagenda-api
包简介
PHP sdk to request OpenAgenda api
关键字:
README 文档
README
This package will help you to query OpenAgenda API. It supports all endpoints with all methods (HEAD, GET, POST, PATCH & DELETE).
Version map
| branch | This package version | OpenAgenda API | PHP min |
|---|---|---|---|
| 3.0.x | 3.0.* | v2 | PHP 7.2 |
| 3.x | ^3.1 | v2 | PHP 8.0 |
Installation
The sdk is not directly usable.
You need to use one client wrapper, compatible with your PSR-18 http client or framework.
Wrappers
Please check version map in the README of your desired wrapper.
CakePHP
erwane/openagenda-wrapper-cakephp
composer require erwane/openagenda-wrapper-cakephp
Guzzle
erwane/openagenda-wrapper-guzzle
composer require erwane/openagenda-wrapper-guzzle
Documentations and examples
Quick start
This package require wrapper compatible with your PSR-18 Http client (psr/http-client).
For performance and reduce queries in post, patch & delete (authenticated request), you can configure a PSR 16 cache (psr/simple-cache).
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 ]);
Usages
Agendas
$agendas = $oa->myAgendas(['limit' => 2]); $agenda = $oa->agendas(['slug' => 'agenda-slug'])->first();
See agendas for more details.
Locations
// Search $locations = $oa->locations(['agendaUid' => 123, 'name' => 'My Location']); // Exists and get $exists = $oa->location(['uid' => 456, 'agendaUid' => 123])->exists(); $location = $oa->location(['uid' => 456, 'agendaUid' => 123])->get(); // Create $location = $oa->location($data)->create();
See locations for more details.
Events
// Search $events = $oa->events(['agendaUid' => 123, 'title' => 'My event']); // Exists and get $exists = $oa->event(['uid' => 456, 'agendaUid' => 123])->exists(); $event = $oa->event(['uid' => 456, 'agendaUid' => 123])->get(); // Create $event = $oa->event($data)->create();
See events for more details.
统计信息
- 总下载量: 107
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-13