wisembly / calendart
Manage remote calendars (google, office 365, ...) through an unified api
Installs: 1 593
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 15
Forks: 2
Open Issues: 2
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
Interface to handle all your calendars through an unified API, whatever their source are (Google, Office 365, ... etc), as if it was an art. Hell yeah.
Only google calendar is currently supported !
Installation
You have multiple ways to install CalendArt. If you are unsure what to do, go with the archive release.
Archive Release
- Download the most recent release from the release page
- Unpack the archive
- Move the files somewhere in your project
Development version
- Install Git
git clone git://github.com/Wisembly/CalendArt.git
Via Composer
-
Install composer in your project:
curl -s http://getcomposer.org/installer | php
-
Create a
composer.json
file (or update it) in your project root:{ "require": { "wisembly/calendArt": "~1.0" } }
-
Install via composer :
php composer.phar install
Basic Usage
As there is only Google's adapter, we're going to base these examples on this one. But it should be similar to the others one, as long as they respect the interface provided in this package.
<?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
Running Tests
$ php composer.phar install --dev $ bin/phpunit