aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command/InstallCommand.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/InstallCommand.php')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 2e241757..771b3c5a 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 '.$functionRequired.' 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
@@ -180,7 +193,7 @@ class InstallCommand extends ContainerAwareCommand
180 $this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>'); 193 $this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>');
181 194
182 $questionHelper = $this->getHelperSet()->get('question'); 195 $questionHelper = $this->getHelperSet()->get('question');
183 $question = new ConfirmationQuestion('Would you like to create a new user ? (y/N)', false); 196 $question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (y/N)', true);
184 197
185 if (!$questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) { 198 if (!$questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) {
186 return $this; 199 return $this;