Closed kynx closed 1 year ago
@kynx did you used this PR in a project to actually verify integrative functionality? I do not have time for it, but I am not 100% sure from reviewing the PR if the installer is actually asking for adding it either to the development
or production
configuration.
@boesing Yes I've verified it works. If you've got time, give this a try:
git clone git@github.com:kynx/component-installer-demo.git
cd component-installer-demo
composer install
That's a minimal version of mezzio skeleton with mezzio/mezzio-tooling
removed. Then:
composer require --dev mezzio/mezzio-tooling
<snip>
Please select which config file you wish to inject 'Mezzio\Tooling\ConfigProvider' into:
[0] Do not inject
[1] config/development.config.php.dist
[2] config/config.php
Make your selection (default is 1):1
Remember this option for other packages of the same type? (Y/n)
Installing Mezzio\Tooling\ConfigProvider from package mezzio/mezzio-tooling
Selecting 1 has added the ConfigProvider
to development.config.php.dist
:
git --no-pager diff config
diff --git a/config/development.config.php.dist b/config/development.config.php.dist
index e6a4249..9917504 100644
--- a/config/development.config.php.dist
+++ b/config/development.config.php.dist
@@ -30,6 +30,7 @@ use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ConfigAggregator\PhpFileProvider;
$aggregator = new ConfigAggregator([
+ \Mezzio\Tooling\ConfigProvider::class,
new PhpFileProvider(realpath(__DIR__) . '/autoload/{,*.}{global,local}-development.php'),
new ArrayProvider([
'debug' => true,
Note that this does require there to be a ConfigAggregator
in that file - as per https://github.com/mezzio/mezzio-skeleton/pull/122
LGTM, lets ship this. Thx, @kynx
Description
This PR adds support for injecting config providers into Mezzio's
config/development.config.php.dist
, following the recommendations from @boesing on https://github.com/mezzio/mezzio-tooling/issues/25. This is useful when adding--dev
tools that shouldn't be shipped in production.If merged a separate PR will be needed against the Mezzio skeleton so the development config looks something like:
Existing applications that do not have this development config will continue to inject only to the main
config/config.php
.