This adds custom command which executes the bin/console
or bin/phpunit
in the container without the need to SSH.
-
Copy the web directory into your project
.ddev/commands/web
, so that the console and the phpunit commands would be in.ddev/commands/web
folder. -
If the Symfony project is in a subfolder, add to
.ddev/ddev.config.yaml
:working_dir: web: /var/www/html/<symfony-project-subfolder>
Running ddev console
or ddev phpunit
is now equivalent to running bin/console
or bin/phpunit
from inside the container. It is now possible to get debug information such as ddev console debug:router
, running a maker with ddev console make:entity
or running phpunit tests without the need to SSH into the container.
This is how
ddev console about
would look like:
Contributed by @alechko