Thanks to the BC compatibility, almost nothing have to be changed.
All changes are related to new bundle version of:
- SensioFrameworkExtraBundle
- DoctrineFixturesBundle
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(),
+ new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
// wallabag bundles
new Wallabag\CoreBundle\WallabagCoreBundle(),
new Wallabag\UserBundle\WallabagUserBundle(),
new Wallabag\ImportBundle\WallabagImportBundle(),
new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
- new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
# see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494
datetime:
default_format: "Y-m-d\\TH:i:sO" # ATOM
+
+# see https://github.com/symfony/symfony-standard/pull/1133
+sensio_framework_extra:
+ router:
+ annotations: false
imports:
- { resource: config_dev.yml }
- { resource: parameters_test.yml }
+ - { resource: services_test.yml }
framework:
test: ~
fos_oauth: true
stateless: true
anonymous: true
+ provider: fos_userbundle
login_firewall:
+ logout_on_user_change: true
pattern: ^/login$
anonymous: ~
secured_area:
+ logout_on_user_change: true
pattern: ^/
form_login:
provider: fos_userbundle
lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber
services:
- # used for tests
- filesystem_cache:
- class: Doctrine\Common\Cache\FilesystemCache
- arguments:
- - "%kernel.cache_dir%/doctrine/metadata"
-
twig.extension.text:
class: Twig_Extensions_Extension_Text
tags:
--- /dev/null
+services:
+ # see https://github.com/symfony/symfony/issues/24543
+ fos_user.user_manager.test:
+ alias: fos_user.user_manager
+ public: true
+
+ fos_user.security.login_manager.test:
+ alias: fos_user.security.login_manager
+ public: true
+
+ wallabag_core.entry_repository.test:
+ alias: wallabag_core.entry_repository
+ public: true
+
+ wallabag_user.user_repository.test:
+ alias: wallabag_user.user_repository
+ public: true
+
+ filesystem_cache:
+ class: Doctrine\Common\Cache\FilesystemCache
+ arguments:
+ - "%kernel.cache_dir%/doctrine/metadata"
+
+ # fixtures
+ Wallabag\AnnotationBundle\DataFixtures\ORM\:
+ resource: '../../src/Wallabag/AnnotationBundle/DataFixtures/ORM/*'
+ tags: ['doctrine.fixture.orm']
+ autowire: true
+
+ Wallabag\CoreBundle\DataFixtures\ORM\:
+ resource: '../../src/Wallabag/CoreBundle/DataFixtures/ORM/*'
+ tags: ['doctrine.fixture.orm']
+ autowire: true
+
+ Wallabag\UserBundle\DataFixtures\ORM\:
+ resource: '../../src/Wallabag/UserBundle/DataFixtures/ORM/*'
+ tags: ['doctrine.fixture.orm']
+ autowire: true
"ext-iconv": "*",
"ext-tokenizer": "*",
"ext-pdo": "*",
- "symfony/symfony": "~3.3.13",
+ "symfony/symfony": "3.4.*",
"doctrine/orm": "^2.5.12",
"doctrine/doctrine-bundle": "^1.8.0",
"doctrine/doctrine-cache-bundle": "^1.3.2",
"symfony/swiftmailer-bundle": "^2.6.7",
"symfony/monolog-bundle": "^3.1.2",
"sensio/distribution-bundle": "^5.0.21",
- "sensio/framework-extra-bundle": "^3.0.28",
+ "sensio/framework-extra-bundle": "^5.2.1",
"incenteev/composer-parameter-handler": "^2.1.2",
"nelmio/cors-bundle": "~1.5",
"friendsofsymfony/rest-bundle": "~2.1",
"predis/predis": "^1.1.1",
"javibravo/simpleue": "^2.0",
"symfony/dom-crawler": "^3.3.13",
- "friendsofsymfony/jsrouting-bundle": "^1.6.3",
+ "friendsofsymfony/jsrouting-bundle": "^2.2.1",
"bdunogier/guzzle-site-authenticator": "^1.0.0@dev",
"defuse/php-encryption": "^2.1",
"html2text/html2text": "^4.1"
},
"require-dev": {
- "doctrine/doctrine-fixtures-bundle": "~2.2",
- "doctrine/data-fixtures": "~1.1",
+ "doctrine/doctrine-fixtures-bundle": "~3.0",
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.3",
"friendsofphp/php-cs-fixer": "~2.0",
namespace Wallabag\ApiBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ApiBundle\Entity\Client;
use Wallabag\ApiBundle\Form\Type\ClientType;
namespace Wallabag\CoreBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\TaggingRule;
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
use Pagerfanta\Adapter\DoctrineORMAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
namespace Wallabag\CoreBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\CoreBundle\Entity\Entry;
/**
use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Pagerfanta\Pagerfanta;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\UserBundle\Entity\User;
namespace Wallabag\CoreBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\CoreBundle\Entity\SiteCredential;
use Wallabag\UserBundle\Entity\User;
/**
* Lists all User entities.
*
- * @Route("/", name="site_credentials_index")
- * @Method("GET")
+ * @Route("/", name="site_credentials_index", methods={"GET"})
*/
public function indexAction()
{
/**
* Creates a new site credential entity.
*
- * @Route("/new", name="site_credentials_new")
- * @Method({"GET", "POST"})
+ * @Route("/new", name="site_credentials_new", methods={"GET", "POST"})
*
* @param Request $request
*
/**
* Displays a form to edit an existing site credential entity.
*
- * @Route("/{id}/edit", name="site_credentials_edit")
- * @Method({"GET", "POST"})
+ * @Route("/{id}/edit", name="site_credentials_edit", methods={"GET", "POST"})
*
* @param Request $request
* @param SiteCredential $siteCredential
/**
* Deletes a site credential entity.
*
- * @Route("/{id}", name="site_credentials_delete")
- * @Method("DELETE")
+ * @Route("/{id}", name="site_credentials_delete", methods={"DELETE"})
*
* @param Request $request
* @param SiteCredential $siteCredential
namespace Wallabag\CoreBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\Routing\Annotation\Route;
class StaticController extends Controller
{
use Pagerfanta\Adapter\ArrayAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Form\Type\NewTagType;
wallabag_core.exception_controller:
class: Wallabag\CoreBundle\Controller\ExceptionController
+ public: true
arguments:
- '@twig'
- '%kernel.debug%'
arguments:
- "%wallabag_core.site_credentials.encryption_key_path%"
- "@logger"
+
+ wallabag_core.command.clean_duplicates:
+ class: Wallabag\CoreBundle\Command\CleanDuplicatesCommand
+ tags: ['console.command']
+
+ wallabag_core.command.export:
+ class: Wallabag\CoreBundle\Command\ExportCommand
+ tags: ['console.command']
+
+ wallabag_core.command.install:
+ class: Wallabag\CoreBundle\Command\InstallCommand
+ tags: ['console.command']
+
+ wallabag_core.command.list_user:
+ class: Wallabag\CoreBundle\Command\ListUserCommand
+ tags: ['console.command']
+
+ wallabag_core.command.reload_entry:
+ class: Wallabag\CoreBundle\Command\ReloadEntryCommand
+ tags: ['console.command']
+
+ wallabag_core.command.show_user:
+ class: Wallabag\CoreBundle\Command\ShowUserCommand
+ tags: ['console.command']
+
+ wallabag_core.command.tag_all:
+ class: Wallabag\CoreBundle\Command\TagAllCommand
+ tags: ['console.command']
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
abstract class BrowserController extends Controller
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
class ChromeController extends BrowserController
{
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
class FirefoxController extends BrowserController
{
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\Routing\Annotation\Route;
class ImportController extends Controller
{
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
class InstapaperController extends Controller
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
class PinboardController extends Controller
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class PocketController extends Controller
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
class ReadabilityController extends Controller
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
class WallabagV1Controller extends WallabagController
{
namespace Wallabag\ImportBundle\Controller;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
class WallabagV2Controller extends WallabagController
{
- [ setLogger, [ "@logger" ]]
tags:
- { name: wallabag_import.import, alias: chrome }
+
+ wallabag_import.command.import:
+ class: Wallabag\ImportBundle\Command\ImportCommand
+ tags: ['console.command']
+
+ wallabag_import.command.redis_worker:
+ class: Wallabag\ImportBundle\Command\RedisWorkerCommand
+ tags: ['console.command']
use Pagerfanta\Adapter\DoctrineORMAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Pagerfanta\Pagerfanta;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
use Wallabag\UserBundle\Entity\User;
use Wallabag\UserBundle\Form\SearchUserType;
/**
* Creates a new User entity.
*
- * @Route("/new", name="user_new")
- * @Method({"GET", "POST"})
+ * @Route("/new", name="user_new", methods={"GET", "POST"})
*/
public function newAction(Request $request)
{
/**
* Displays a form to edit an existing User entity.
*
- * @Route("/{id}/edit", name="user_edit")
- * @Method({"GET", "POST"})
+ * @Route("/{id}/edit", name="user_edit", methods={"GET", "POST"})
*/
public function editAction(Request $request, User $user)
{
/**
* Deletes a User entity.
*
- * @Route("/{id}", name="user_delete")
- * @Method("DELETE")
+ * @Route("/{id}", name="user_delete", methods={"DELETE"})
*/
public function deleteAction(Request $request, User $user)
{
$container = $client->getContainer();
/** @var $userManager \FOS\UserBundle\Doctrine\UserManager */
- $userManager = $container->get('fos_user.user_manager');
+ $userManager = $container->get('fos_user.user_manager.test');
/** @var $loginManager \FOS\UserBundle\Security\LoginManager */
- $loginManager = $container->get('fos_user.security.login_manager');
+ $loginManager = $container->get('fos_user.security.login_manager.test');
$firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(['username' => 'admin']);
{
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
- $userManager = $client->getContainer()->get('fos_user.user_manager');
+ $userManager = $client->getContainer()->get('fos_user.user_manager.test');
$user = $userManager->findUserBy(['username' => $username]);
$apiClient = new Client($user);
$apiClient->setName('My app');
$container = $client->getContainer();
/** @var $userManager \FOS\UserBundle\Doctrine\UserManager */
- $userManager = $container->get('fos_user.user_manager');
+ $userManager = $container->get('fos_user.user_manager.test');
/** @var $loginManager \FOS\UserBundle\Security\LoginManager */
- $loginManager = $container->get('fos_user.security.login_manager');
+ $loginManager = $container->get('fos_user.security.login_manager.test');
$firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(['username' => 'admin']);
{
parent::setUp();
- $userRepository = $this->getClient()->getContainer()->get('wallabag_user.user_repository');
+ $userRepository = $this->getClient()->getContainer()->get('wallabag_user.user_repository.test');
$user = $userRepository->findOneByUserName('admin');
$this->adminEntry = new Entry($user);
$reloadedEntries = $this->getClient()
->getContainer()
- ->get('wallabag_core.entry_repository')
+ ->get('wallabag_core.entry_repository.test')
->findById([$this->adminEntry->getId(), $this->bobEntry->getId()]);
foreach ($reloadedEntries as $reloadedEntry) {
'interactive' => false,
]);
- $entryRepository = $this->getClient()->getContainer()->get('wallabag_core.entry_repository');
+ $entryRepository = $this->getClient()->getContainer()->get('wallabag_core.entry_repository.test');
$reloadedAdminEntry = $entryRepository->find($this->adminEntry->getId());
$this->assertNotEmpty($reloadedAdminEntry->getContent());
$client->request('GET', '/share/' . $content->getId());
$this->assertSame(302, $client->getResponse()->getStatusCode());
- // follow link with uid
- $crawler = $client->followRedirect();
+ $shareUrl = $client->getResponse()->getTargetUrl();
+
+ // use a new client to have a fresh empty session (instead of a logged one from the previous client)
+ $client->restart();
+
+ $client->request('GET', $shareUrl);
+
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control'));
$this->assertContains('public', $client->getResponse()->headers->get('cache-control'));
$client->request('GET', '/share/' . $content->getUid());
$this->assertSame(404, $client->getResponse()->getStatusCode());
- $client->request('GET', '/view/' . $content->getId());
- $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control'));
-
// removing the share
$client->request('GET', '/share/delete/' . $content->getId());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$container = $this->client->getContainer();
$session = $container->get('session');
- $userManager = $container->get('fos_user.user_manager');
- $loginManager = $container->get('fos_user.security.login_manager');
+ $userManager = $container->get('fos_user.user_manager.test');
+ $loginManager = $container->get('fos_user.security.login_manager.test');
$firewallName = $container->getParameter('fos_user.firewall_name');
$user = $userManager->findUserBy(['username' => $username]);