getMessage()); } //if site_host isnt a valid domain we're expecting, then set it to the default domain if(!in_array($site_host, array_map(function (string $url) { return parse_url($url, PHP_URL_HOST); }, $validURLs), true)) { //error_log("site_host is not an expected domain, setting to DOMAIN_CURRENT_HOST"); $site_host = parse_url(filter_var(getenv('DOMAIN_CURRENT_SITE'),FILTER_VALIDATE_URL),PHP_URL_HOST); } if(getenv('DB_HOST')){ // Avoid PHP notices on CLI requests. if (php_sapi_name() === 'cli') { session_save_path("/tmp"); } define( 'DB_NAME', getenv('DB_NAME')); define( 'DB_USER', getenv('DB_USER')); define( 'DB_PASSWORD', getenv('DB_PASSWORD')); define( 'DB_HOST', getenv('DB_HOST')); define( 'DB_CHARSET', 'utf8' ); define( 'DB_COLLATE', '' ); // Debug mode should be disabled on Platform.sh. Set this constant to true // in a wp-config-local.php file to skip this setting on local development. if (!defined( 'WP_DEBUG' )) { define( 'WP_DEBUG', false ); } // Set all of the necessary keys to unique values, based on the Platform.sh // entropy value. if (getenv('PLATFORM_PROJECT_ENTROPY')) { $keys = [ 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT', ]; $entropy = getenv('PLATFORM_PROJECT_ENTROPY'); foreach ($keys as $key) { if (!defined($key)) { define( $key, $entropy . $key ); } } } } } else { // Local configuration file should be in project root. if (file_exists(dirname(__FILE__, 2) . '/wp-config-local.php')) { include(dirname(__FILE__, 2) . '/wp-config-local.php'); } } // Do not put a slash "/" at the end. // https://codex.wordpress.org/Editing_wp-config.php#WP_HOME define( 'WP_HOME', $site_scheme . '://' . $site_host ); // Do not put a slash "/" at the end. // https://codex.wordpress.org/Editing_wp-config.php#WP_SITEURL define( 'WP_SITEURL', WP_HOME ); define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/wp-content' ); define( 'WP_CONTENT_URL', WP_HOME . '/wp-content' ); // Disable WordPress from running automatic updates define( 'WP_AUTO_UPDATE_CORE', false ); // Since you can have multiple installations in one database, you need a unique // prefix. $table_prefix = 'wp_'; /** Absolute path to the WordPress directory. */ if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __FILE__ ) . '/' ); } /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php');