All notable changes to this package will be documented in this file.
- Added
EnvFileWriterandEnv::write()for atomic.envupdates that preserve comments, ordering, and process environment values.
Env::getCast()for optional casting of common string values.
- Added coverage for
Env::getCast()casting behavior.
- Loader/Parser interfaces and default parser customization.
loadString,loadFiles,safeLoad*helpers with size limits and strict resolve mode.- Optional glob flags for
loadFilesand glob sorting for stable order. - Strict parsing options for
parse()/parseToArray()and BOM handling tests. $VARexpansion support and ASCII-only name mode inDefaultParser.
- Lines without
=are treated as empty strings. - Multi-line parsing detects whitespace around
=and throws on unterminated quotes. Envis a facade overEnvLoader/EnvParser, with injectable defaults.- README expanded with usage, exceptions, and new options.
- Strict resolve now reports unresolved variables in multi-file loads.
- Support for inline comments, escaped
#/=, andexport KEY=valuelines. - Support for escaped quotes and
\n,\r,\tinside quoted values. - Tests covering new parsing behavior and getenv precedence.
.envparsing now handles spaces around=and quoted values with trailing comments.- Loading respects variables already present in
getenv(). - README updated with parsing rules and examples.
- Removed global
env()helper from the package to keep framework-level responsibility incodemonster-ru/annabel. - The package now exposes only the static API through
Codemonster\Env\Env.
- Updated
README.mdto reflect the removal of the global helper. Examples now useEnv::get()instead ofenv().
- Updated all tests to use
Env::get()instead of the removed globalenv()helper.
- Verified autoload configuration in
composer.json(removed helper file registration). - No API-breaking changes; patch-level release only.
- Raised minimum PHP version to >= 8.2. No public API changes.
- Namespace changed from
CodemonstertoCodemonster\Env. - Added support for tests with single and double quotes (
'...'and"...") in.env.
Env::get($key, $default = null)method with type casting:true/(true)→truefalse/(false)→falsenull/(null)→nullempty/(empty)→""- Global helper
env($key, $default = null). - Support for quoted strings (
"...",'...'). - New tests (7 tests, 8 assertions) for all cases.
- Configuration file
phpunit.xml.dist. - The
CHANGELOG.mdfile. - The
README.mdfile with usage examples.
- The first stable version of the
codemonster-ru/envpackage. - The
Env::load($path)method for loading the.envfile into the environment.