try available cache storages
authorMichael Wallner <mike@php.net>
Wed, 13 May 2015 13:22:26 +0000 (15:22 +0200)
committerMichael Wallner <mike@php.net>
Wed, 13 May 2015 13:22:26 +0000 (15:22 +0200)
app/bootstrap/github.php
app/views/alert.phtml
config/sql/001.sql

index 30bd96d88727decc1a97de18e7eafa77396e2925..e0defa7bc5482da1f53c647431470e25e1e43eca 100644 (file)
@@ -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
           );
        });
 
index 2a12f16b0fa3762f0984904716716d974300ecaf..8a5a45acf5e888537ffdb717b1faadff63c19e91 100644 (file)
@@ -12,7 +12,5 @@
 
 <?php if (APP_ENVIRONMENT != "production") : ?>
 <h3>Stack Trace</h3>
-<pre><?= $this->e($exception->getTraceAsString()) ?></pre>
-<h3>Full Dump</h3>
-<pre><?= $this->e($exception) ?></pre>
+<pre style="display:block; overflow-x: scroll"><?= $this->e($exception) ?></pre>
 <?php endif; ?>
index 241b38d7d7c2d87b58bda44be3297008287696ef..ddf5d030ed2af8f317c5b20028aa425cd0f2494c 100644 (file)
@@ -26,5 +26,5 @@ create table owners (
        ,login text not null
        ,owner jsonb
        ,primary key (account,authority)
-       ,unique key (login,authority)
+       ,unique (login,authority)
 );