aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag')
-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