Skip to content

Commit

Permalink
Switch development config to use ConfigAggregator
Browse files Browse the repository at this point in the history
Signed-off-by: matt <[email protected]>
  • Loading branch information
matt committed Mar 10, 2023
1 parent 4f60efe commit 4ce7bee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions config/autoload/development.local.php.dist
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}-development.php`.
*/

declare(strict_types=1);
Expand Down
20 changes: 15 additions & 5 deletions config/development.config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,27 @@
* Provide your own development-mode settings by editing the file
* `config/autoload/development.local.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\ConfigAggregator;
use Laminas\ConfigAggregator\PhpFileProvider;

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

return $aggregator->getMergedConfig();

0 comments on commit 4ce7bee

Please sign in to comment.