mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-10 19:11:01 +00:00
commit
cdf458722d
6 changed files with 78 additions and 61 deletions
|
@ -78,7 +78,7 @@
|
|||
"guzzlehttp/guzzle": "^5.3.1",
|
||||
"doctrine/doctrine-migrations-bundle": "^1.3",
|
||||
"craue/config-bundle": "dev-utf8mb4",
|
||||
"mnapoli/piwik-twig-extension": "^1.0",
|
||||
"mnapoli/piwik-twig-extension": "^2.0",
|
||||
"ocramius/proxy-manager": "^2.1.1",
|
||||
"white-october/pagerfanta-bundle": "^1.1",
|
||||
"php-amqplib/rabbitmq-bundle": "^1.14",
|
||||
|
|
91
composer.lock
generated
91
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "7e872d70c69629db503d9b8ed18e0f40",
|
||||
"content-hash": "7b43c6d21bc5016660c4e95aa0fdbc12",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bdunogier/guzzle-site-authenticator",
|
||||
|
@ -3669,16 +3669,16 @@
|
|||
},
|
||||
{
|
||||
"name": "j0k3r/graby-site-config",
|
||||
"version": "1.0.84",
|
||||
"version": "1.0.85",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/j0k3r/graby-site-config.git",
|
||||
"reference": "37ae71639d3844d022ea402a1f87af7e28d12cac"
|
||||
"reference": "64e6092f583ecc55db0b9e8e33162a4fca2f6659"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/37ae71639d3844d022ea402a1f87af7e28d12cac",
|
||||
"reference": "37ae71639d3844d022ea402a1f87af7e28d12cac",
|
||||
"url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/64e6092f583ecc55db0b9e8e33162a4fca2f6659",
|
||||
"reference": "64e6092f583ecc55db0b9e8e33162a4fca2f6659",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3705,7 +3705,7 @@
|
|||
}
|
||||
],
|
||||
"description": "Graby site config files",
|
||||
"time": "2019-05-23T07:28:03+00:00"
|
||||
"time": "2019-06-07T20:24:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "j0k3r/httplug-ssrf-plugin",
|
||||
|
@ -4783,24 +4783,25 @@
|
|||
},
|
||||
{
|
||||
"name": "mnapoli/piwik-twig-extension",
|
||||
"version": "1.0.0",
|
||||
"version": "2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mnapoli/PiwikTwigExtension.git",
|
||||
"reference": "5171ab7221830a9d377add03dd60dbe6bd7b331f"
|
||||
"reference": "95cafbaca13e436b1939fe0e70079f6db893fd51"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mnapoli/PiwikTwigExtension/zipball/5171ab7221830a9d377add03dd60dbe6bd7b331f",
|
||||
"reference": "5171ab7221830a9d377add03dd60dbe6bd7b331f",
|
||||
"url": "https://api.github.com/repos/mnapoli/PiwikTwigExtension/zipball/95cafbaca13e436b1939fe0e70079f6db893fd51",
|
||||
"reference": "95cafbaca13e436b1939fe0e70079f6db893fd51",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4",
|
||||
"twig/twig": "~1.10"
|
||||
"php": ">=7.0",
|
||||
"twig/twig": "~2.10"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
"php-coveralls/php-coveralls": "^2.0",
|
||||
"symfony/phpunit-bridge": "^4.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
|
@ -4812,7 +4813,7 @@
|
|||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"time": "2014-09-16T06:51:19+00:00"
|
||||
"time": "2019-06-21T10:24:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
|
@ -7277,16 +7278,16 @@
|
|||
},
|
||||
{
|
||||
"name": "sentry/sentry",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/getsentry/sentry-php.git",
|
||||
"reference": "1f1704806820c16dcefcbf2e80b920024fda2234"
|
||||
"reference": "8e27e6c5fcf6f01fc2e5235dd14cc0b2b347d793"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/1f1704806820c16dcefcbf2e80b920024fda2234",
|
||||
"reference": "1f1704806820c16dcefcbf2e80b920024fda2234",
|
||||
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/8e27e6c5fcf6f01fc2e5235dd14cc0b2b347d793",
|
||||
"reference": "8e27e6c5fcf6f01fc2e5235dd14cc0b2b347d793",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -7352,7 +7353,7 @@
|
|||
"logging",
|
||||
"sentry"
|
||||
],
|
||||
"time": "2019-05-22T07:44:47+00:00"
|
||||
"time": "2019-06-13T11:27:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sentry/sentry-symfony",
|
||||
|
@ -7791,16 +7792,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/http-client-contracts",
|
||||
"version": "v1.1.3",
|
||||
"version": "v1.1.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-client-contracts.git",
|
||||
"reference": "05201f91d4f03c58f7324d019bdd791c8e8e418b"
|
||||
"reference": "e1924aea9c70ae3e69fff05afa3cb8ce541bf3bb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/05201f91d4f03c58f7324d019bdd791c8e8e418b",
|
||||
"reference": "05201f91d4f03c58f7324d019bdd791c8e8e418b",
|
||||
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/e1924aea9c70ae3e69fff05afa3cb8ce541bf3bb",
|
||||
"reference": "e1924aea9c70ae3e69fff05afa3cb8ce541bf3bb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -7844,7 +7845,7 @@
|
|||
"interoperability",
|
||||
"standards"
|
||||
],
|
||||
"time": "2019-06-05T13:28:50+00:00"
|
||||
"time": "2019-06-17T17:43:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/mime",
|
||||
|
@ -8069,7 +8070,7 @@
|
|||
},
|
||||
{
|
||||
"name": "Gert de Pagter",
|
||||
"email": "BackEndTea@gmail.com"
|
||||
"email": "backendtea@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for ctype functions",
|
||||
|
@ -8602,16 +8603,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/swiftmailer-bundle",
|
||||
"version": "v3.2.6",
|
||||
"version": "v3.2.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/swiftmailer-bundle.git",
|
||||
"reference": "7a83160b50a2479d37eb74ba71577380b9afe4f5"
|
||||
"reference": "cb125b3648f132fb8070b55393f20cb310907d3b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/7a83160b50a2479d37eb74ba71577380b9afe4f5",
|
||||
"reference": "7a83160b50a2479d37eb74ba71577380b9afe4f5",
|
||||
"url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/cb125b3648f132fb8070b55393f20cb310907d3b",
|
||||
"reference": "cb125b3648f132fb8070b55393f20cb310907d3b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -8621,6 +8622,9 @@
|
|||
"symfony/dependency-injection": "~2.7|~3.3|~4.0",
|
||||
"symfony/http-kernel": "~2.7|~3.3|~4.0"
|
||||
},
|
||||
"conflict": {
|
||||
"twig/twig": "<1.41|<2.10"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/console": "~2.7|~3.3|~4.0",
|
||||
"symfony/framework-bundle": "~2.7|~3.3|~4.0",
|
||||
|
@ -8660,7 +8664,7 @@
|
|||
],
|
||||
"description": "Symfony SwiftmailerBundle",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2019-04-18T15:52:54+00:00"
|
||||
"time": "2019-06-18T15:27:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/symfony",
|
||||
|
@ -8920,21 +8924,22 @@
|
|||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v1.42.2",
|
||||
"version": "v2.11.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "21707d6ebd05476854805e4f91b836531941bcd4"
|
||||
"reference": "699ed2342557c88789a15402de5eb834dedd6792"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/21707d6ebd05476854805e4f91b836531941bcd4",
|
||||
"reference": "21707d6ebd05476854805e4f91b836531941bcd4",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/699ed2342557c88789a15402de5eb834dedd6792",
|
||||
"reference": "699ed2342557c88789a15402de5eb834dedd6792",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4.0",
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
"php": "^7.0",
|
||||
"symfony/polyfill-ctype": "^1.8",
|
||||
"symfony/polyfill-mbstring": "^1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/container": "^1.0",
|
||||
|
@ -8944,7 +8949,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.42-dev"
|
||||
"dev-master": "2.11-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -8982,7 +8987,7 @@
|
|||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2019-06-18T15:35:16+00:00"
|
||||
"time": "2019-06-18T15:37:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "wallabag/php-mobi",
|
||||
|
@ -10654,16 +10659,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpstan/phpdoc-parser",
|
||||
"version": "0.3.4",
|
||||
"version": "0.3.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpdoc-parser.git",
|
||||
"reference": "ab518a5fc8f1d90f58bd2c5552ba915e2c477b66"
|
||||
"reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ab518a5fc8f1d90f58bd2c5552ba915e2c477b66",
|
||||
"reference": "ab518a5fc8f1d90f58bd2c5552ba915e2c477b66",
|
||||
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4",
|
||||
"reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -10697,7 +10702,7 @@
|
|||
"MIT"
|
||||
],
|
||||
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
||||
"time": "2019-05-28T11:40:00+00:00"
|
||||
"time": "2019-06-07T19:13:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
|
|
|
@ -176,7 +176,7 @@ class FeedController extends Controller
|
|||
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
|
||||
$entries = new Pagerfanta($pagerAdapter);
|
||||
|
||||
$perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.Feed_limit');
|
||||
$perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.feed_limit');
|
||||
$entries->setMaxPerPage($perPage);
|
||||
|
||||
$url = $this->generateUrl(
|
||||
|
|
|
@ -4,10 +4,14 @@ namespace Wallabag\CoreBundle\Twig;
|
|||
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\Extension\GlobalsInterface;
|
||||
use Twig\TwigFilter;
|
||||
use Twig\TwigFunction;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
|
||||
class WallabagExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
|
||||
class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
||||
{
|
||||
private $tokenStorage;
|
||||
private $entryRepository;
|
||||
|
@ -24,21 +28,26 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
|
|||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public function getGlobals()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']),
|
||||
new \Twig_SimpleFilter('removeScheme', [$this, 'removeScheme']),
|
||||
new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']),
|
||||
new TwigFilter('removeWww', [$this, 'removeWww']),
|
||||
new TwigFilter('removeScheme', [$this, 'removeScheme']),
|
||||
new TwigFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']),
|
||||
];
|
||||
}
|
||||
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new \Twig_SimpleFunction('count_entries', [$this, 'countEntries']),
|
||||
new \Twig_SimpleFunction('count_tags', [$this, 'countTags']),
|
||||
new \Twig_SimpleFunction('display_stats', [$this, 'displayStats']),
|
||||
new TwigFunction('count_entries', [$this, 'countEntries']),
|
||||
new TwigFunction('count_tags', [$this, 'countTags']),
|
||||
new TwigFunction('display_stats', [$this, 'displayStats']),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Wallabag\UserBundle\Mailer;
|
|||
|
||||
use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
|
||||
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
|
||||
use Twig\Environment;
|
||||
|
||||
/**
|
||||
* Custom mailer for TwoFactorBundle email.
|
||||
|
@ -21,7 +22,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
|
|||
/**
|
||||
* Twig to render the html's email.
|
||||
*
|
||||
* @var \Twig_Environment
|
||||
* @var Environment
|
||||
*/
|
||||
private $twig;
|
||||
|
||||
|
@ -57,13 +58,13 @@ class AuthCodeMailer implements AuthCodeMailerInterface
|
|||
* Initialize the auth code mailer with the SwiftMailer object.
|
||||
*
|
||||
* @param \Swift_Mailer $mailer
|
||||
* @param \Twig_Environment $twig
|
||||
* @param Environment $twig
|
||||
* @param string $senderEmail
|
||||
* @param string $senderName
|
||||
* @param string $supportUrl wallabag support url
|
||||
* @param string $wallabagUrl wallabag instance url
|
||||
*/
|
||||
public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl)
|
||||
public function __construct(\Swift_Mailer $mailer, Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
$this->twig = $twig;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
namespace Tests\Wallabag\UserBundle\Mailer;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Twig\Environment;
|
||||
use Twig\Loader\ArrayLoader;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Mailer\AuthCodeMailer;
|
||||
|
||||
|
@ -27,7 +29,7 @@ class AuthCodeMailerTest extends TestCase
|
|||
{% block body_text %}text body {{ support_url }}{% endblock %}
|
||||
TWIG;
|
||||
|
||||
$this->twig = new \Twig_Environment(new \Twig_Loader_Array(['WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate]));
|
||||
$this->twig = new Environment(new ArrayLoader(['WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate]));
|
||||
}
|
||||
|
||||
public function testSendEmail()
|
||||
|
|
Loading…
Reference in a new issue