Skip to content

Commit b62910c

Browse files
fmasaenumag
authored andcommitted
Absolute config paths (#7)
* Add support for absolute paths for config files * Add nette/utils as dependency * Mention absolute path usage in docs
1 parent aef3844 commit b62910c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"codeception/codeception": "^2.2.0",
1717
"nette/bootstrap": "^2.3.0",
1818
"nette/di": "^2.3.0",
19-
"nette/http": "^2.3.0"
19+
"nette/http": "^2.3.0",
20+
"nette/utils": "^2.3.0"
2021
},
2122
"require-dev": {
2223
"enumag/application": "^0.3.16",

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class MyServiceTest extends Unit
4545
}
4646
}
4747
```
48+
`useConfigFiles` method takes array of file paths that are either absolute or relative to suite root.
4849

4950
NetteApplicationModule
5051
----

src/Module/NetteDIModule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private function createContainer()
157157

158158
$configFiles = is_array($this->configFiles) ? $this->configFiles : $this->config['configFiles'];
159159
foreach ($configFiles as $file) {
160-
$configurator->addConfig($this->path.'/'.$file);
160+
$configurator->addConfig(FileSystem::isAbsolute($file) ? $file : $this->path.'/'.$file);
161161
}
162162

163163
$this->container = $configurator->createContainer();

0 commit comments

Comments
 (0)