This commit is contained in:
2021-04-27 15:57:50 +08:00
parent 4fbb525059
commit 0b2523ba9f
22 changed files with 73 additions and 287 deletions
+2 -2
View File
@@ -17,6 +17,7 @@ use Exception;
use ReflectionException;
use Snowflake\Abstracts\Config;
use Snowflake\Error\LoggerProcess;
use Snowflake\Event;
use Snowflake\Exception\ConfigException;
use Snowflake\Exception\NotFindClassException;
use Snowflake\Process\Biomonitoring;
@@ -300,9 +301,8 @@ class Server extends HttpService
if (!is_array($config['events'])) {
return;
}
$event = Snowflake::app()->getEvent();
foreach ($config['events'] as $name => $_event) {
$event->on('listen ' . $config['port'] . ' ' . $name, $_event);
Event::on('listen ' . $config['port'] . ' ' . $name, $_event);
}
}