X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2Fbootstrap%2Fgithub.php;h=e03cba099fd16717fe1c4b09911e2c5be263e1ae;hb=5c1a4c8a5d83ea925f17c94e5ab996b92e31e240;hp=fe3477f4d027ea6c607e9fdd150fc50d18ea2bcd;hpb=34739d9ba328b1e9176800883eae0987f5f05337;p=pharext%2Fpharext.org diff --git a/app/bootstrap/github.php b/app/bootstrap/github.php index fe3477f..e03cba0 100644 --- a/app/bootstrap/github.php +++ b/app/bootstrap/github.php @@ -4,7 +4,6 @@ namespace app; require_once __DIR__."/config.php"; -use merry\Config; use http\Url; $injector->share(Github\API::class) @@ -17,10 +16,20 @@ $injector->share(Github\API::class) $config->$basic->auth->toArray(), 0); } + $logger = new Github\Logger($config); + + // FIXME: configure through app.ini + try { + $cache = new Github\Storage\Redis("gh-cache"); + } catch (\Exception $ex) { + /* Memcached won't throw an exception */ + $cache = new Github\Storage\Memcache("gh-cache"); + } return new Github\API( - $config->github - ,new Github\Storage\Session("gh-tokens") - #,new Github\Storage\Memcache("gh-cache") + $config->github + ,$logger + ,new Github\Storage\Session("gh-tokens") + ,$cache ); });