make some slight modifications to support configuration via environment variables, e.g. when using Docker
This commit is contained in:
parent
62f717eda5
commit
0e59c0c8f5
@ -49,7 +49,18 @@ function mocha_get_oms() : Oms|null
|
||||
try
|
||||
{
|
||||
// $oms = new \Mocha\Oms\MySQLDatabaseOms(System::GetConfigurationValue("Database.ServerName"), System::GetConfigurationValue("Database.PortNumber"), System::GetConfigurationValue("Database.DatabaseName"), System::GetConfigurationValue("Database.UserName"), System::GetConfigurationValue("Database.Password"));
|
||||
$oms = new \Mocha\Oms\HttpOmsClient("localhost", 4436);
|
||||
$serverName = "localhost";
|
||||
if (isset($_ENV["OMS_SERVERNAME"]))
|
||||
{
|
||||
$serverName = $_ENV["OMS_SERVERNAME"];
|
||||
}
|
||||
$portNumber = 4436;
|
||||
if (isset($_ENV["OMS_SERVERPORT"]))
|
||||
{
|
||||
$portNumber = intval($_ENV["OMS_SERVERPORT"]);
|
||||
}
|
||||
|
||||
$oms = new \Mocha\Oms\HttpOmsClient($serverName, $portNumber);
|
||||
}
|
||||
catch (\PDOException $ex)
|
||||
{
|
||||
|
||||
@ -2061,11 +2061,35 @@ EOF
|
||||
echo($title);
|
||||
$this->renderEndTag("title");
|
||||
|
||||
$commonThemesPath = null;
|
||||
if (isset($_ENV["COMMON_THEMES_PATH"]))
|
||||
{
|
||||
$commonThemesPath = $_ENV["COMMON_THEMES_PATH"];
|
||||
}
|
||||
|
||||
if ($commonThemesPath != null)
|
||||
{
|
||||
|
||||
$this->renderTag("link", array
|
||||
(
|
||||
"rel" => "stylesheet",
|
||||
"type" => "text/css",
|
||||
"href" => System::ExpandRelativePath("~/themes/" . System::GetConfigurationValue("Application.ThemeName") . "/theme.css", false, true)
|
||||
"href" => $commonThemesPath
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
$themesPath = System::ExpandRelativePath("~/themes/" . System::GetConfigurationValue("Application.ThemeName") . "/theme.css", false, true);
|
||||
if (isset($_ENV["THEMES_PATH"]))
|
||||
{
|
||||
$themesPath = str_replace("{ThemeName}", System::GetConfigurationValue("Application.ThemeName"), $_ENV["THEMES_PATH"]);
|
||||
}
|
||||
|
||||
$this->renderTag("link", array
|
||||
(
|
||||
"rel" => "stylesheet",
|
||||
"type" => "text/css",
|
||||
"href" => $themesPath
|
||||
));
|
||||
|
||||
$this->renderTag("link", array
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user