wecodemore / wpstarter

Easily bootstrap whole site Composer packages for WordPress.
https://wecodemore.github.io/wpstarter/
MIT License
244 stars 34 forks source link

composer wpstarter flush-env-cache not working #113

Closed tricarte closed 1 year ago

tricarte commented 2 years ago

As the title says, this command does not delete '.env.cached.php' file. It doesn't give any error or success message, just exits with exit code zero. At first I thought that it recompiles the '.env.cached.php' file. But I checked the source code and found out that it unlinks cached env file. But the file does not get deleted.

wpstarter version 3 beta 8 OS: Ubuntu 22.04 PHP: 7.4

Thanks in advance.

lkraav commented 1 year ago
$ [git:master+?{3}] composer wpstarter flush-env-cache -v
  - [WPDB Check] DB found and WordPress looks installed.
  - Initializing 'flush-env-cache' step.
  - Step 'flush-env-cache' skipped: not allowed

This is also confusing me - not allowed why?

gmazzap commented 1 year ago

This looks like a bug, indeed.

gmazzap commented 1 year ago

So, the bug was that the cache file was being looked for in the wrong path (depending on paths configuration).

The "Step 'flush-env-cache' skipped: not allowed" was because the file did nothing when the file was not found, and that was wrongly interpreted as the step being diallowed in connfiguration (skip-steps configuration).

474d82b should have fixed both. Can anyone confirm?

tricarte commented 1 year ago

Thanks for the fix. It works now.