Merge branch 'master' of gitea.azcona-becker.net:mochapowered/mocha-php

This commit is contained in:
Michael Becker 2025-07-25 19:45:37 -04:00
commit 8fdb156420
2 changed files with 37 additions and 2 deletions

View File

@ -49,7 +49,18 @@ function mocha_get_oms() : Oms|null
try 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\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) catch (\PDOException $ex)
{ {

View File

@ -2061,11 +2061,35 @@ EOF
echo($title); echo($title);
$this->renderEndTag("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" => $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 $this->renderTag("link", array
( (
"rel" => "stylesheet", "rel" => "stylesheet",
"type" => "text/css", "type" => "text/css",
"href" => System::ExpandRelativePath("~/themes/" . System::GetConfigurationValue("Application.ThemeName") . "/theme.css", false, true) "href" => $themesPath
)); ));
$this->renderTag("link", array $this->renderTag("link", array