symfony4

Can't install profiler symfony flex

ε祈祈猫儿з 提交于 2019-12-08 13:52:40
问题 I'm unable to use the symfony profiler after running composer req profiler I'm using symfony/skeleton in version 4.0 beta, but i remember having the same problem when i tested it a few months ago in 3.3. The toolbar isn't working, message here : An error occurred while loading the web debug toolbar. Open the web profiler. And when click on "open the web profiler", i have a 404 error. If someone resolved it, thank you for your help. If not, I'll report a bug while this is still in bêta. About

How to properly update Symfony3.3 to Symfony4.X?

ⅰ亾dé卋堺 提交于 2019-12-08 09:01:50
问题 Explanation: I'm unable to update symfony3 to symfony4, it throws a variety of different errors no matter what I try to do to fix them. What I've tried: I'm following the official documentation regarding major updates and I have ensured I have 0 deprecations. I've updated my composer.json as followed: { "...": "...", "require": { "symfony/symfony": "^4.0", }, "...": "..." } Errors: Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion: remove

pagination in symfony 4 using KnpPaginatorBundle

岁酱吖の 提交于 2019-12-08 08:32:44
问题 Attempted to load class " KnpPaginatorBundle " from namespace " App\Knp\Bundle\PaginatorBundle ". Did you forget a " use " statement for " Knp\Bundle\PaginatorBundle\KnpPaginatorBundle "? 回答1: Just add class namespace of KnpPaginatorBundle : in config/bundles.php : <?php return [ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], *************************************************************** **************

How to create custom function/formatter nelmio/alice v.3?

余生长醉 提交于 2019-12-08 02:37:48
问题 I'm new to symfony 4 and tried to write my own function for yml nelmio/alice, but after I ran bin/console doctrine:fixtures:load , I got this error: In DeepCopy.php line 177: The class "ReflectionClass" is not cloneable. Here is my fixtures.yml file: App\Entity\Post: post_{1..10}: title: <customFunction()> Here is my AppFixture.php file: <?php namespace App\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; use Nelmio\Alice\Loader

Docker with Symfony 4 - Unable to see the file changes

爱⌒轻易说出口 提交于 2019-12-07 18:08:31
问题 I'm working on a docker image for dev environment for a Symfony 4 application. I'm building it on alpine , php-fpm and nginx . I have configured an application, but the performance was not great (~700ms) even for the simple hello world application, so I thought I can make it faster somehow. First of all, I went for semantics configuration and configured the volumes to use cached configuration. Then, I moved vendor to separate volume as it caused the most of performance issues. As a second

How to get Doctrine handling ENUMs correctly?

折月煮酒 提交于 2019-12-07 14:18:13
问题 In an application I have a case of the Class Table Inheritance. The discriminator column is an ENUM : /** * Foo * * @ORM\Table(name="foos", ...) * @ORM\Entity * @ORM\InheritanceType("JOINED") * @ORM\DiscriminatorColumn(name="`type`", type="string", columnDefinition="ENUM('bar', 'buz')") * @ORM\DiscriminatorMap({ * "bar" = "Bar", * "buz" = "Buz" * }) */ abstract class Foo { ... } Doctrine works as expected (to begin with). The doctrine:migrations:diff command creates a migration for the tables

pagination in symfony 4 using KnpPaginatorBundle

余生颓废 提交于 2019-12-06 15:19:43
Attempted to load class " KnpPaginatorBundle " from namespace " App\Knp\Bundle\PaginatorBundle ". Did you forget a " use " statement for " Knp\Bundle\PaginatorBundle\KnpPaginatorBundle "? Just add class namespace of KnpPaginatorBundle : in config/bundles.php : <?php return [ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], *************************************************************** *************************************************************** Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => [

How to create custom function/formatter nelmio/alice v.3?

删除回忆录丶 提交于 2019-12-06 06:23:28
I'm new to symfony 4 and tried to write my own function for yml nelmio/alice, but after I ran bin/console doctrine:fixtures:load , I got this error: In DeepCopy.php line 177: The class "ReflectionClass" is not cloneable. Here is my fixtures.yml file: App\Entity\Post: post_{1..10}: title: <customFunction()> Here is my AppFixture.php file: <?php namespace App\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; use Nelmio\Alice\Loader\NativeLoader; class AppFixtures extends Fixture { public function load(ObjectManager $manager) { $loader = new

Symfony 4: Test DB for JWT and Behat

人盡茶涼 提交于 2019-12-06 04:48:43
问题 I am using API Platform 2.1 with Symfony 4 and I am using the LexikJWTAuthenticationBundle for authentication, and Behat for testing. I am unable to set things up properly. Here is my configuration so far: Feature: Books feature @createSchema @dropSchema Scenario: Adding a new book When I add "Content-Type" header equal to "application/json" And I add "Accept" header equal to "application/json" And I send a "POST" request to "/api/books" with body: """ { "title": "King", "author": "T. M.

Docker with Symfony 4 - Unable to see the file changes

别等时光非礼了梦想. 提交于 2019-12-06 03:51:25
I'm working on a docker image for dev environment for a Symfony 4 application. I'm building it on alpine , php-fpm and nginx . I have configured an application, but the performance was not great (~700ms) even for the simple hello world application, so I thought I can make it faster somehow. First of all, I went for semantics configuration and configured the volumes to use cached configuration. Then, I moved vendor to separate volume as it caused the most of performance issues. As a second thing I wanted to use docker-sync as the benchmarks looked amazing. I configured it and everything ran