From fc6020b2c8f133052b82dd49337fbb3f2f480ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 23 Feb 2016 16:41:38 +0100 Subject: Enhance requirements in InstallCommand --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 39 +++++++++++----------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 84bd51fa..f1111cce 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -26,6 +26,14 @@ class InstallCommand extends ContainerAwareCommand */ protected $defaultOutput; + /** + * @var array + */ + protected $requirements = [ + 'pcre', + 'DOM', + ]; + protected function configure() { $this @@ -65,27 +73,18 @@ class InstallCommand extends ContainerAwareCommand $fulfilled = true; - $label = 'PCRE'; - if (extension_loaded('pcre')) { - $status = 'OK!'; - $help = ''; - } else { - $fulfilled = false; - $status = 'ERROR!'; - $help = 'You should enabled PCRE extension'; - } - $rows[] = array($label, $status, $help); - - $label = 'DOM'; - if (extension_loaded('DOM')) { - $status = 'OK!'; - $help = ''; - } else { - $fulfilled = false; - $status = 'ERROR!'; - $help = 'You should enabled DOM extension'; + foreach ($this->requirements as $requirement) { + $label = ''.strtoupper($requirement).''; + if (extension_loaded($requirement)) { + $status = 'OK!'; + $help = ''; + } else { + $fulfilled = false; + $status = 'ERROR!'; + $help = 'You should enabled '.$requirement.' extension'; + } + $rows[] = array($label, $status, $help); } - $rows[] = array($label, $status, $help); $table = new Table($this->defaultOutput); $table -- cgit v1.2.3 From db847ca0b75728602f1800fe61829965493fa73c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 23 Feb 2016 19:06:37 +0100 Subject: add composer extensions check & function_exists checks --- composer.json | 18 ++++++++++++- src/Wallabag/CoreBundle/Command/InstallCommand.php | 30 +++++++++++++++++----- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index fe6880aa..0a016049 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,23 @@ "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", diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index f1111cce..114b8726 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -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 = ''.strtoupper($requirement).''; - if (extension_loaded($requirement)) { + $label = 'PDO Drivers'; + if (extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql')) { + $status = 'OK!'; + $help = ''; + } else { + $fulfilled = false; + $status = 'ERROR!'; + $help = 'Needs one of sqlite, mysql or pgsql PDO drivers'; + } + + $rows[] = array($label, $status, $help); + + foreach ($this->functionExists as $functionRequired) { + $label = ''.$functionRequired.''; + + if (function_exists($functionRequired)) { $status = 'OK!'; $help = ''; } else { $fulfilled = false; $status = 'ERROR!'; - $help = 'You should enabled '.$requirement.' extension'; + $help = 'You need the '.$requirement.' function activated'; } + $rows[] = array($label, $status, $help); } -- cgit v1.2.3 From 0a7e695975af4dc6fe3c8b22ab9323b725d8da6d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 23 Feb 2016 23:29:25 +0100 Subject: remove unused functions & clean composer.json --- composer.json | 33 +++++++++++----------- src/Wallabag/CoreBundle/Command/InstallCommand.php | 2 -- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 0a016049..796c4c15 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,21 @@ }, "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-gettext": "*", + "ext-tokenizer": "*", + "ext-PDO": "*", "symfony/symfony": "3.0.*", "doctrine/orm": "^2.5", "doctrine/doctrine-bundle": "^1.6", @@ -66,23 +81,7 @@ "paragonie/random_compat": "~1.0", "craue/config-bundle": "~1.4", "mnapoli/piwik-twig-extension": "^1.0", - "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": "*" + "lexik/maintenance-bundle": "~2.1" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "~2.2", diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 114b8726..9383628c 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -30,10 +30,8 @@ class InstallCommand extends ContainerAwareCommand * @var array */ protected $functionExists = [ - 'tidy_parse_string', 'curl_exec', 'curl_multi_init', - 'gettext', ]; protected function configure() -- cgit v1.2.3 From 744746135254b3fe712d41e3a9b125cf50002a34 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Feb 2016 13:43:00 +0100 Subject: Add namespace prefix for psr-4 > Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 796c4c15..70a50f09 100644 --- a/composer.json +++ b/composer.json @@ -126,7 +126,7 @@ } }, "autoload": { - "psr-4": { "": "src/" }, + "psr-4": { "Wallabag\\": "src/Wallabag/" }, "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] }, "config": { -- cgit v1.2.3 From fd3fd481a66478931be6800127d8473621aba272 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Feb 2016 13:47:54 +0100 Subject: Exclude v1 branches from Travis Instead of allowing only v2. Branches which didn't target v2 BUT related to v2 weren't tested on Travis --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ae43639..819d29fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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; -- cgit v1.2.3 From 7af794e525fd0d7504d0a1c41cc747909df66033 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Feb 2016 14:19:47 +0100 Subject: Remove gettext & lowerize --- composer.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 70a50f09..a1a7ebb4 100644 --- a/composer.json +++ b/composer.json @@ -30,20 +30,19 @@ "require": { "php": ">=5.5.9", "ext-pcre": "*", - "ext-DOM": "*", + "ext-dom": "*", "ext-curl": "*", "ext-gd": "*", "ext-session": "*", - "ext-Ctype": "*", + "ext-ctype": "*", "ext-hash": "*", "ext-simplexml": "*", "ext-json": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-iconv": "*", - "ext-gettext": "*", "ext-tokenizer": "*", - "ext-PDO": "*", + "ext-pdo": "*", "symfony/symfony": "3.0.*", "doctrine/orm": "^2.5", "doctrine/doctrine-bundle": "^1.6", -- cgit v1.2.3