* Adjust web root set for platform.

This commit is contained in:
caoyanyi
2024-01-10 09:55:50 +08:00
parent 66a6f3ec82
commit e1fa74ba2a
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -202,6 +202,7 @@ if(file_exists($cacheConfig)) include $cacheConfig;
/* 读取环境变量的配置。 Read the env config. */
if($config->inContainer || $config->inQuickon)
{
$webRoot = getenv('ZT_WEB_ROOT') ? trim($webRoot, '/') : '';
$config->installed = (bool)getenv('ZT_INSTALLED');
$config->debug = (int)getenv('ZT_DEBUG');
$config->requestType = getenv('ZT_REQUEST_TYPE');
@@ -214,7 +215,7 @@ if($config->inContainer || $config->inQuickon)
$config->db->encoding = getenv('ZT_DB_ENCODING');
$config->db->password = getenv('ZT_DB_PASSWORD');
$config->db->prefix = getenv('ZT_DB_PREFIX');
$config->webRoot = getenv('ZT_WEB_ROOT');
$config->webRoot = $webRoot ? "/{$webRoot}/" : '/';
$config->default->lang = getenv('ZT_DEFAULT_LANG');
}
+1 -1
View File
@@ -1161,7 +1161,7 @@ function isLocalIP()
*/
function getWebRoot($full = false)
{
if(getenv('APP_WEB_ROOT')) return '/' . trim(getenv('APP_WEB_ROOT'), '/') . '/';
if(getenv('ZT_WEB_ROOT')) return '/' . trim(getenv('ZT_WEB_ROOT'), '/') . '/';
$path = $_SERVER['SCRIPT_NAME'];