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 --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src') 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