X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2Fbootstrap%2Fgithub.php;h=2f1bbaade700144a7e83a6f361a1ca883833a535;hb=9e35d9e1f6adb610b17e940616cd1dc4ec8aa0d7;hp=0ec014e09c00d7c0aac54c26e19da76d82ae6bd2;hpb=7127fbd60ef118a688b5c4270ed73369b2b2424a;p=pharext%2Fpharext.org diff --git a/app/bootstrap/github.php b/app/bootstrap/github.php index 0ec014e..2f1bbaa 100644 --- a/app/bootstrap/github.php +++ b/app/bootstrap/github.php @@ -3,6 +3,8 @@ namespace app; require_once __DIR__."/config.php"; +require_once __DIR__."/uri_template.php"; +require_once __DIR__."/session.php"; use http\Url; @@ -16,11 +18,20 @@ $injector->share(Github\API::class) $config->$basic->auth->toArray(), 0); } + $logger = new Logger($config, $config->github->log); + + // 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 + ,$logger ,new Github\Storage\Session("gh-tokens") - #,new Github\Storage\Memcache("gh-cache") - ,new Github\Storage\Redis("gh-cache") + ,$cache ); });