mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 09:05:34 +08:00
update start settings.
This commit is contained in:
@@ -7,6 +7,9 @@ $config['host'] = '0.0.0.0';
|
|||||||
/** bind port */
|
/** bind port */
|
||||||
$config['port'] = 20001;
|
$config['port'] = 20001;
|
||||||
|
|
||||||
|
/** 框架开到公网或外部的HTTP访问链接,通过 DataProvider::getFrameworkLink() 获取 */
|
||||||
|
$config['http_reverse_link'] = "http://127.0.0.1:".$config['port'];
|
||||||
|
|
||||||
/** 存放框架内文件数据的目录 */
|
/** 存放框架内文件数据的目录 */
|
||||||
$config['zm_data'] = WORKING_DIR.'/zm_data/';
|
$config['zm_data'] = WORKING_DIR.'/zm_data/';
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use ZM\Utils\ZMUtil;
|
|||||||
class EventHandler
|
class EventHandler
|
||||||
{
|
{
|
||||||
public static function callSwooleEvent($event_name, $param0, $param1 = null) {
|
public static function callSwooleEvent($event_name, $param0, $param1 = null) {
|
||||||
|
//$starttime = microtime(true);
|
||||||
$event_name = strtolower($event_name);
|
$event_name = strtolower($event_name);
|
||||||
switch ($event_name) {
|
switch ($event_name) {
|
||||||
case "workerstart":
|
case "workerstart":
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ class DataProvider
|
|||||||
echo Console::setColor("saved", "lightblue").PHP_EOL;
|
echo Console::setColor("saved", "lightblue").PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getFrameworkLink(){
|
||||||
|
return ZMBuf::globals("http_reverse_link");
|
||||||
|
}
|
||||||
|
|
||||||
private static function getJsonData(string $string) {
|
private static function getJsonData(string $string) {
|
||||||
if(!file_exists(self::getDataFolder().$string)) return [];
|
if(!file_exists(self::getDataFolder().$string)) return [];
|
||||||
return json_decode(Co::readFile(self::getDataFolder().$string), true);
|
return json_decode(Co::readFile(self::getDataFolder().$string), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user