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