X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FInstallCommand.php;h=c9dad0df71eff039030eb6aea08ac663ec1325f6;hb=e71c376db9a96e63595c0773828e96235c8d1233;hp=e6a06eea3f47785a0710a11255698a9bf1a1eeba;hpb=e008c037f53324b931f027483f9f1053171109c5;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index e6a06eea..c9dad0df 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -26,6 +26,14 @@ class InstallCommand extends ContainerAwareCommand */ protected $defaultOutput; + /** + * @var array + */ + protected $functionExists = [ + 'curl_exec', + 'curl_multi_init', + ]; + protected function configure() { $this @@ -56,7 +64,7 @@ class InstallCommand extends ContainerAwareCommand ; $output->writeln('Wallabag has been successfully installed.'); - $output->writeln('Just execute `php bin/console server:run` for using wallabag: http://localhost:8000'); + $output->writeln('Just execute `php bin/console server:run --env=prod` for using wallabag: http://localhost:8000'); } protected function checkRequirements() @@ -65,27 +73,32 @@ class InstallCommand extends ContainerAwareCommand $fulfilled = true; - $label = 'PCRE'; - if (extension_loaded('pcre')) { + $label = 'PDO Drivers'; + if (extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql')) { $status = 'OK!'; $help = ''; } else { $fulfilled = false; $status = 'ERROR!'; - $help = 'You should enabled PCRE extension'; + $help = 'Needs one of sqlite, mysql or pgsql PDO drivers'; } + $rows[] = array($label, $status, $help); - $label = 'DOM'; - if (extension_loaded('DOM')) { - $status = 'OK!'; - $help = ''; - } else { - $fulfilled = false; - $status = 'ERROR!'; - $help = 'You should enabled DOM extension'; + foreach ($this->functionExists as $functionRequired) { + $label = ''.$functionRequired.''; + + if (function_exists($functionRequired)) { + $status = 'OK!'; + $help = ''; + } else { + $fulfilled = false; + $status = 'ERROR!'; + $help = 'You need the '.$functionRequired.' function activated'; + } + + $rows[] = array($label, $status, $help); } - $rows[] = array($label, $status, $help); $table = new Table($this->defaultOutput); $table @@ -180,7 +193,7 @@ class InstallCommand extends ContainerAwareCommand $this->defaultOutput->writeln('Step 3 of 4. Administration setup.'); $questionHelper = $this->getHelperSet()->get('question'); - $question = new ConfirmationQuestion('Would you like to create a new user ? (y/N)', false); + $question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (Y/n)', true); if (!$questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) { return $this; @@ -201,6 +214,7 @@ class InstallCommand extends ContainerAwareCommand $user->setEmail($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)); $user->setEnabled(true); + $user->addRole('ROLE_SUPER_ADMIN'); $em->persist($user); @@ -208,6 +222,7 @@ class InstallCommand extends ContainerAwareCommand $config->setTheme($this->getContainer()->getParameter('wallabag_core.theme')); $config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page')); $config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit')); + $config->setReadingSpeed($this->getContainer()->getParameter('wallabag_core.reading_speed')); $config->setLanguage($this->getContainer()->getParameter('wallabag_core.language')); $em->persist($config); @@ -311,6 +326,31 @@ class InstallCommand extends ContainerAwareCommand 'value' => 'http://v2.wallabag.org', 'section' => 'misc', ], + [ + 'name' => 'piwik_enabled', + 'value' => '0', + 'section' => 'analytics', + ], + [ + 'name' => 'piwik_host', + 'value' => 'http://v2.wallabag.org', + 'section' => 'analytics', + ], + [ + 'name' => 'piwik_site_id', + 'value' => '1', + 'section' => 'analytics', + ], + [ + 'name' => 'demo_mode_enabled', + 'value' => '0', + 'section' => 'misc', + ], + [ + 'name' => 'demo_mode_username', + 'value' => 'wallabag', + 'section' => 'misc', + ], ]; foreach ($settings as $setting) {