Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch development config to use ConfigAggregator #122

Open
wants to merge 3 commits into
base: 3.16.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
* Developers on your team will then automatically enable them by calling on
* `composer development-enable`.
*
* You may also create files matching the glob pattern `{,*.}{global,local}.dev.php`.
*/

declare(strict_types=1);
Expand Down
21 changes: 15 additions & 6 deletions config/development.config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,28 @@
* DO NOT MODIFY THIS FILE.
*
* Provide your own development-mode settings by editing the file
* `config/autoload/development.local.php.dist`.
* `config/autoload/global.dev.php.dist`.
*
* Because this file is aggregated last, it simply ensures:
* Because this file is aggregated last, it ensures:
*
* - ConfigProviders for `--dev` dependencies are loaded when in development mode
* - Development-only overrides are applied
* - The `debug` flag is _enabled_.
* - Configuration caching is _disabled_.
*/

declare(strict_types=1);

use Laminas\ConfigAggregator\ArrayProvider;
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ConfigAggregator\PhpFileProvider;

return [
'debug' => true,
ConfigAggregator::ENABLE_CACHE => false,
];
$aggregator = new ConfigAggregator([
new PhpFileProvider(realpath(__DIR__) . '/autoload/{,*.}{global,local}.dev.php'),
new ArrayProvider([
'debug' => true,
ConfigAggregator::ENABLE_CACHE => false,
]),
]);

return $aggregator->getMergedConfig();
6 changes: 3 additions & 3 deletions src/MezzioInstaller/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@
'filp/whoops',
],
'flat' => [
'Resources/config/error-handler-whoops.php' => 'config/autoload/development.local.php.dist',
'Resources/config/error-handler-whoops.php' => 'config/autoload/global.dev.php.dist',
],
'modular' => [
'Resources/config/error-handler-whoops.php' => 'config/autoload/development.local.php.dist',
'Resources/config/error-handler-whoops.php' => 'config/autoload/global.dev.php.dist',
],
'minimal' => [
'Resources/config/error-handler-whoops.php' => 'config/autoload/development.local.php.dist',
'Resources/config/error-handler-whoops.php' => 'config/autoload/global.dev.php.dist',
],
],
],
Expand Down
2 changes: 1 addition & 1 deletion test/MezzioInstallerTest/ProjectSandboxTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function enableDevelopmentMode(): void
Assert::assertFileExists($target);

$target = sprintf(
'%s%sconfig%sautoload%sdevelopment.local.php',
'%s%sconfig%sautoload%sglobal.dev.php',
$this->projectRoot,
DIRECTORY_SEPARATOR,
DIRECTORY_SEPARATOR,
Expand Down
Loading