diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Command')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 808baaf6..85c4ee90 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -96,10 +96,10 @@ class InstallCommand extends ContainerAwareCommand | |||
96 | 96 | ||
97 | if (!$fulfilled) { | 97 | if (!$fulfilled) { |
98 | throw new \RuntimeException('Some system requirements are not fulfilled. Please check output messages and fix them.'); | 98 | throw new \RuntimeException('Some system requirements are not fulfilled. Please check output messages and fix them.'); |
99 | } else { | ||
100 | $this->defaultOutput->writeln('<info>Success! Your system can run Wallabag properly.</info>'); | ||
101 | } | 99 | } |
102 | 100 | ||
101 | $this->defaultOutput->writeln('<info>Success! Your system can run Wallabag properly.</info>'); | ||
102 | |||
103 | $this->defaultOutput->writeln(''); | 103 | $this->defaultOutput->writeln(''); |
104 | 104 | ||
105 | return $this; | 105 | return $this; |
@@ -111,14 +111,17 @@ class InstallCommand extends ContainerAwareCommand | |||
111 | 111 | ||
112 | // user want to reset everything? Don't care about what is already here | 112 | // user want to reset everything? Don't care about what is already here |
113 | if (true === $this->defaultInput->getOption('reset')) { | 113 | if (true === $this->defaultInput->getOption('reset')) { |
114 | $this->defaultOutput->writeln('Droping database, creating database and schema'); | 114 | $this->defaultOutput->writeln('Droping database, creating database and schema, clearing the cache'); |
115 | 115 | ||
116 | $this | 116 | $this |
117 | ->runCommand('doctrine:database:drop', array('--force' => true)) | 117 | ->runCommand('doctrine:database:drop', array('--force' => true)) |
118 | ->runCommand('doctrine:database:create') | 118 | ->runCommand('doctrine:database:create') |
119 | ->runCommand('doctrine:schema:create') | 119 | ->runCommand('doctrine:schema:create') |
120 | ->runCommand('cache:clear') | ||
120 | ; | 121 | ; |
121 | 122 | ||
123 | $this->defaultOutput->writeln(''); | ||
124 | |||
122 | return $this; | 125 | return $this; |
123 | } | 126 | } |
124 | 127 | ||
@@ -131,6 +134,8 @@ class InstallCommand extends ContainerAwareCommand | |||
131 | ->runCommand('cache:clear') | 134 | ->runCommand('cache:clear') |
132 | ; | 135 | ; |
133 | 136 | ||
137 | $this->defaultOutput->writeln(''); | ||
138 | |||
134 | return $this; | 139 | return $this; |
135 | } | 140 | } |
136 | 141 | ||
@@ -283,10 +288,16 @@ class InstallCommand extends ContainerAwareCommand | |||
283 | try { | 288 | try { |
284 | $schemaManager = $connection->getSchemaManager(); | 289 | $schemaManager = $connection->getSchemaManager(); |
285 | } catch (\Exception $exception) { | 290 | } catch (\Exception $exception) { |
291 | // mysql & sqlite | ||
286 | if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { | 292 | if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { |
287 | return false; | 293 | return false; |
288 | } | 294 | } |
289 | 295 | ||
296 | // pgsql | ||
297 | if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) { | ||
298 | return false; | ||
299 | } | ||
300 | |||
290 | throw $exception; | 301 | throw $exception; |
291 | } | 302 | } |
292 | 303 | ||