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

nette / bootstrap / 25403382146

05 May 2026 09:29PM UTC coverage: 90.476% (+0.8%) from 89.655%
25403382146

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 only the diff between $staticParameters and defaults AFTER
configs (authoritative — preserves back-compat for setTempDirectory(),
addStaticParameters() and similar setters).

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

12 existing lines in 3 files now uncovered.

133 of 147 relevant lines covered (90.48%)

0.9 hits per line

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

88.89
/src/Bootstrap/Extensions/PhpExtension.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\Bootstrap\Extensions;
9

10
use Nette;
11
use Nette\Schema\Expect;
12

13

14
/**
15
 * Sets PHP ini directives from configuration.
16
 */
17
final class PhpExtension extends Nette\DI\CompilerExtension
18
{
19
        public function getConfigSchema(): Nette\Schema\Schema
20
        {
21
                return Expect::arrayOf(
1✔
22
                        Expect::type('scalar|null')->dynamic(),
1✔
23
                        Expect::string(),
1✔
24
                );
25
        }
26

27

28
        public function loadConfiguration(): void
29
        {
30
                foreach ($this->getConfig() as $name => $value) {
1✔
31
                        if (!function_exists('ini_set')) {
1✔
UNCOV
32
                                throw new Nette\NotSupportedException('Required function ini_set() is disabled.');
×
33
                        }
34

35
                        if ($value !== null) {
1✔
36
                                $this->initialization->addBody('ini_set(?, (string) (?));', [$name, $value]);
1✔
37
                        }
38
                }
39
        }
1✔
40
}
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