This commit is contained in:
zimoyin
2026-04-09 13:55:39 +08:00
parent 13fd9c5f0a
commit 398e014128
12 changed files with 360 additions and 47 deletions
+8 -2
View File
@@ -19,6 +19,10 @@ class Config
get => $this->errorLogRotationTimeByDay;
}
public bool $consoleLog {
get => $this->consoleLog;
}
public DatabaseConfig $database {
get => $this->database;
}
@@ -52,14 +56,14 @@ class Config
/**
* TCP Server 进程数量
*/
public int $tcpServerProcessNum = 1 {
public int $tcpServerProcessNum {
get => $this->tcpServerProcessNum;
}
/**
* TCP_SERVER_PORT
*/
public int $tcpServerPort = 50000 {
public int $tcpServerPort {
get => $this->tcpServerPort;
}
@@ -97,6 +101,7 @@ class Config
$this->database = new DatabaseConfig();
$this->dbDebug = self::getBoolEnv('DB_DEBUG');
$this->logFilter = self::getStringArrayEnv('LOG_FILTER', []);
$this->consoleLog = self::getBoolEnv('CONSOLE_LOG', false);
$this->logLevel = match (strtoupper(self::getStringEnv('LOG_LEVEL', 'DEBUG'))) {
'INFO' => \Monolog\Logger::INFO,
'WARNING' => \Monolog\Logger::WARNING,
@@ -116,6 +121,7 @@ class Config
$this->zlm = new ZLMConfig();
$this->personDetectionCallback = null;
$this->enableRequestTimeLog = self::getBoolEnv('ENABLE_REQUEST_TIME_LOG', false);
$this->tcpServerProcessNum = self::getIntEnv('TCP_SERVER_PROCESS_NUM', 1);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && $this->tcpServerProcessNum > 1) {
$this->tcpServerProcessNum = 1;
echo "Warning: TCP_SERVER_PROCESS_NUM set to 1 on Windows.\n";