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 79c6447d8fcbe11cf1978b4e4032f5cf4829f5d8..8e260bc0a269795a414bcc2b1e310a3a9912b0c4 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');
+        }
     }
 }
 ?>