aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2016-02-23 16:41:38 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2016-02-23 16:41:38 +0100
commitfc6020b2c8f133052b82dd49337fbb3f2f480ebf (patch)
tree01080ce1f37cba2e5fd132003cec4229540ca9e4
parent754cb2abc08fa3fc12d03f8cc5d8800164dc9ad0 (diff)
downloadwallabag-fc6020b2c8f133052b82dd49337fbb3f2f480ebf.tar.gz
wallabag-fc6020b2c8f133052b82dd49337fbb3f2f480ebf.tar.zst
wallabag-fc6020b2c8f133052b82dd49337fbb3f2f480ebf.zip
Enhance requirements in InstallCommand
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php39
1 files 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
26 */ 26 */
27 protected $defaultOutput; 27 protected $defaultOutput;
28 28
29 /**
30 * @var array
31 */
32 protected $requirements = [
33 'pcre',
34 'DOM',
35 ];
36
29 protected function configure() 37 protected function configure()
30 { 38 {
31 $this 39 $this
@@ -65,27 +73,18 @@ class InstallCommand extends ContainerAwareCommand
65 73
66 $fulfilled = true; 74 $fulfilled = true;
67 75
68 $label = '<comment>PCRE</comment>'; 76 foreach ($this->requirements as $requirement) {
69 if (extension_loaded('pcre')) { 77 $label = '<comment>'.strtoupper($requirement).'</comment>';
70 $status = '<info>OK!</info>'; 78 if (extension_loaded($requirement)) {
71 $help = ''; 79 $status = '<info>OK!</info>';
72 } else { 80 $help = '';
73 $fulfilled = false; 81 } else {
74 $status = '<error>ERROR!</error>'; 82 $fulfilled = false;
75 $help = 'You should enabled PCRE extension'; 83 $status = '<error>ERROR!</error>';
76 } 84 $help = 'You should enabled '.$requirement.' extension';
77 $rows[] = array($label, $status, $help); 85 }
78 86 $rows[] = array($label, $status, $help);
79 $label = '<comment>DOM</comment>';
80 if (extension_loaded('DOM')) {
81 $status = '<info>OK!</info>';
82 $help = '';
83 } else {
84 $fulfilled = false;
85 $status = '<error>ERROR!</error>';
86 $help = 'You should enabled DOM extension';
87 } 87 }
88 $rows[] = array($label, $status, $help);
89 88
90 $table = new Table($this->defaultOutput); 89 $table = new Table($this->defaultOutput);
91 $table 90 $table