check if oauth extension is installed
authorChristian Weiske <cweiske@cweiske.de>
Thu, 21 Aug 2014 19:38:37 +0000 (21:38 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 21 Aug 2014 19:38:37 +0000 (21:38 +0200)
controller/guicontroller.php

index 79c6447..8e260bc 100644 (file)
@@ -56,6 +56,8 @@ class GuiController extends Controller
      */
     public function index()
     {
+        $this->checkDeps();
+
         $res = new TemplateResponse('grauphel', 'index');
         $res->setParams(
             array(
@@ -67,7 +69,13 @@ class GuiController extends Controller
             )
         );
         return $res;
+    }
 
+    protected function checkDeps()
+    {
+        if (!class_exists('OAuthProvider')) {
+            throw new \Exception('PHP extension "oauth" is required');
+        }
     }
 }
 ?>