update deps
[pharext/pharext.org] / app / bootstrap / github.php
index 04396fb6cfaf30a1b849439c269150e68a5099ee..e0defa7bc5482da1f53c647431470e25e1e43eca 100644 (file)
@@ -16,10 +16,21 @@ $injector->share(Github\API::class)
                                $config->$basic->auth->toArray(),
                                0);
                }
+               // FIXME: configure through app.ini
+               try {
+                       $cache = new Github\Storage\Redis("gh-cache");
+               } catch (\Exception $ex) {
+                       try {
+                               $cache = new Github\Storage\Memcache("gh-cache");
+                       } catch (\Exception $ex) {
+                               $cache = null;
+                       }
+               }
                return new Github\API(
-                       $config->github
-                  ,new Github\Storage\Session("gh-tokens")
-                  #,new Github\Storage\Memcache("gh-cache")
+                        $config->github
+                       ,new Github\Logger($config)
+                       ,new Github\Storage\Session("gh-tokens")
+                       ,$cache
           );
        });