X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FInstallCommand.php;h=c9dad0df71eff039030eb6aea08ac663ec1325f6;hb=5d6f6f56a2a0f72a67c2d3f96eb61986cf821a1e;hp=937926925efd23f422fc0d9effabac5a3642bc05;hpb=a74a6ca2b164447f2675a13840f862c2c4c672fd;p=github%2Fwallabag%2Fwallabag.git
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 93792692..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,28 +73,32 @@ class InstallCommand extends ContainerAwareCommand
$fulfilled = true;
- // @TODO: find a better way to check requirements
- $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
@@ -181,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;
@@ -202,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);
@@ -209,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);
@@ -312,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) {