2017 © Pedro Peláez
 

library github-service-provider

Pimple service provider for KnpLabs' GitHub API wrapper

image

rmasters/github-service-provider

Pimple service provider for KnpLabs' GitHub API wrapper

  • Friday, July 25, 2014
  • by rmasters
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Pimple GitHub API service provider

Provides the KnpLabs GitHub API wrapper to Pimple (Silex, Cilex) applications., (*1)

Installation

  1. Composer require this package:, (*2)

    composer require "rmasters/github-service-provider:~1.0"
  2. Register in your application:, (*3)

    $app = new Silex\Application;
    $app = new Pimple\Container;
    
    $app->register(new Rossible\Provider\GitHubProvider\GitHubServiceProvider);
    

This package requires Pimple 3.x and uses the ServiceProviderInterface and Container interfaces/type-hints that it provides. Silex 2.0 supports this, and Cilex should do soon., (*4)

Configuration

You can modify the GitHub\Client construction by extending these services:, (*5)

Service Description Default
github.client The Github\Client instance Github\Client
github.httpclient The HttpClient used for making requests CachedHttpClient
github.httpclient.caching When true, uses a CachedHttpClient true
github.httpclient.options Options array passed to HttpClient []
github.httpclient.cache The Response cache to use FilesystemCache
github.httpclient.cache.path When using FilesystemCache, where to store cached responses sys_get_temp_dir()

To change these, extend or replace the service, for example:, (*6)

// Toggle the caching variable
$app['github.httpclient.caching'] = false;

// Use a subdirectory in the temp directory
$app->extend('github.httpclient.cache.path', function($path, $app) {
    $path .= '/github-responses';
    mkdir($path, 776);

    return $path;
});

// Set a custom Accept header to access pre-release features
$app->extend('github.httpclient', function (HttpClientInterface $httpclient, $app) {
    $httpclient->setHeaders(['Accept' => 'application/vnd.github.she-hulk-preview+json']);

    return $httpclient;
});

License

Released under the MIT License., (*7)

The Versions

25/07 2014

dev-master

9999999-dev

Pimple service provider for KnpLabs' GitHub API wrapper

  Sources   Download

MIT

The Requires

 

silex github pimple service-provider

25/07 2014

v0.2.0

0.2.0.0

Pimple service provider for KnpLabs' GitHub API wrapper

  Sources   Download

MIT

The Requires

 

silex github pimple service-provider

25/07 2014

0.1.0

0.1.0.0

Pimple service provider for KnpLabs' GitHub API wrapper

  Sources   Download

MIT

The Requires