Skip to content

1.0.0

Choose a tag to compare

@Firehed Firehed released this 07 Mar 00:14
· 20 commits to main since this release
0b77cbf

This is the 1.0.0 release of the container library!

There are three behavioral changes that could be possible BC breaks from the 0.x line:

  • env() now sources from $_ENV before getenv(). Previously only getenv() was checked.
  • envvars are now read once when the container is initialized, where previously they were read on the fly. In the unlikely event you modify envvars after the container is initialized throughout the application lifecycle (this is a very bad idea), those updates will no longer be reflected in the container
  • ValueRetreivalException is now correctly spelled ValueRetrievalException (you should still only catch the PSR-11 ContainerExceptionInterface, though). If you were catching it anyway, you should a) just catch the PSR interface or b) update to the new name if you really have a good reason.

The first change is to increase compatibility with the default/recommended behavior of vlucas/dotenv, which will write into $_ENV but not call putenv(). Basically, there's no need to use unsafe mode to support this library (though you still can). Under the majority of deployments, this will be fully compatible. If you have variables_order set to a value that excludes E and S (this is rare) in php.ini, you may encounter unexpected behavior. See README for details.

If any code writes non-string values into $_ENV, reading it will cause an error. This is consistent with the previous getenv-backed environment reads, which could only be a string.

What's Changed

Full Changelog: 0.10.0...1.0.0