-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEasySwooleEvent.php
48 lines (38 loc) · 1.29 KB
/
EasySwooleEvent.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Created by PhpStorm.
* User: yf
* Date: 2018/1/9
* Time: 下午1:04
*/
namespace EasySwoole;
use \EasySwoole\Core\AbstractInterface\EventInterface;
use \EasySwoole\Core\Swoole\ServerManager;
use \EasySwoole\Core\Swoole\EventRegister;
use \EasySwoole\Core\Http\Request;
use \EasySwoole\Core\Http\Response;
use duncan3dc\Laravel\BladeInstance;
use EasySwoole\Config;
Class EasySwooleEvent implements EventInterface {
// protected $engine;
public static function frameInitialize(): void
{
// TODO: Implement frameInitialize() method.
date_default_timezone_set('Asia/Tokyo');
// $tempPath = Config::getInstance()->getConf('TEMP_DIR'); # 临时文件目录
// $engine = new BladeInstance(EASYSWOOLE_ROOT . '/Views', "{$tempPath}/templates_c");
}
public static function mainServerCreate(ServerManager $server, EventRegister $register): void
{
// TODO: Implement mainServerCreate() method.
}
public static function onRequest(Request $request, Response $response): void
{
// TODO: Implement onRequest() method.
// $reponse->engine = EasySwooleEvent::engine;
}
public static function afterAction(Request $request, Response $response): void
{
// TODO: Implement afterAction() method.
}
}