Skip to content

Commit f0e866f

Browse files
authored
Merge pull request #5 from RiKap/patch-1
Engine: Make mandatory (Fix open_basedir restriction)
2 parents 7f94500 + 57c6673 commit f0e866f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Bridges/Nette/WebLoaderExtension.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,20 @@ private function setupTracyPanel()
8989

9090
private function setupWebLoader()
9191
{
92+
$arguments = [$this->config['outputDir']];
93+
94+
if ($this->config['documentRoot']) {
95+
$arguments[] = $this->config['documentRoot'];
96+
}
97+
9298
$webLoader = $this->builder->addDefinition($this->prefix(self::ENGINE_PREFIX))
9399
->setFactory(self::ENGINE_CLASSNAME)
94-
->setArguments([$this->config['outputDir']]);
100+
->setArguments($arguments);
95101

96102
if ($this->config['disableCache']) {
97103
$webLoader->addSetup('disableCache');
98104
}
99105

100-
if ($this->config['documentRoot']) {
101-
$webLoader->addSetup('setDocumentRoot', [$this->config['documentRoot']]);
102-
}
103-
104106
if ($this->config['filesCollections']) {
105107
$webLoader->addSetup('createFilesCollectionsFromArray', [$this->config['filesCollections']]);
106108
}

0 commit comments

Comments
 (0)