Archives : February-2020

I am trying to connect to postgresql database from a symfony 5 application, but I get the following error: You have requested a non-existent service “doctrine.orm.pgsql_entity_manager”. it is very strange. The dbal configuration is: doctrine: dbal: default_connection: mysql connections: mysql: url: ‘%env(DATABASE_URL_MYSQL)%’ driver: ‘pdo_mysql’ server_version: ‘5.7’ charset: utf8mb4 pgsql: url: ‘pgsql://userpost:[email protected]:5432/Taller’ driver: ‘pdo_pgsql’ server_version: ‘9.3’ ..

Read more

I’m using docker to run : Symfony image MariaDB image Here is my docker-compose.yaml file : version: ‘2’ services: myapp: image: ‘bitnami/symfony:1’ ports: – ‘8000:8000’ volumes: – ‘.:/app’ environment: – SYMFONY_PROJECT_NAME=backend – MARIADB_HOST=mariadb – MARIADB_PORT_NUMBER=3306 – MARIADB_USER=monty – MARIADB_PASSWORD=monty – MARIADB_DATABASE=test container_name: symfony_container depends_on: – mariadb mariadb: image: ‘bitnami/mariadb:10.3’ ports: – ‘3306:3306’ environment: – ALLOW_EMPTY_PASSWORD=yes ..

Read more

I have a Symfony test case where I test the authentication to the admin area of my website. Here is the test case (very simple, indeed) : public function setUp() { $this->client = static::createClient(); } /* … */ public function testAdminHomepageAllowsAdmins(): void { $this->logInAs(‘[email protected]’, [‘ROLE_SUPER_ADMIN’]); $this->client->request(‘GET’, ‘/admin’); self::assertResponseStatusCodeSame(Response::HTTP_OK); } private function logInAs(string $name = ‘[email protected]’, ..

Read more

Is it possible to return “null” value when passing an non existing “id” in my route ? /** * @Route(“/admin/product/edit/{id}”, name=”product_edit”, methods={“POST”}) * @ParamConverter( * name=”id”, * class=”AppEntityProduct”, * options={“mapping”: {“id”: “id”}} * ) * @param Product $product * @param Request $request * @return JsonResponse */ public function edit(Product $product = null, Request $request) { ..

Read more

I upgrade Symfony to the 5.0 version. When I run the server, all is right. However, when I use composer (example composer remove tattali/calendar-bundle), I get these errors : C:cmderroadtrip>composer remove tattali/calendar-bundle Dependency “symfony/framework-bundle” is also a root requirement, but is not explicitly whitelisted. Ignoring. Loading composer repositories with package information Updating dependencies (including require-dev) ..

Read more

I have set up a dev environment with Symfony and MariaDB through docker. I’ve taken the bitman/symfony image there : https://hub.docker.com/r/bitnami/symfony This is my docker-compose.yaml version: ‘2’ services: myapp: image: ‘bitnami/symfony:1’ ports: – ‘8000:8000’ volumes: – ‘.:/app’ environment: – SYMFONY_PROJECT_NAME=backend – MARIADB_PORT_NUMBER=3306 – MARIADB_USER=root container_name: symfony_container depends_on: – mariadb mariadb: image: ‘bitnami/mariadb:10.3’ ports: – ‘3306:3306’ ..

Read more