diff --git a/Connections/cmctrfdb.php b/Connections/cmctrfdb.php index 873481b..3e31836 100644 --- a/Connections/cmctrfdb.php +++ b/Connections/cmctrfdb.php @@ -3,17 +3,17 @@ # Type="MYSQL" # HTTP="true" -require_once __DIR__ . '/../../vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; if (!isset($_ENV['DB_HOST'])) { - $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../../'); + $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../'); $dotenv->safeLoad(); } -$hostname_cmctrfdb = $_ENV['DB_HOST']; -$database_cmctrfdb = $_ENV['DB_DATABASE']; -$username_cmctrfdb = $_ENV['DB_USERNAME']; -$password_cmctrfdb = $_ENV['DB_PASSWORD']; +$hostname_cmctrfdb = $_ENV['DB_HOST'] ?? 'localhost'; +$database_cmctrfdb = $_ENV['DB_DATABASE'] ?? ''; +$username_cmctrfdb = $_ENV['DB_USERNAME'] ?? ''; +$password_cmctrfdb = $_ENV['DB_PASSWORD'] ?? ''; $servername = $hostname_cmctrfdb; $username = $username_cmctrfdb;