Component to access the github API base on https://github.com/KnpLabs/php-github-api
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
nbproject
src
.gitattributes
.gitignore
LICENSE
README.md
build.xml
composer.json
composer.lock

README.md

platform.github

Component to access the github API base on https://github.com/KnpLabs/php-github-api

#Installation Just add the package to composer:

...
  "require": {
    "php": ">=7",
    "codenamephp/platform.github": "*"
  },
...

Then add the \de\codenamephp\platform\github\DefinitionProvider to the DI Container:

$containerBuilder = new \de\codenamephp\platform\di\ContainerBuilder();
$containerBuilder->addDefinitionsByProvider(new \de\codenamephp\platform\github\DefinitionProvider());
return $containerBuilder;

#Usage ##Authentication Github requires authentication before making any API calls. There are several authentication methods available. A complete list and documentation can be found in the github help: https://developer.github.com/v3/oauth_authorizations/ and https://developer.github.com/v3/auth/ ###API Token (https://github.com/blog/1509-personal-api-tokens) To authenticate via API Token, just request a de\codenamephp\platform\github\ApiToken from the DI container and call authenticate():

$diContainer->get(de\codenamephp\platform\github\ApiToken::class)->authenticate();

The github.apiToken entry needs to be set in the DI Container, otherwise the instance cannot be created.