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

nette / bootstrap / 3696249209

pending completion
3696249209

push

github

David Grudl
PhpExtension: supports dynamic parameters

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

124 of 143 relevant lines covered (86.71%)

0.87 hits per line

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

52.94
/src/Bootstrap/Extensions/PhpExtension.php
1
<?php
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
declare(strict_types=1);
9

10
namespace Nette\Bootstrap\Extensions;
11

12
use Nette;
13
use Nette\Schema\Expect;
14

15

16
/**
17
 * PHP directives definition.
18
 */
19
final class PhpExtension extends Nette\DI\CompilerExtension
20
{
21
        public function getConfigSchema(): Nette\Schema\Schema
22
        {
23
                return Expect::arrayOf(Expect::scalar()->dynamic());
1✔
24
        }
25

26

27
        public function loadConfiguration()
28
        {
29
                foreach ($this->getConfig() as $name => $value) {
1✔
30
                        if ($value === null) {
1✔
31
                                continue;
×
32

33
                        } elseif ($name === 'include_path') {
1✔
34
                                $this->initialization->addBody('set_include_path(?);', [str_replace(';', PATH_SEPARATOR, $value)]);
×
35

36
                        } elseif ($name === 'ignore_user_abort') {
1✔
37
                                $this->initialization->addBody('ignore_user_abort(?);', [$value]);
×
38

39
                        } elseif ($name === 'max_execution_time') {
1✔
40
                                $this->initialization->addBody('set_time_limit(?);', [$value]);
×
41

42
                        } elseif ($name === 'date.timezone') {
1✔
43
                                $this->initialization->addBody('date_default_timezone_set(?);', [$value]);
1✔
44

45
                        } elseif (function_exists('ini_set')) {
×
46
                                $this->initialization->addBody('ini_set(?, (string) (?));', [$name, $value]);
×
47

48
                        } elseif (ini_get($name) !== (string) $value) {
×
49
                                throw new Nette\NotSupportedException('Required function ini_set() is disabled.');
×
50
                        }
51
                }
52
        }
1✔
53
}
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