aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2019-05-10 22:07:55 +1000
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-05-24 15:17:46 +0200
commit4a5516376bf4c8b0cdc1e81d24ce1cca68425785 (patch)
treeccf3ced45a2841c5fdfe9010b40528bb365c32b2 /src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php
parentd5744bf0dfdbee4dbbe380d8a076d07b89fc76e6 (diff)
downloadwallabag-4a5516376bf4c8b0cdc1e81d24ce1cca68425785.tar.gz
wallabag-4a5516376bf4c8b0cdc1e81d24ce1cca68425785.tar.zst
wallabag-4a5516376bf4c8b0cdc1e81d24ce1cca68425785.zip
Add Wallabag\CoreBundle\Helper\UrlHasher
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php')
-rw-r--r--src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php
index 45bd8c5f..775b0413 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;
7use Symfony\Component\Console\Input\InputArgument; 7use Symfony\Component\Console\Input\InputArgument;
8use Symfony\Component\Console\Input\InputInterface; 8use Symfony\Component\Console\Input\InputInterface;
9use Symfony\Component\Console\Output\OutputInterface; 9use Symfony\Component\Console\Output\OutputInterface;
10use Wallabag\CoreBundle\Helper\UrlHasher;
10use Wallabag\UserBundle\Entity\User; 11use Wallabag\UserBundle\Entity\User;
11 12
12class GenerateUrlHashesCommand extends ContainerAwareCommand 13class GenerateUrlHashesCommand extends ContainerAwareCommand
@@ -65,7 +66,9 @@ 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(
70 UrlHasher::hashUrl($entry->getUrl())
71 );
69 $em->persist($entry); 72 $em->persist($entry);
70 73
71 if (0 === ($i % 20)) { 74 if (0 === ($i % 20)) {