Skip to content

Commit

Permalink
PhpExtension: supports dynamic parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 14, 2022
1 parent 7b71edb commit 1a7965b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Bootstrap/Extensions/PhpExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Nette\Bootstrap\Extensions;

use Nette;
use Nette\Schema\Expect;


/**
Expand All @@ -19,7 +20,7 @@ final class PhpExtension extends Nette\DI\CompilerExtension
{
public function getConfigSchema(): Nette\Schema\Schema
{
return Nette\Schema\Expect::arrayOf('scalar');
return Expect::arrayOf(Expect::scalar()->dynamic());
}


Expand All @@ -42,7 +43,7 @@ public function loadConfiguration()
$this->initialization->addBody('date_default_timezone_set(?);', [$value]);

} elseif (function_exists('ini_set')) {
$this->initialization->addBody('ini_set(?, ?);', [$name, $value === false ? '0' : (string) $value]);
$this->initialization->addBody('ini_set(?, (string) (?));', [$name, $value]);

} elseif (ini_get($name) !== (string) $value) {
throw new Nette\NotSupportedException('Required function ini_set() is disabled.');
Expand Down

0 comments on commit 1a7965b

Please sign in to comment.