Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WebLoader/Nette/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function loadConfiguration()
foreach ($config[$type] as $name => $wlConfig) {
$wlConfig = Helpers::merge($wlConfig, $config[$type . 'Defaults']);
$this->addWebLoader($builder, $type . ucfirst($name), $wlConfig);
$loaderFactoryTempPaths[strtolower($name)] = $wlConfig['tempPath'];
$loaderFactoryTempPaths[$type][strtolower($name)] = $wlConfig['tempPath'];

if (!is_dir($wlConfig['tempDir']) || !is_writable($wlConfig['tempDir'])) {
throw new CompilationException(sprintf("You must create a writable directory '%s'", $wlConfig['tempDir']));
Expand Down
8 changes: 4 additions & 4 deletions WebLoader/Nette/LoaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function createCssLoader($name)
{
/** @var Compiler $compiler */
$compiler = $this->serviceLocator->getService($this->extensionName . '.css' . ucfirst($name) . 'Compiler');
return new CssLoader($compiler, $this->formatTempPath($name));
return new CssLoader($compiler, $this->formatTempPath('css', $name));
}

/**
Expand All @@ -54,17 +54,17 @@ public function createJavaScriptLoader($name)
{
/** @var Compiler $compiler */
$compiler = $this->serviceLocator->getService($this->extensionName . '.js' . ucfirst($name) . 'Compiler');
return new JavaScriptLoader($compiler, $this->formatTempPath($name));
return new JavaScriptLoader($compiler, $this->formatTempPath('js', $name));
}

/**
* @param string $name
* @return string
*/
private function formatTempPath($name)
private function formatTempPath($type, $name)
{
$lName = strtolower($name);
$tempPath = isset($this->tempPaths[$lName]) ? $this->tempPaths[$lName] : Extension::DEFAULT_TEMP_PATH;
$tempPath = isset($this->tempPaths[$type][$lName]) ? $this->tempPaths[$type][$lName] : Extension::DEFAULT_TEMP_PATH;
return rtrim($this->httpRequest->getUrl()->basePath, '/') . '/' . $tempPath;
}

Expand Down