定制 erwane/openagenda-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

erwane/openagenda-api

最新稳定版本:3.1.2

Composer 安装命令:

composer require erwane/openagenda-api

包简介

PHP sdk to request OpenAgenda api

关键字:

README 文档

README

Software License codecov Build Status Packagist Downloads Packagist Version

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

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固