1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-22 17:18:37 +00:00

Merge remote-tracking branch 'origin/master' into 2.2

This commit is contained in:
Jeremy Benoist 2016-10-11 21:01:30 +02:00
commit e4cf672ccf
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
74 changed files with 1595 additions and 1519 deletions

View file

@ -9,7 +9,7 @@ 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\Output\NullOutput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
@ -97,7 +97,8 @@ class InstallCommand extends ContainerAwareCommand
try {
$this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
} catch (\Exception $e) {
if (false === strpos($e->getMessage(), 'Unknown database')) {
if (false === strpos($e->getMessage(), 'Unknown database')
&& false === strpos($e->getMessage(), 'database "'.$this->getContainer()->getParameter('database_name').'" does not exist')) {
$fulfilled = false;
$status = '<error>ERROR!</error>';
$help = 'Can\'t connect to the database: '.$e->getMessage();
@ -420,16 +421,18 @@ class InstallCommand extends ContainerAwareCommand
}
$this->getApplication()->setAutoExit(false);
$exitCode = $this->getApplication()->run(new ArrayInput($parameters), new NullOutput());
$output = new BufferedOutput();
$exitCode = $this->getApplication()->run(new ArrayInput($parameters), $output);
if (0 !== $exitCode) {
$this->getApplication()->setAutoExit(true);
$errorMessage = sprintf('The command "%s" terminated with an error code: %u.', $command, $exitCode);
$this->defaultOutput->writeln("<error>$errorMessage</error>");
$exception = new \Exception($errorMessage, $exitCode);
$this->defaultOutput->writeln('');
$this->defaultOutput->writeln('<error>The command "'.$command.'" generates some errors: </error>');
$this->defaultOutput->writeln($output->fetch());
throw $exception;
die();
}
// PDO does not always close the connection after Doctrine commands.

View file

@ -34,10 +34,13 @@ class TagAllCommand extends ContainerAwareCommand
}
$tagger = $this->getContainer()->get('wallabag_core.rule_based_tagger');
$output->write(sprintf('Tagging entries for user « <info>%s</info> »... ', $user->getUserName()));
$output->write(sprintf('Tagging entries for user « <comment>%s</comment> »... ', $user->getUserName()));
$entries = $tagger->tagAllForUser($user);
$output->writeln('<info>Done.</info>');
$output->write(sprintf('Persist entries ... ', $user->getUserName()));
$em = $this->getDoctrine()->getManager();
foreach ($entries as $entry) {
$em->persist($entry);