From 2671ece02c6925d429378ce412dd782a92ba9bc7 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 13 May 2015 15:22:26 +0200 Subject: [PATCH] try available cache storages --- app/bootstrap/github.php | 12 ++++++++++-- app/views/alert.phtml | 4 +--- config/sql/001.sql | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/bootstrap/github.php b/app/bootstrap/github.php index 30bd96d..e0defa7 100644 --- a/app/bootstrap/github.php +++ b/app/bootstrap/github.php @@ -17,12 +17,20 @@ $injector->share(Github\API::class) 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\Logger($config) ,new Github\Storage\Session("gh-tokens") - #,new Github\Storage\Memcache("gh-cache") - ,new Github\Storage\Redis("gh-cache") + ,$cache ); }); diff --git a/app/views/alert.phtml b/app/views/alert.phtml index 2a12f16..8a5a45a 100644 --- a/app/views/alert.phtml +++ b/app/views/alert.phtml @@ -12,7 +12,5 @@

Stack Trace

-
e($exception->getTraceAsString()) ?>
-

Full Dump

-
e($exception) ?>
+
e($exception) ?>
diff --git a/config/sql/001.sql b/config/sql/001.sql index 241b38d..ddf5d03 100644 --- a/config/sql/001.sql +++ b/config/sql/001.sql @@ -26,5 +26,5 @@ create table owners ( ,login text not null ,owner jsonb ,primary key (account,authority) - ,unique key (login,authority) + ,unique (login,authority) ); -- 2.30.2