diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php index 45bd8c5f..8f2bff11 100644 --- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php | |||
@@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |||
7 | use Symfony\Component\Console\Input\InputArgument; | 7 | use Symfony\Component\Console\Input\InputArgument; |
8 | use Symfony\Component\Console\Input\InputInterface; | 8 | use Symfony\Component\Console\Input\InputInterface; |
9 | use Symfony\Component\Console\Output\OutputInterface; | 9 | use Symfony\Component\Console\Output\OutputInterface; |
10 | use Wallabag\CoreBundle\Helper\UrlHasher; | ||
10 | use Wallabag\UserBundle\Entity\User; | 11 | use Wallabag\UserBundle\Entity\User; |
11 | 12 | ||
12 | class GenerateUrlHashesCommand extends ContainerAwareCommand | 13 | class GenerateUrlHashesCommand extends ContainerAwareCommand |
@@ -65,7 +66,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand | |||
65 | 66 | ||
66 | $i = 1; | 67 | $i = 1; |
67 | foreach ($entries as $entry) { | 68 | foreach ($entries as $entry) { |
68 | $entry->setHashedUrl(hash('sha1', $entry->getUrl())); | 69 | $entry->setHashedUrl(UrlHasher::hashUrl($entry->getUrl())); |
69 | $em->persist($entry); | 70 | $em->persist($entry); |
70 | 71 | ||
71 | if (0 === ($i % 20)) { | 72 | if (0 === ($i % 20)) { |
@@ -84,7 +85,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand | |||
84 | * | 85 | * |
85 | * @param string $username | 86 | * @param string $username |
86 | * | 87 | * |
87 | * @return \Wallabag\UserBundle\Entity\User | 88 | * @return User |
88 | */ | 89 | */ |
89 | private function getUser($username) | 90 | private function getUser($username) |
90 | { | 91 | { |