X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FInstallCommand.php;h=da099a19bb8e0a003b5c0fc99fb80d87c02b6b6c;hb=c7f622d3699b7f65ee75bcd5d409ad2027e9b6a4;hp=808baaf68ec7257270d620d1028cfa763ce59377;hpb=78507d28357b132237ad35ecdf0704d1ca56dfaa;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 808baaf6..da099a19 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -3,15 +3,14 @@ namespace Wallabag\CoreBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Question\Question; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Helper\Table; -use Wallabag\UserBundle\Entity\User; +use Symfony\Component\Console\Question\Question; use Wallabag\CoreBundle\Entity\Config; class InstallCommand extends ContainerAwareCommand @@ -56,7 +55,7 @@ class InstallCommand extends ContainerAwareCommand ; $output->writeln('Wallabag has been successfully installed.'); - $output->writeln('Just execute `php app/console server:run` for using wallabag: http://localhost:8000'); + $output->writeln('Just execute `php bin/console server:run` for using wallabag: http://localhost:8000'); } protected function checkRequirements() @@ -96,10 +95,10 @@ class InstallCommand extends ContainerAwareCommand if (!$fulfilled) { throw new \RuntimeException('Some system requirements are not fulfilled. Please check output messages and fix them.'); - } else { - $this->defaultOutput->writeln('Success! Your system can run Wallabag properly.'); } + $this->defaultOutput->writeln('Success! Your system can run Wallabag properly.'); + $this->defaultOutput->writeln(''); return $this; @@ -111,14 +110,17 @@ class InstallCommand extends ContainerAwareCommand // user want to reset everything? Don't care about what is already here if (true === $this->defaultInput->getOption('reset')) { - $this->defaultOutput->writeln('Droping database, creating database and schema'); + $this->defaultOutput->writeln('Droping database, creating database and schema, clearing the cache'); $this ->runCommand('doctrine:database:drop', array('--force' => true)) ->runCommand('doctrine:database:create') ->runCommand('doctrine:schema:create') + ->runCommand('cache:clear') ; + $this->defaultOutput->writeln(''); + return $this; } @@ -131,6 +133,8 @@ class InstallCommand extends ContainerAwareCommand ->runCommand('cache:clear') ; + $this->defaultOutput->writeln(''); + return $this; } @@ -283,10 +287,16 @@ class InstallCommand extends ContainerAwareCommand try { $schemaManager = $connection->getSchemaManager(); } catch (\Exception $exception) { + // mysql & sqlite if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { return false; } + // pgsql + if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) { + return false; + } + throw $exception; }