Skip to content

Instantly share code, notes, and snippets.

@a-ast
Last active December 30, 2016 23:41
Show Gist options
  • Save a-ast/e99b81d337c40f06bce3255b9e0b0347 to your computer and use it in GitHub Desktop.
Save a-ast/e99b81d337c40f06bce3255b9e0b0347 to your computer and use it in GitHub Desktop.
How to use Github API Client with request/response caching
<?php
use Github\Client;
use Github\HttpClient\Builder;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
$httpBuilder = new Builder();
$httpBuilder->addCache(new FilesystemAdapter('', 0, 'var/http-cache'));
$client = new Client($httpBuilder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment