From 2f75c405c743b1c447d553f1a0354533777ca1e2 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Tue, 20 Sep 2022 15:48:00 +0000 Subject: [PATCH] remove .env --- app/settings/.env | 1 - app/settings/GetEnv.php | 41 ----------------------------------------- 2 files changed, 42 deletions(-) delete mode 100644 app/settings/.env delete mode 100644 app/settings/GetEnv.php diff --git a/app/settings/.env b/app/settings/.env deleted file mode 100644 index 19eee41..0000000 --- a/app/settings/.env +++ /dev/null @@ -1 +0,0 @@ -TEST='This is a test string' \ No newline at end of file diff --git a/app/settings/GetEnv.php b/app/settings/GetEnv.php deleted file mode 100644 index 1254ced..0000000 --- a/app/settings/GetEnv.php +++ /dev/null @@ -1,41 +0,0 @@ -path = $path; - } - - public function load() :void - { - if (!is_readable($this->path)) { - throw new \RuntimeException(sprintf('%s file is not readable', $this->path)); - } - - $lines = file($this->path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - foreach ($lines as $line) { - - if (strpos(trim($line), '#') === 0) { - continue; - } - - list($name, $value) = explode('=', $line, 2); - $name = trim($name); - $value = trim($value); - - if (!array_key_exists($name, $_SERVER) && !array_key_exists($name, $_ENV)) { - putenv(sprintf('%s=%s', $name, $value)); - $_ENV[$name] = $value; - $_SERVER[$name] = $value; - } - } - } -} -