16 Commits

Author SHA1 Message Date
8d14445786 Moved to tabs for indent and add phpcs.xml file, update phpunit to 12 and update tests 2026-01-13 10:36:11 +09:00
b9feacaded Add Block settings to dotenv reader
Now blocks can be set as prefix names for variables via [Block Name] type
grouping.
2024-08-21 11:41:15 +09:00
e29f9fcd88 Add another psr-4 prefix, update composer packages
Previously it was just "gullevek\dotEnv" but now also "gullevek\dotenv"
will work.

Update phan/phpstan composer dev requirement verisons
2023-03-03 09:32:02 +09:00
c608201de1 Switch to standard PSR-12 with spaces instead of tab 2023-01-19 12:38:37 +09:00
8e062ff114 Add comment to unit test skip condition 2023-01-12 15:07:12 +09:00
225e3e7929 Unit test fixes with permissions
- in case the unit test is run as root, skip test for cannot read (0000)
- set read (0664) for all must read files
- write .env file int all folders for test so that __DIR__ base will
  always find one
2023-01-12 11:42:15 +09:00
8ae06efe4e Remove symlinked .env files 2023-01-11 16:48:28 +09:00
dd2274f3b1 Auto create .env files 2023-01-11 16:30:51 +09:00
0d3e10fe26 Ignore comments at the end of line
If the variable value had no quotes a comment at the end of the line was
added to the variable.
Spaces between text and comment mark will be removed too

Old:
FOO=Test # Comment -> $_ENV['FOO'] = "Test # Comment"

New:
FOO=Test # Comment -> $_ENV['FOO'] = "Test"
2022-06-09 09:17:21 +09:00
652c3554f8 Fix comment in phpunit test file 2022-06-08 15:31:48 +09:00
06479cadea phpunit test update, update all static testers, add psalm tester
Add Readme file update for install via composer

psalm static checker added
phan and phpstan update with ignoring vendor and test files as they are
not needed in final system
2022-06-08 13:34:48 +09:00
b73a24b447 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
2022-06-08 11:24:23 +09:00
6cc09fb089 Allow . in variables 2021-10-14 13:36:50 +09:00
75367b2724 Fix next line read with double quote blocks in one line
If there was this
FOO="bar"

Then the # comment block was attached to bar because FOO was seen as a
multiline block although the quotes are in one line only
2021-10-11 09:30:36 +09:00
c5c40a1780 Add example .env file and update readme 2021-10-11 09:10:52 +09:00
de80a9c061 Create dotenv readEnvFile single function 2021-10-11 08:58:36 +09:00