Skip to content

Commit 4eabc08

Browse files
committed
Update config.php
1 parent 875644a commit 4eabc08

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/config.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<?php
22

3-
$env = @file_get_contents('.env');
3+
$env = @file_get_contents(dirname(__FILE__) . '/../.env');
44
if ($env) {
55
foreach (explode("\n", $env) as $line) {
66
if (trim($line) == '' || str_starts_with($line, '#')) {
77
continue;
88
}
99
list($key, $value) = explode('=', $line, 2);
10+
$key = str_replace('export ', '', $key);
11+
$value = str_replace('"', '', str_replace("'", '', $value));
1012

11-
define(str_replace('export ', '', $key), str_replace('"', '', str_replace("'", '', $value)));
13+
define($key, $value);
14+
putenv("$key=$value");
1215
}
1316
} else {
1417
if (getenv('TRANSLOADIT_KEY') && getenv('TRANSLOADIT_SECRET')) {

0 commit comments

Comments
 (0)