server/.config/env.php
Ipstenu (Mika Epstein) f26a36a764
Refactor Redis configuration in environment and object cache files (#98)
Signed-off-by: Mika Epstein <ipstenu@halfelf.org>
Signed-off-by: Mika Ipstenu Epstein <ipstenu@halfelf.org>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ipstenu (Mika Epstein) <Ipstenu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-12 11:30:49 -08:00

30 lines
959 B
PHP

<?php
/**
* Connect environment variables to WP constants.
*/
defined( 'DB_HOST' ) or define( 'DB_HOST', getenv( 'DB_HOST' ) );
defined( 'DB_USER' ) or define( 'DB_USER', getenv( 'DB_USER' ) );
defined( 'DB_PASSWORD' ) or define( 'DB_PASSWORD', getenv( 'DB_PASSWORD' ) );
defined( 'DB_NAME' ) or define( 'DB_NAME', getenv( 'DB_NAME' ) );
define( 'ELASTICSEARCH_HOST', getenv( 'ELASTICSEARCH_HOST' ) );
define( 'ELASTICSEARCH_PORT', getenv( 'ELASTICSEARCH_PORT' ) );
if ( ! defined( 'AWS_XRAY_DAEMON_IP_ADDRESS' ) ) {
define( 'AWS_XRAY_DAEMON_IP_ADDRESS', gethostbyname( getenv( 'AWS_XRAY_DAEMON_HOST' ) ) );
}
define( 'REDIS_HOST', getenv( 'REDIS_HOST' ) );
define( 'REDIS_PORT', getenv( 'REDIS_PORT' ) ?: 6379 );
define( 'REDIS_SECURE', false );
define( 'REDIS_AUTH', '' );
define( 'WP_REDIS_BACKEND_HOST', REDIS_HOST );
define( 'WP_REDIS_PORT', REDIS_PORT );
global $redis_server;
$redis_server = [
'host' => REDIS_HOST,
'port' => REDIS_PORT,
];