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:
2022-06-08 11:24:23 +09:00
parent bded6105ad
commit b73a24b447
1350 changed files with 140560 additions and 117 deletions

View File

@@ -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>";