themosis / framework

The Themosis framework core.

Home Page:https://framework.themosis.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't load database credentials when running php artisan config:cache

reneroboter opened this issue · comments

  • Themosis Version: master
  • WordPress Version: 5.8.1
  • PHP Version: 8.0.10

Description

WordPress uses constants to instantiate the WordPress database abstraction object (wpdb). Currently the constants where defined in the config/wordpress.php file. The Laravel deployment guide advice to run php artisan config:cache for optimising loading config files. However when your config files where cached (bootstrap/cache/config.php) Themosis will not call config/wordpress.php again and the required constants (DB_NAME etc ) e.g. for wpdb will not defined at runtime and your WordPress instance is crashing.

Steps to reproduce

  1. php artisan config:cache
  2. Call your local project

Expected behavior

@jlambe my exception is that I can run php artisan config:cache and my Themosis instance is working. I don't have a good solution, but I share some thoughts to this issue :)

  • I guess Themosis needs a deployment guide like in Laravel or Symfony.
  • Load config/wordpress.php when the Laravel/Themosis config where cached
  • Disable the php artisan config:cache

Hello @reneroboter, a recent patch has been added to the master branch that should fix this. Could you please update your project and let us know how it goes ?

@jlambe it works and can be closed now :)