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;
+use Wallabag\UserBundle\Entity\User;
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('<info>Success! Your system can run Wallabag properly.</info>');
}
+ $this->defaultOutput->writeln('<info>Success! Your system can run Wallabag properly.</info>');
+
$this->defaultOutput->writeln('');
return $this;
// 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;
}
->runCommand('cache:clear')
;
+ $this->defaultOutput->writeln('');
+
return $this;
}
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;
}