mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 09:11:11 +00:00
Applied PHP formatting rules
This commit is contained in:
@@ -4,18 +4,6 @@ namespace Grocy\Helpers;
|
||||
|
||||
class UrlManager
|
||||
{
|
||||
public function __construct(string $basePath)
|
||||
{
|
||||
if ($basePath === '/')
|
||||
{
|
||||
$this->BasePath = $this->GetBaseUrl();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->BasePath = $basePath;
|
||||
}
|
||||
}
|
||||
|
||||
protected $BasePath;
|
||||
|
||||
public function ConstructUrl($relativePath, $isResource = false)
|
||||
@@ -28,6 +16,20 @@ class UrlManager
|
||||
{
|
||||
return rtrim($this->BasePath, '/') . '/index.php' . $relativePath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function __construct(string $basePath)
|
||||
{
|
||||
if ($basePath === '/')
|
||||
{
|
||||
$this->BasePath = $this->GetBaseUrl();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->BasePath = $basePath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function GetBaseUrl()
|
||||
@@ -37,6 +39,7 @@ class UrlManager
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
}
|
||||
|
||||
return (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
|
||||
return (isset($_SERVER['HTTPS']) ? 'https' : 'http') . "://$_SERVER[HTTP_HOST]";
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user