]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1716 from wallabag/v2-enhance-requirements-installation
authorJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 24 Feb 2016 13:47:35 +0000 (14:47 +0100)
committerJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 24 Feb 2016 13:47:35 +0000 (14:47 +0100)
Fix #1603: Enhance requirements in InstallCommand

.travis.yml
composer.json
src/Wallabag/CoreBundle/Command/InstallCommand.php

index 9ae43639743a7b8b971d4b798d62083eb0907557..819d29fdc947db3564094dca32d88410edeb3a43 100644 (file)
@@ -34,9 +34,11 @@ matrix:
     allow_failures:
         - php: hhvm
 
+# exclude v1 branches
 branches:
-    only:
-        - v2
+    except:
+        - master
+        - dev
 
 before_script:
     - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
index fe6880aa797d5caeae8936b5cc4c64ee1201b155..a1a7ebb49654d152d80fc1dbce89d71d2db65319 100644 (file)
     },
     "require": {
         "php": ">=5.5.9",
+        "ext-pcre": "*",
+        "ext-dom": "*",
+        "ext-curl": "*",
+        "ext-gd": "*",
+        "ext-session": "*",
+        "ext-ctype": "*",
+        "ext-hash": "*",
+        "ext-simplexml": "*",
+        "ext-json": "*",
+        "ext-mbstring": "*",
+        "ext-xml": "*",
+        "ext-iconv": "*",
+        "ext-tokenizer": "*",
+        "ext-pdo": "*",
         "symfony/symfony": "3.0.*",
         "doctrine/orm": "^2.5",
         "doctrine/doctrine-bundle": "^1.6",
         }
     },
     "autoload": {
-        "psr-4": { "": "src/" },
+        "psr-4": { "Wallabag\\": "src/Wallabag/" },
         "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
     },
     "config": {
index 84bd51fa220060a65088ebbf7a699c493cc8a9a7..9383628c961120c176baaa06339e592e6e68ef9c 100644 (file)
@@ -26,6 +26,14 @@ class InstallCommand extends ContainerAwareCommand
      */
     protected $defaultOutput;
 
+    /**
+     * @var array
+     */
+    protected $functionExists = [
+        'curl_exec',
+        'curl_multi_init',
+    ];
+
     protected function configure()
     {
         $this
@@ -65,27 +73,32 @@ class InstallCommand extends ContainerAwareCommand
 
         $fulfilled = true;
 
-        $label = '<comment>PCRE</comment>';
-        if (extension_loaded('pcre')) {
+        $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 = 'You should enabled PCRE extension';
+            $help = 'Needs one of sqlite, mysql or pgsql PDO drivers';
         }
+
         $rows[] = array($label, $status, $help);
 
-        $label = '<comment>DOM</comment>';
-        if (extension_loaded('DOM')) {
-            $status = '<info>OK!</info>';
-            $help = '';
-        } else {
-            $fulfilled = false;
-            $status = '<error>ERROR!</error>';
-            $help = 'You should enabled DOM extension';
+        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 need the '.$requirement.' function activated';
+            }
+
+            $rows[] = array($label, $status, $help);
         }
-        $rows[] = array($label, $status, $help);
 
         $table = new Table($this->defaultOutput);
         $table