<?php
$_SERVER["HTTP_HOST"] = $_SERVER["HTTP_HOST"] ?? explode(" ", shell_exec('hostname -I'))[0];
if (in_array($_SERVER["HTTP_HOST"], ["localhost", "127.0.0.1"]) || fnmatch("192.168.*.*", $_SERVER["HTTP_HOST"]) || fnmatch("172.16.16.*", $_SERVER["HTTP_HOST"])) :
    define('DB_HOST', '127.0.0.1');
    define('DB_USER', 'root');
    define('DB_PASSWORD', 'password');
    define('DB_NAME', '1134-vpn-blue');
    define('APP_ENVIRONMENT', 'local');
elseif (in_array($_SERVER["HTTP_HOST"], ["104.248.13.122", "web.theappauthors.com"])) :
    define('DB_HOST', 'localhost');
    define('DB_USER', 'root');
    define('DB_PASSWORD', 'upsquaredev');
    define('DB_NAME', '1134-vpn-blue');
    define('APP_ENVIRONMENT', 'stag');
else :
    define('DB_HOST', 'localhost');
    define('DB_USER', 'root');
    define('DB_PASSWORD', 'UWcC5wA3MwE4AIUs');
    define('DB_NAME', '1134-vpn-blue');
    define('APP_ENVIRONMENT', 'live');
endif;

define('STAG_DB_HOST', '104.248.13.122');
define('STAG_DB_USER', 'root');
define('STAG_DB_PASSWORD', 'upsquaredev');
define('STAG_DB_NAME', '1134-vpn-blue');
