Skip to content

Commit 8ce1b45

Browse files
authored
优化代码 (#543)
* 简化框架配置 * 优化代码 * 优化测试
1 parent 90b1f28 commit 8ce1b45

File tree

3 files changed

+5
-39
lines changed

3 files changed

+5
-39
lines changed

Diff for: config/config.php

-31
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,8 @@
22

33
declare(strict_types=1);
44

5-
$imiPath = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR;
6-
75
return [
8-
'beanScan' => [
9-
'Imi\Config',
10-
'Imi\Bean',
11-
'Imi\Aop',
12-
'Imi\Async',
13-
'Imi\Annotation',
14-
'Imi\Cache',
15-
'Imi\Server',
16-
'Imi\Log',
17-
'Imi\Pool',
18-
'Imi\Db',
19-
'Imi\Redis',
20-
'Imi\Model',
21-
'Imi\Tool',
22-
'Imi\Cli',
23-
'Imi\Validate',
24-
'Imi\HttpValidate',
25-
'Imi\Enum',
26-
'Imi\Lock',
27-
'Imi\Facade',
28-
'Imi\Cron',
29-
'Imi\RequestContextProxy',
30-
'Imi\Process',
31-
],
326
'ignoreNamespace' => [
337
'Imi\Components\*',
348
],
35-
'ignorePaths' => [
36-
$imiPath . 'functions',
37-
$imiPath . 'Components' . \DIRECTORY_SEPARATOR . '*' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . '*/vendor',
38-
$imiPath . 'Cli' . \DIRECTORY_SEPARATOR . 'bootstrap',
39-
],
409
];

Diff for: src/Components/fpm/src/FpmApp.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ public function loadRuntime(): int
6666
if (!Imi::loadRuntimeInfo($fileName))
6767
{
6868
$fileName = Imi::getCurrentModeRuntimePath('imi-runtime');
69-
$isBuildRuntime = !Imi::loadRuntimeInfo($fileName, true);
70-
if ($isBuildRuntime)
69+
if (!Imi::loadRuntimeInfo($fileName, true))
7170
{
7271
// 扫描 imi 框架
7372
Scanner::scanImi(false);
7473
// 扫描组件
7574
Scanner::scanVendor(false);
76-
}
77-
if ($isBuildRuntime)
78-
{
75+
// 构建项目运行时缓存
7976
Imi::buildRuntime($fileName);
8077
}
8178
// 扫描项目

Diff for: src/Components/workerman-gateway/tests/unit/AppServer/bin/start-workerman.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ $__DIR__ = $(Split-Path -Parent $MyInvocation.MyCommand.Definition)
22

33
& $__DIR__\stop-workerman.ps1
44

5+
$procss = Start-Process -PassThru -FilePath "php" -ArgumentList "$__DIR__\workerman workerman/start --name websocket"
6+
$procss.Id | Out-File $__DIR__/websocket.pid
7+
58
$procss = Start-Process -PassThru -FilePath "php" -ArgumentList "$__DIR__\workerman workerman/start --name register"
69
$procss.Id | Out-File $__DIR__/register.pid
710

811
$procss = Start-Process -PassThru -FilePath "php" -ArgumentList "$__DIR__\workerman workerman/start --name gateway"
912
$procss.Id | Out-File $__DIR__/gateway.pid
1013

11-
$procss = Start-Process -PassThru -FilePath "php" -ArgumentList "$__DIR__\workerman workerman/start --name websocket"
12-
$procss.Id | Out-File $__DIR__/websocket.pid
13-
1414
$procss = Start-Process -PassThru -FilePath "php" -ArgumentList "$__DIR__\workerman workerman/start --name http"
1515
$procss.Id | Out-File $__DIR__/http.pid

0 commit comments

Comments
 (0)