parent
36d3c3e3d5
commit
0e64a8d573
|
@ -110,8 +110,9 @@ class ConfigCommand extends Command
|
|||
'The argument --root/--document-root expects a directory from which the webserver will serve files'
|
||||
));
|
||||
}
|
||||
$webserver->setWebPath($path);
|
||||
$webserver->setDocumentRoot($documentRoot);
|
||||
$webserver
|
||||
->setDocumentRoot($documentRoot)
|
||||
->setWebPath($path);
|
||||
$config = $webserver->generate() . "\n";
|
||||
if (($file = $this->params->get('file')) !== null) {
|
||||
if (file_exists($file) === true) {
|
||||
|
|
|
@ -75,17 +75,20 @@ abstract class Webserver
|
|||
abstract protected function getTemplate();
|
||||
|
||||
/**
|
||||
* Setter for web path
|
||||
* Set the URL path of Icinga Web 2
|
||||
*
|
||||
* @param string $webPath
|
||||
* @param string $urlPath
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWebPath($webPath)
|
||||
public function setWebPath($urlPath)
|
||||
{
|
||||
$this->webPath = $webPath;
|
||||
$this->webPath = '/' . ltrim(trim((string) $urlPath), '/');
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for web path
|
||||
* Get the URL path of Icinga Web 2
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
@ -103,7 +106,7 @@ abstract class Webserver
|
|||
*/
|
||||
public function setDocumentRoot($documentRoot)
|
||||
{
|
||||
$this->documentRoot = (string) $documentRoot;
|
||||
$this->documentRoot = trim((string) $documentRoot);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue