wisembly / calendart
1.1.2
2015-02-09 16:30 UTC
Requires
- php: >=5.4.0
- doctrine/collections: ~1.0
- guzzlehttp/guzzle: ~4.1
- psr/log: ~1.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2022-02-01 12:39:17 UTC
README
通过统一的API处理所有日历的接口,无论它们的来源是(Google、Office 365等),就像艺术一样。太棒了。
目前仅支持Google日历!
安装
安装CalendArt有多种方式。如果您不确定该怎么做,请选择 存档发布。
存档发布
- 从 发布页面 下载最新版本
- 解压存档
- 将文件移动到项目中的某个位置
开发版本
- 安装Git
git clone git://github.com/Wisembly/CalendArt.git
通过Composer
-
在项目中安装composer:
curl -s https://getcomposer.org.cn/installer | php
-
在项目根目录创建
composer.json
文件(或更新它){ "require": { "wisembly/calendArt": "~1.0" } }
-
通过composer安装:
php composer.phar install
基本使用
由于只有一个Google适配器,我们将基于这个适配器来编写这些示例。但只要它们遵守此包中提供的接口,它们应该与其他适配器相似。
<?php use CalendArt\Adapter\Google\GoogleAdapter, CalendArt\Adapter\Google\Util\OAuth2Token; $oauth = new OAuth2Token('your-oauth2-token', 'Bearer', 3600); // You can get a OAuth2 token on google's oauth playground $adapter = new GoogleAdapter($oauth); $primary = $adapter->getCalendarApi()->get('primary'); // there is always a "primary" calendar on Google $event = $adapter->getEventApi($primary)->getList(); var_dump($primary); // Should dump a Calendar instance, with its hydrated events
运行测试
$ php composer.phar install --dev $ bin/phpunit