1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-26 18:21:02 +00:00

Add Wallabag\CoreBundle\Helper\UrlHasher

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
Olivier Mehani 2019-05-10 22:07:55 +10:00 committed by Jeremy Benoist
parent d5744bf0df
commit 4a5516376b
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
5 changed files with 79 additions and 21 deletions

View file

@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Wallabag\CoreBundle\Helper\UrlHasher;
use Wallabag\UserBundle\Entity\User;
class GenerateUrlHashesCommand extends ContainerAwareCommand
@ -65,7 +66,9 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
$i = 1;
foreach ($entries as $entry) {
$entry->setHashedUrl(hash('sha1', $entry->getUrl()));
$entry->setHashedUrl(
UrlHasher::hashUrl($entry->getUrl())
);
$em->persist($entry);
if (0 === ($i % 20)) {