mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-17 03:05:19 +00:00
Enhance requirements in InstallCommand
This commit is contained in:
parent
754cb2abc0
commit
fc6020b2c8
1 changed files with 19 additions and 20 deletions
|
@ -26,6 +26,14 @@ class InstallCommand extends ContainerAwareCommand
|
||||||
*/
|
*/
|
||||||
protected $defaultOutput;
|
protected $defaultOutput;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $requirements = [
|
||||||
|
'pcre',
|
||||||
|
'DOM',
|
||||||
|
];
|
||||||
|
|
||||||
protected function configure()
|
protected function configure()
|
||||||
{
|
{
|
||||||
$this
|
$this
|
||||||
|
@ -65,27 +73,18 @@ class InstallCommand extends ContainerAwareCommand
|
||||||
|
|
||||||
$fulfilled = true;
|
$fulfilled = true;
|
||||||
|
|
||||||
$label = '<comment>PCRE</comment>';
|
foreach ($this->requirements as $requirement) {
|
||||||
if (extension_loaded('pcre')) {
|
$label = '<comment>'.strtoupper($requirement).'</comment>';
|
||||||
$status = '<info>OK!</info>';
|
if (extension_loaded($requirement)) {
|
||||||
$help = '';
|
$status = '<info>OK!</info>';
|
||||||
} else {
|
$help = '';
|
||||||
$fulfilled = false;
|
} else {
|
||||||
$status = '<error>ERROR!</error>';
|
$fulfilled = false;
|
||||||
$help = 'You should enabled PCRE extension';
|
$status = '<error>ERROR!</error>';
|
||||||
|
$help = 'You should enabled '.$requirement.' extension';
|
||||||
|
}
|
||||||
|
$rows[] = array($label, $status, $help);
|
||||||
}
|
}
|
||||||
$rows[] = array($label, $status, $help);
|
|
||||||
|
|
||||||
$label = '<comment>DOM</comment>';
|
|
||||||
if (extension_loaded('DOM')) {
|
|
||||||
$status = '<info>OK!</info>';
|
|
||||||
$help = '';
|
|
||||||
} else {
|
|
||||||
$fulfilled = false;
|
|
||||||
$status = '<error>ERROR!</error>';
|
|
||||||
$help = 'You should enabled DOM extension';
|
|
||||||
}
|
|
||||||
$rows[] = array($label, $status, $help);
|
|
||||||
|
|
||||||
$table = new Table($this->defaultOutput);
|
$table = new Table($this->defaultOutput);
|
||||||
$table
|
$table
|
||||||
|
|
Loading…
Reference in a new issue