diff --git a/Readme.md b/Readme.md index 3a72f9f..4adecc0 100644 --- a/Readme.md +++ b/Readme.md @@ -1,9 +1,12 @@ # dotenv: readEnvFile() -A single function implementation of https://github.com/vlucas/phpdotenv +A single function implementation of This is not a functional replacement, but a very simple implementation of the basic functions. +It is recommended to create a `.env.example` example file that is checked into the +repository. The `.env` should *NEVER* be checked into anything + ## How it works Put the function where it is needed or put it in a file and load it. diff --git a/test/.env.example b/test/.env.example new file mode 100644 index 0000000..95c9b02 --- /dev/null +++ b/test/.env.example @@ -0,0 +1,4 @@ +# example enviroment file +SOMETHING= +OTHER= +Complex= diff --git a/test/read_env_file.php b/test/read_env_file.php index 95232d8..d660978 100644 --- a/test/read_env_file.php +++ b/test/read_env_file.php @@ -9,7 +9,7 @@ print "ORIG:
" . file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '.env')
 
 $status = readEnvFile(__DIR__);
 
-print "STATUS: " . ($status ? 'OK' : 'FAIL') . "
"; +print "STATUS: " . (string)$status . "
"; print "ENV:
" . print_r($_ENV, true) . "

"; // __END__