]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
add composer extensions check & function_exists checks
authorThomas Citharel <tcit@tcit.fr>
Tue, 23 Feb 2016 18:06:37 +0000 (19:06 +0100)
committerThomas Citharel <tcit@tcit.fr>
Tue, 23 Feb 2016 18:06:37 +0000 (19:06 +0100)
composer.json
src/Wallabag/CoreBundle/Command/InstallCommand.php

index fe6880aa797d5caeae8936b5cc4c64ee1201b155..0a0160491df7d3fdba15ff0b8643643d6f749824 100644 (file)
         "paragonie/random_compat": "~1.0",
         "craue/config-bundle": "~1.4",
         "mnapoli/piwik-twig-extension": "^1.0",
-        "lexik/maintenance-bundle": "~2.1"
+        "lexik/maintenance-bundle": "~2.1",
+        "ext-pcre": "*",
+        "ext-DOM": "*",
+        "ext-curl": "*",
+        "ext-gd": "*",
+        "ext-session": "*",
+        "ext-Ctype": "*",
+        "ext-hash": "*",
+        "ext-simplexml": "*",
+        "ext-json": "*",
+        "ext-mbstring": "*",
+        "ext-xml": "*",
+        "ext-tidy": "*",
+        "ext-iconv": "*",
+        "ext-gettext": "*",
+        "ext-tokenizer": "*",
+        "ext-PDO": "*"
     },
     "require-dev": {
         "doctrine/doctrine-fixtures-bundle": "~2.2",
index f1111cce650c24ac800c724abf3ed33f4bdcbc67..114b8726b43124b2bde02428a0828a4de836ce88 100644 (file)
@@ -29,9 +29,11 @@ class InstallCommand extends ContainerAwareCommand
     /**
      * @var array
      */
-    protected $requirements = [
-        'pcre',
-        'DOM',
+    protected $functionExists = [
+        'tidy_parse_string',
+        'curl_exec',
+        'curl_multi_init',
+        'gettext',
     ];
 
     protected function configure()
@@ -73,16 +75,30 @@ class InstallCommand extends ContainerAwareCommand
 
         $fulfilled = true;
 
-        foreach ($this->requirements as $requirement) {
-            $label = '<comment>'.strtoupper($requirement).'</comment>';
-            if (extension_loaded($requirement)) {
+        $label = '<comment>PDO Drivers</comment>';
+        if (extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql')) {
+            $status = '<info>OK!</info>';
+            $help = '';
+        } else {
+            $fulfilled = false;
+            $status = '<error>ERROR!</error>';
+            $help = 'Needs one of sqlite, mysql or pgsql PDO drivers';
+        }
+
+        $rows[] = array($label, $status, $help);
+
+        foreach ($this->functionExists as $functionRequired) {
+            $label = '<comment>'.$functionRequired.'</comment>';
+
+            if (function_exists($functionRequired)) {
                 $status = '<info>OK!</info>';
                 $help = '';
             } else {
                 $fulfilled = false;
                 $status = '<error>ERROR!</error>';
-                $help = 'You should enabled '.$requirement.' extension';
+                $help = 'You need the '.$requirement.' function activated';
             }
+
             $rows[] = array($label, $status, $help);
         }