Skip to content

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

@timnolte

Description

@timnolte

if (!defined('WP_HOME')) {
$port = is_numeric($_SERVER['SERVER_PORT'] ?? '') ? (int)$_SERVER['SERVER_PORT'] : 0;
$scheme = isset($_SERVER['HTTPS'])
? (filter_var($_SERVER['HTTPS'], FILTER_VALIDATE_BOOLEAN) ? 'https' : 'http')
: ($port === 443 ? 'https' : 'http');
$home = "{$scheme}://";
$home .= $_SERVER['SERVER_NAME'] ?? 'localhost';
$ports = ['https' => 443, 'http' => 80];
(($port > 0) && ($port !== $ports[$scheme])) and $home .= sprintf(':%d', $port);
define('WP_HOME', $home);
unset($port, $scheme, $home, $ports);
}

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;
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions