symfony-3.4

Symfony Update 2.8 to 3.4

百般思念 提交于 2019-12-05 17:11:45
I wanted to upgrade my old Symfony project from 2.8 to 4.0 but I stacked at upgrade from 2.8 to 3.4. I used this tutorial for the upgrade Moving to Symfony 3.4 . I got some errors while trying to update through composer Composer Upgrade Errors : # php composer.phar update symfony/symfony --with-dependencies Dependency "symfony/polyfill-apcu" is also a root requirement, but is not explicitly whitelisted. Ignoring. Dependency "twig/twig" is also a root requirement, but is not explicitly whitelisted. Ignoring. Dependency "ircmaxell/password-compat" is also a root requirement, but is not

How to configure PhpStorm to use symfony/phpunit-bridge

旧时模样 提交于 2019-12-03 05:38:24
问题 I had problems with configuring PhpStorm IDE to use http://symfony.com/doc/current/components/phpunit_bridge.html while working with Symfony 3.3. I decided to just download phpunit.phar to bin and use it instead. Symfony 3.4 (and Symfony 4), does not even have phpunit.xml.dist out of the box, so there is a problem with using phpunit.phar easily. I've installed PHPUnit using flex: composer req phpunit That created phpunit.xml.dist and I was able to run tests from command line by: php bin

How to configure PhpStorm to use symfony/phpunit-bridge

南楼画角 提交于 2019-12-02 19:00:11
I had problems with configuring PhpStorm IDE to use http://symfony.com/doc/current/components/phpunit_bridge.html while working with Symfony 3.3. I decided to just download phpunit.phar to bin and use it instead. Symfony 3.4 (and Symfony 4), does not even have phpunit.xml.dist out of the box, so there is a problem with using phpunit.phar easily. I've installed PHPUnit using flex: composer req phpunit That created phpunit.xml.dist and I was able to run tests from command line by: php bin/phpunit But again I could not make PhpStorm use it. So I downloaded phpunit.phar and it can work together

Symfony 2.8 -> 3.4 Upgrade IsGranted('IS_AUTHENTICATED_ANONYMOUSLY') Throws Errors

不打扰是莪最后的温柔 提交于 2019-12-01 21:36:58
I'm in the process of upgrading Symfony from 2.8 to 3.4 and I have a Authentication Listener. The constructor of the listener public function __construct(EntityManager $entityManager, SessionInterface $session, Security $security, LoggerInterface $logger, Redis $redis, $secret) { $this->entityManager = $entityManager; $this->session = $session; $this->security = $security; $this->logger = $logger; $this->redis = $redis; $this->secret = $secret; } On Request Function which is calling in listener public function onRequest(GetResponseEvent $event) { //Validate token //Get Authorization Header

Symfony - inject doctrine repository in service

故事扮演 提交于 2019-12-01 03:26:48
according to How to inject a repository into a service in Symfony2? it's like acme.custom_repository: class: Doctrine\ORM\EntityRepository factory: ['@doctrine.orm.entity_manager', getRepository] arguments: - 'Acme\FileBundle\Model\File' but I get an Exception Invalid service "acme.custom_repository": class "EntityManager5aa02de170f88_546a8d27f194334ee012bfe64f629947b07e4919__CG__\Doctrine\ORM\EntityManager" does not exist. How can I do this in Symfony 3.4? update: EntityClass is actually a valid class FQCN (also used copy reference on phpstorm to be sure) , just renamed it because a companies

Symfony - inject doctrine repository in service

巧了我就是萌 提交于 2019-11-30 03:19:09
问题 according to How to inject a repository into a service in Symfony2? it's like acme.custom_repository: class: Doctrine\ORM\EntityRepository factory: ['@doctrine.orm.entity_manager', getRepository] arguments: - 'Acme\FileBundle\Model\File' but I get an Exception Invalid service "acme.custom_repository": class "EntityManager5aa02de170f88_546a8d27f194334ee012bfe64f629947b07e4919__CG__\Doctrine\ORM\EntityManager" does not exist. How can I do this in Symfony 3.4? update: EntityClass is actually a

Symfony 3.4.0 Could not find any fixture services to load

谁都会走 提交于 2019-11-29 03:04:18
I am using Symfony 3.4.0, I try to load fixtures with: php bin/console doctrine:fixtures:load An error occurred while creating the data, what's wrong? This command looks for all services tagged with doctrine.fixture.orm . There is two ways to fix this problem. First one: any class that implements ORMFixtureInterface will automatically be registered with this tag. <?php namespace AppBundle\DataFixtures\ORM; use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; class LoadFixtures implements ORMFixtureInterface { public function load(ObjectManager

Symfony 3.4.0 Could not find any fixture services to load

本小妞迷上赌 提交于 2019-11-27 17:20:34
问题 I am using Symfony 3.4.0, I try to load fixtures with: php bin/console doctrine:fixtures:load An error occurred while creating the data, what's wrong? 回答1: This command looks for all services tagged with doctrine.fixture.orm . There is two ways to fix this problem. First one: any class that implements ORMFixtureInterface will automatically be registered with this tag. <?php namespace AppBundle\DataFixtures\ORM; use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface; use Doctrine\Common

Symfony 3.4 Use view inside my bundle

孤者浪人 提交于 2019-11-26 19:08:43
I've some trouble for the configuration of a new repository using Symfony 3.4. I've used the symfony command for create him with last LTS (3.4) and I add a new Bundle using command too. My new Bundle is up and work well but I can't use view stored inside this bundle. I show you the structure of my Bundle : I want to use this index.html.twig in my controller like this : <?php namespace Lister\ListerBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; class DefaultController extends Controller { /** * @Route("

Symfony 3.4 Use view inside my bundle

ぃ、小莉子 提交于 2019-11-26 06:48:44
问题 I\'ve some trouble for the configuration of a new repository using Symfony 3.4. I\'ve used the symfony command for create him with last LTS (3.4) and I add a new Bundle using command too. My new Bundle is up and work well but I can\'t use view stored inside this bundle. I show you the structure of my Bundle : I want to use this index.html.twig in my controller like this : <?php namespace Lister\\ListerBundle\\Controller; use Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller; use Sensio