forked from wallabag/wallabag
Cleanup
This commit is contained in:
@ -43,7 +43,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
$users = $this->getDoctrine()->getRepository(User::class)->findAll();
|
||||
$users = $this->getContainer()->get('doctrine')->getRepository(User::class)->findAll();
|
||||
|
||||
$output->writeln(sprintf('Generating hashed urls for "%d" users', \count($users)));
|
||||
|
||||
@ -60,7 +60,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
||||
private function generateHashedUrls(User $user)
|
||||
{
|
||||
$em = $this->getContainer()->get(EntityManagerInterface::class);
|
||||
$repo = $this->getDoctrine()->getRepository(Entry::class);
|
||||
$repo = $this->getContainer()->get('doctrine')->getRepository(Entry::class);
|
||||
|
||||
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
|
||||
|
||||
@ -89,7 +89,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
||||
*/
|
||||
private function getUser($username)
|
||||
{
|
||||
return $this->getDoctrine()->getRepository(User::class)->findOneByUserName($username);
|
||||
return $this->getContainer()->get('doctrine')->getRepository(User::class)->findOneByUserName($username);
|
||||
}
|
||||
|
||||
private function getDoctrine()
|
||||
|
||||
@ -20,6 +20,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
|
||||
use Wallabag\CoreBundle\Entity\InternalSetting;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class InstallCommand extends ContainerAwareCommand
|
||||
{
|
||||
@ -79,6 +80,8 @@ class InstallCommand extends ContainerAwareCommand
|
||||
|
||||
$this->io->success('wallabag has been successfully installed.');
|
||||
$this->io->success('You can now configure your web server, see https://doc.wallabag.org');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function checkRequirements()
|
||||
@ -261,6 +264,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
|
||||
$userManager = $this->getContainer()->get(UserManagerInterface::class);
|
||||
$user = $userManager->createUser();
|
||||
\assert($user instanceof User);
|
||||
|
||||
$user->setUsername($this->io->ask('Username', 'wallabag'));
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ class TagAllCommand extends ContainerAwareCommand
|
||||
|
||||
$io->text('Persist ' . \count($entries) . ' entries... ');
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->getContainer()->get('doctrine')->getManager();
|
||||
foreach ($entries as $entry) {
|
||||
$em->persist($entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user