Create dotenv readEnvFile single function
This commit is contained in:
25
test/.env
Normal file
25
test/.env
Normal file
@@ -0,0 +1,25 @@
|
||||
# enviroment file
|
||||
SOMETHING=A
|
||||
OTHER="B IS B"
|
||||
Complex="A B \"D is F"
|
||||
HAS_SPACE= "ABC";
|
||||
FAILURE = ABC
|
||||
SIMPLEBOX= A B C
|
||||
TITLE=1
|
||||
FOO=1.2
|
||||
Test="A"
|
||||
TEST="B"
|
||||
TEST="D"
|
||||
LINE="ABC
|
||||
DEF"
|
||||
OTHERLINE="ABC
|
||||
AF\"ASFASDF
|
||||
MORESHIT"
|
||||
SUPERLINE=
|
||||
"asfasfasf"
|
||||
__FOO_BAR_1 = b
|
||||
__FOOFOO = f
|
||||
123123=number
|
||||
EMPTY=
|
||||
= flase
|
||||
asfasdf
|
||||
15
test/read_env_file.php
Normal file
15
test/read_env_file.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php // phpcs:ignore PSR1.Files.SideEffects
|
||||
|
||||
// test read .env file
|
||||
|
||||
require '../src/read_env_file.php';
|
||||
|
||||
print "BASE: " . __DIR__ . "<br>";
|
||||
print "ORIG: <pre>" . file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '.env') . "</pre>";
|
||||
|
||||
$status = readEnvFile(__DIR__);
|
||||
|
||||
print "STATUS: " . ($status ? 'OK' : 'FAIL') . "<br>";
|
||||
print "ENV: <pre>" . print_r($_ENV, true) . "</pre><br>";
|
||||
|
||||
// __END__
|
||||
Reference in New Issue
Block a user