diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-02-24 14:47:35 +0100 |
---|---|---|
committer | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-02-24 14:47:35 +0100 |
commit | f83125d2f5cea2c850b7f31ef1ad0a50c6fefdd9 (patch) | |
tree | c8352e3e576ba849a6ea01940b64861bc97bd8ff /src/Wallabag | |
parent | d7cc16c8b585f6a600cd309a9bb5630794fcf9aa (diff) | |
parent | 7af794e525fd0d7504d0a1c41cc747909df66033 (diff) | |
download | wallabag-f83125d2f5cea2c850b7f31ef1ad0a50c6fefdd9.tar.gz wallabag-f83125d2f5cea2c850b7f31ef1ad0a50c6fefdd9.tar.zst wallabag-f83125d2f5cea2c850b7f31ef1ad0a50c6fefdd9.zip |
Merge pull request #1716 from wallabag/v2-enhance-requirements-installation
Fix #1603: Enhance requirements in InstallCommand
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 84bd51fa..9383628c 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 $functionExists = [ | ||
33 | 'curl_exec', | ||
34 | 'curl_multi_init', | ||
35 | ]; | ||
36 | |||
29 | protected function configure() | 37 | protected function configure() |
30 | { | 38 | { |
31 | $this | 39 | $this |
@@ -65,27 +73,32 @@ class InstallCommand extends ContainerAwareCommand | |||
65 | 73 | ||
66 | $fulfilled = true; | 74 | $fulfilled = true; |
67 | 75 | ||
68 | $label = '<comment>PCRE</comment>'; | 76 | $label = '<comment>PDO Drivers</comment>'; |
69 | if (extension_loaded('pcre')) { | 77 | if (extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql')) { |
70 | $status = '<info>OK!</info>'; | 78 | $status = '<info>OK!</info>'; |
71 | $help = ''; | 79 | $help = ''; |
72 | } else { | 80 | } else { |
73 | $fulfilled = false; | 81 | $fulfilled = false; |
74 | $status = '<error>ERROR!</error>'; | 82 | $status = '<error>ERROR!</error>'; |
75 | $help = 'You should enabled PCRE extension'; | 83 | $help = 'Needs one of sqlite, mysql or pgsql PDO drivers'; |
76 | } | 84 | } |
85 | |||
77 | $rows[] = array($label, $status, $help); | 86 | $rows[] = array($label, $status, $help); |
78 | 87 | ||
79 | $label = '<comment>DOM</comment>'; | 88 | foreach ($this->functionExists as $functionRequired) { |
80 | if (extension_loaded('DOM')) { | 89 | $label = '<comment>'.$functionRequired.'</comment>'; |
81 | $status = '<info>OK!</info>'; | 90 | |
82 | $help = ''; | 91 | if (function_exists($functionRequired)) { |
83 | } else { | 92 | $status = '<info>OK!</info>'; |
84 | $fulfilled = false; | 93 | $help = ''; |
85 | $status = '<error>ERROR!</error>'; | 94 | } else { |
86 | $help = 'You should enabled DOM extension'; | 95 | $fulfilled = false; |
96 | $status = '<error>ERROR!</error>'; | ||
97 | $help = 'You need the '.$requirement.' function activated'; | ||
98 | } | ||
99 | |||
100 | $rows[] = array($label, $status, $help); | ||
87 | } | 101 | } |
88 | $rows[] = array($label, $status, $help); | ||
89 | 102 | ||
90 | $table = new Table($this->defaultOutput); | 103 | $table = new Table($this->defaultOutput); |
91 | $table | 104 | $table |