wecodemore / wpstarter

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

When using with the DDev tool WP Starter v3 doesn't recognize `WP_HOME` as being set #135

Open timnolte opened 7 months ago

timnolte commented 7 months ago

https://github.com/wecodemore/wpstarter/blob/ad004f7693be9c3bf3b2fbc64a48b506ff33b4c7/templates/wp-config.php#L219-L230

This file: https://github.com/ddev/ddev/blob/master/pkg/ddevapp/wordpress/wp-config-ddev.php

is being included in the ENV_VARIABLES section as so:

        // Include for ddev-managed settings in wp-config-ddev.php.
        $ddev_settings = dirname( __FILE__ ) . '/wp-config-ddev.php';
        if ( is_readable( $ddev_settings ) && ! defined( 'DB_USER' ) ) {
            require_once $ddev_settings;
        }
gmazzap commented 7 months ago

@timnolte first basic question, have you verified that getenv('IS_DDEV_PROJECT') returns "true" when the faile is loaded?

timnolte commented 7 months ago

@gmazzap well, so here's the thing, if we manually setup on line 225:

$home .= $_SERVER['SERVER_NAME'] ?? '<PROJECT_ID>.ddev.site';

The site loads properly along with all of the database settings. It would seem to me then that URL_CONSTANTS is being loaded before ENV_VARIABLES.