Closed mcaskill closed 3 years ago
Thanks @mcaskill ! As always, much appreciated!
Let me take a deeper look and get back to you!
Hey @mcaskill can we limit this PR to just the changes in Installer.php
and composer.json
?
I'm looking to do a big refactor of this plugin in the coming months, which will implement an Abstract class, etc.
Sorry for the delay and thanks for the feedback.
Thanks @mcaskill really appreciate it as always 👍
Checklist:
Description
Adds support for Dotenv v5 while also keeping support for v4 and restoring support for v3.
This allows older projects that might be stuck on an older version of Dotenv to continue to benefit from updates to this Composer plugin.
How has this been tested?
I'm testing this on a client project that uses Advanced Custom Fields Pro, Gravity Forms, and Polylang Pro.
Types of changes
Added
Installer::loadDotenv()
to resolve and instantiate the currently available version of theDotenv
class.AbstractPlugin
as basis for all supported WP plugins. The class provides aget()
method which serves as a wrapper ofgetenv()
that will throw an exception if the requested environment variable is missing.MissingEnvException
in case an environment variable is missing.Changed
AbstractPlugin
and use itsget()
method instead of directly usinggetenv()
function.