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:
parent
d5744bf0df
commit
4a5516376b
5 changed files with 79 additions and 21 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue