Skip to content

Releases: codemonster-ru/env

Release v2.3.0

02 Jan 19:21

Choose a tag to compare

Added

  • Env::getCast() for optional casting of common string values.

Tests

  • Added coverage for Env::getCast() casting behavior.

Release v2.2.0

28 Dec 08:54

Choose a tag to compare

Added

  • Loader/Parser interfaces and default parser customization.
  • loadString, loadFiles, safeLoad* helpers with size limits and strict resolve mode.
  • Optional glob flags for loadFiles and glob sorting for stable order.
  • Strict parsing options for parse()/parseToArray() and BOM handling tests.
  • $VAR expansion support and ASCII-only name mode in DefaultParser.

Changed

  • Lines without = are treated as empty strings.
  • Multi-line parsing detects whitespace around = and throws on unterminated quotes.
  • Env is a facade over EnvLoader/EnvParser, with injectable defaults.
  • README expanded with usage, exceptions, and new options.

Fixed

  • Strict resolve now reports unresolved variables in multi-file loads.

Release v2.1.0

20 Dec 17:05

Choose a tag to compare

Added

  • Support for inline comments, escaped #/=, and export KEY=value lines.
  • Support for escaped quotes and \n, \r, \t inside quoted values.
  • Tests covering new parsing behavior and getenv precedence.

Changed

  • .env parsing now handles spaces around = and quoted values with trailing comments.
  • Loading respects variables already present in getenv().
  • README updated with parsing rules and examples.

Release v2.0.1

05 Oct 11:17

Choose a tag to compare

Fixed

  • Removed global env() helper from the package to keep framework-level responsibility in codemonster-ru/annabel.
  • The package now exposes only the static API through Codemonster\Env\Env.

Docs

  • Updated README.md to reflect the removal of the global helper.
    Examples now use Env::get() instead of env().

Tests

  • Updated all tests to use Env::get() instead of the removed global env() helper.

Internal

  • Verified autoload configuration in composer.json (removed helper file registration).
  • No API-breaking changes; patch-level release only.

Release v2.0.0

28 Sep 06:51

Choose a tag to compare

Changed

  • Raised minimum PHP version to >= 8.2. No public API changes.

Release v1.1.1

23 Sep 17:28

Choose a tag to compare

Changed

  • Namespace changed from Codemonster to Codemonster\Env.
  • Added support for tests with single and double quotes ('...' and "...") in .env.

Release v1.1.0

23 Sep 16:59

Choose a tag to compare

Added

  • Env::get($key, $default = null) method with type casting:
  • true / (true)true
  • false / (false)false
  • null / (null)null
  • empty / (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.md file.
  • The README.md file with usage examples.

v1.0.0

14 Sep 12:01

Choose a tag to compare

Added

  • The first stable version of the codemonster-ru/env package.
  • The Env::load($path) method for loading the .env file into the environment.