evandotpro / edp-github
Github API integration module for Zend Framework 2
Installs: 1 497
Dependents: 0
Suggesters: 0
Security: 0
Stars: 25
Watchers: 6
Forks: 10
Open Issues: 0
Type:zf-module
Requires
- php: >=5.5
- zendframework/zend-eventmanager: ~2.3
- zendframework/zend-filter: ~2.3
- zendframework/zend-http: ~2.3
- zendframework/zend-servicemanager: ~2.3
Requires (Dev)
- fabpot/php-cs-fixer: ~1.4
- phpunit/phpunit: 3.7.*
- satooshi/php-coveralls: >=0.6.0
This package is not auto-updated.
Last update: 2024-11-19 05:54:46 UTC
README
Introduction
EdpGithub is a Wrapper for the Github Api based on Zend Framework 2 which uses Github API v3.
Installation
Main Setup
- Clone this project into your
./vendor/
directory and enable it in yourapplication.config.php
file.
Usage
Basic Usage
Here is short example on how to use
$client = $serviceManager->get('EdpGithub\Client');
$repos = $client->api('user')->repos('hounddog');
This would fetch all the Repositories for the user Hounddog
Authentication
To use functionality which needs Authentication you have to first authenticate
$client = $serviceManager->get('EdpGithub\Client');
$client->authenticate('url_token', 'access_token');
$repos = $client->api('current_user')->repos();
You can also listen to the Event 'EdpGithub\Client', 'api'
$em->attach('EdpGithub\Client', 'api', function($e) use ($sm) {
$client = $e->getTarget();
$client->authenticate('url_token', $token /* your access_token here */);
} );
Documentation
Please refer to the Wiki for a more detailed Documentation