Jump to content

Using DDEV for local ProcessWire development (tips & tricks)


bernhard

Recommended Posts

I've created a custom alias:

Quote

alias ddc="limactl start && ddev config --php-version=8.3 --database=mariadb:10.6 --webserver-type=apache-fpm --timezone=Europe/Vienna --omit-containers=dba --web-environment='TRACY_LOCALROOTPATH=\$DDEV_APPROOT/'"

So all I have to do is type "ddc" and hit enter

  • Like 3
Link to comment
Share on other sites

On 8/13/2024 at 4:17 PM, bernhard said:

I've created a custom alias:

So all I have to do is type "ddc" and hit enter

Have you found a solution for specifying multiple "upload_dirs" inside this initial config call? It seems not to work here.

Link to comment
Share on other sites

Here you go:

alias ddc="limactl start && ddev config --php-version=8.3 --database=mariadb:10.6 --webserver-type=apache-fpm --timezone=Europe/Vienna --omit-containers=dba --web-environment='TRACY_LOCALROOTPATH=\$DDEV_APPROOT/' --upload-dirs='site/assets/files,foo/bar'"

Note that you need to reload your shell after updating your alias file!

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

I'm really enjoying DDEV and ProcessWire as I dive back into web development more seriously after many years. However, debugging has always been one of my weak areas, and I'm keen to get that sorted out.

So far, I've struggled to find a great tutorial on setting up DDEV with VS Code specifically for ProcessWire. Most of what I've come across are lengthy Drupal tutorials with Drupal-specific settings, which end up overwhelming me.

If there isn't a good resource out there, could you please share your setup procedure and the VS Code extensions, settings you've made in "settings.json" that you use with your DDEV ProcessWire environment? 

For example, I'd like to be able to open a file with a reported error from Tracy Debugger in VS Code, by clicking on it but of course:

but my current setup isn't allowing me to do that.

I'm also using RockFrontend—thank you @bernhard It's a pleasure to work with, especially when adapting static HTML templates. 

Thank you so much. 

  • Like 1
Link to comment
Share on other sites

I've done a video about DDEV, but it doesn't go through setting up ddev. Just follow the instructions on the ddev website.

 

6 minutes ago, Greg Lumley said:

For example, I'd like to be able to open a file with a reported error from Tracy Debugger in VS Code, by clicking on it but of course:

For this you need to tell tracy debugger where the files live on your local file system. This is because PW + Tracy run inside the container and inside the container your files live in /var/www/html. So if you click on a debugging link in tracy then your OS tries to find the file /var/www/html/foo.php and obviously can't find it.

// tracy config for ddev development
$config->tracy = [
  'outputMode' => 'development',
  'guestForceDevelopmentLocal' => true,
  'forceIsLocal' => true,
  'localRootPath' => '/path/to/your/project/',
  'numLogEntries' => 100, // for RockMigrations
  'editor' => 'cursor://file/%file:%line',
];

The important part for you is the "localRootPath" setting.

  • Like 2
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...