server/app/Listener/AppBootListener.php

23 lines
497 B
PHP

<?php
namespace App\Listener;
use App\Utils\AppInfoHelper;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Framework\Event\BootApplication;
#[Listener]
class AppBootListener implements ListenerInterface
{
public function listen(): array
{
return [BootApplication::class];
}
public function process(object $event): void
{
// 在框架启动时初始化启动时间
AppInfoHelper::initStartTime();
}
}