• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nette / bootstrap / 25406830765

05 May 2026 10:55PM UTC coverage: 90.541% (+0.3%) from 90.278%
25406830765

push

github

dg
default parameters (wwwDir, appDir, ...) are now overridable in user configs

Previously, parameters from getDefaultParameters() were injected into the
compiler AFTER all user configs, which silently overrode any redefinition
in common.neon. As a result, e.g. `wwwDir: %rootDir%/www` in a config had
no effect when the entry script lived outside %rootDir%/www (CLI scripts,
MCP servers, scheduled tasks).

Fix: snapshot defaults into $defaultParameters at construction. In
generateContainer(), inject defaults BEFORE user configs (overridable),
then inject array_diff_key($staticParameters, $defaultParameters) AFTER
configs as authoritative explicit overrides.

Bookkeeping: setters (setTempDirectory, setDebugMode) route through
addStaticParameters(), which removes the touched keys from $defaultParameters.
That preserves the rule "what user explicitly set wins over configs" even
when the explicit value coincidentally equals the auto-detected default.

The container cache key includes the explicit set so two configurators
with identical $staticParameters but different "user-touched" keys
compile to distinct containers.

10 of 10 new or added lines in 1 file covered. (100.0%)

12 existing lines in 2 files now uncovered.

134 of 148 relevant lines covered (90.54%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/Configurator.php
1
<?php declare(strict_types=1);
2

3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
namespace Nette;
9

10
if (false) {
1✔
11
        /** @deprecated use Nette\Bootstrap\Configurator */
UNCOV
12
        class Configurator extends Bootstrap\Configurator
×
13
        {
14
        }
15
} elseif (!class_exists(Configurator::class)) {
1✔
16
        class_alias(Bootstrap\Configurator::class, Configurator::class);
1✔
17
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc