-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Removed duplicate ConfigProvider from config/config.php #166
base: 3.16.x
Are you sure you want to change the base?
Conversation
Signed-off-by: Florin Bidirean <[email protected]>
…config.php Signed-off-by: Florin Bidirean <[email protected]>
The duplication is still present because the component installer automatically installs and injects the helpers: Lines 36 to 45 in 490b657
See: https://docs.laminas.dev/laminas-component-installer/#marking-packages-to-auto-install |
Please remove the entry from |
@froschdesign, I see what you mean about the injections based on What I did to test:
This is my <?php
declare(strict_types=1);
use Laminas\ConfigAggregator\ArrayProvider;
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ConfigAggregator\PhpFileProvider;
// To enable or disable caching, set the `ConfigAggregator::ENABLE_CACHE` boolean in
// `config/autoload/local.php`.
$cacheConfig = [
'config_cache_path' => 'data/cache/config-cache.php',
];
$aggregator = new ConfigAggregator([
\Mezzio\Twig\ConfigProvider::class,
\Mezzio\Tooling\ConfigProvider::class,
\Mezzio\Router\FastRouteRouter\ConfigProvider::class,
\Laminas\HttpHandlerRunner\ConfigProvider::class,
// Include cache configuration
new ArrayProvider($cacheConfig),
\Mezzio\Helper\ConfigProvider::class,
\Mezzio\ConfigProvider::class,
\Mezzio\Router\ConfigProvider::class,
\Laminas\Diactoros\ConfigProvider::class,
// Swoole config to overwrite some services (if installed)
class_exists(\Mezzio\Swoole\ConfigProvider::class)
? \Mezzio\Swoole\ConfigProvider::class
: function (): array {
return [];
},
// Default App module config
App\ConfigProvider::class,
// Load application config in a pre-defined order in such a way that local settings
// overwrite global settings. (Loaded as first to last):
// - `global.php`
// - `*.global.php`
// - `local.php`
// - `*.local.php`
new PhpFileProvider(realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php'),
// Load development config if it exists
new PhpFileProvider(realpath(__DIR__) . '/development.config.php'),
], $cacheConfig['config_cache_path']);
return $aggregator->getMergedConfig(); |
@bidi47 In the meantime, I have also found the corresponding code location: https://github.com/laminas/laminas-component-installer/blob/5a2ebadbc6ecf81b38d84222170dbd773fc00d7f/src/Injector/AbstractInjector.php#L370-L379 |
Description
This PR fixes a bug in issue #162 by removing the duplicate ConfigProvider in config/config.php