Files
dsserver/app/config/ZLMConfig.php
T
zimoyin 4c841b9dbf init
2026-04-02 17:42:00 +08:00

59 lines
1.1 KiB
PHP

<?php
namespace app\config;
/**
* ZLMediaKit 配置类
*/
class ZLMConfig
{
/**
* ZLM服务器主机地址
*/
public string $host {
get => $this->host;
}
/**
* ZLM服务器端口
*/
public int $port {
get => $this->port;
}
/**
* 请求协议 (http/https)
*/
public string $schema {
get => $this->schema;
}
/**
* ZLM API密钥
*/
public string $secret {
get => $this->secret;
}
/**
* 完整地址 host:port
*/
public string $address {
get => "{$this->host}:{$this->port}";
}
/**
* API基础URL
*/
public string $apiBaseUrl {
get => "{$this->schema}://{$this->host}:{$this->port}";
}
public function __construct()
{
$this->host = Config::getStringEnv('ZLM_HOST', '127.0.0.1');
$this->port = Config::getIntEnv('ZLM_PORT', 80);
$this->schema = Config::getStringEnv('ZLM_SCHEMA', 'http');
$this->secret = Config::getStringEnv('ZLM_SECRET', '');
}
}