5 require_once __DIR__
."/config.php";
9 $injector->share(Github\API
::class)
10 ->delegate(Github\API
::class, function() use($injector) {
11 $config = $injector->make(Config
::class);
12 if (isset($config->github
->hook
->use_basic_auth
)) {
13 $basic = $config->github
->hook
->use_basic_auth
;
14 $config->github
->hook
->url
= (string) new Url(
15 $config->github
->hook
->url
,
16 $config->$basic->auth
->toArray(),
19 $logger = new Github\
Logger($config);
21 // FIXME: configure through app.ini
23 $cache = new Github\Storage\
Redis("gh-cache");
24 } catch (\Exception
$ex) {
25 /* Memcached won't throw an exception */
26 $cache = new Github\Storage\
Memcache("gh-cache");
28 return new Github\
API(
31 ,new Github\Storage\
Session("gh-tokens")