Class rename, composer add, phpUnit tests add
Rename the class from ReadEnvFile to DotEnv. Add everything to a composer json file so it can be published to composer repository. Add phpUnit tests for system
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
<?php // phpcs:ignore PSR1.Files.SideEffects
|
||||
<?php
|
||||
|
||||
// test read .env file
|
||||
|
||||
require '../src/read_env_file.php';
|
||||
// composer auto loader
|
||||
$loader = require '../vendor/autoload.php';
|
||||
// need to add this or it will not load here
|
||||
$loader->addPsr4('gullevek\\', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'src');
|
||||
use gullevek\dotEnv\DotEnv;
|
||||
|
||||
print "BASE: " . __DIR__ . "<br>";
|
||||
print "ORIG: <pre>" . file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '.env') . "</pre>";
|
||||
|
||||
$status = readEnvFile(__DIR__);
|
||||
$status = DotEnv::readEnvFile(__DIR__);
|
||||
|
||||
print "STATUS: " . (string)$status . "<br>";
|
||||
print "ENV: <pre>" . print_r($_ENV, true) . "</pre><br>";
|
||||
|
||||
Reference in New Issue
Block a user