File tree Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 13
13
14
14
return [
15
15
// 是否启用 soar 评分
16
- 'enabled ' => (bool ) env ('SOAR_SCORE_ENABLED ' , config ('app.debug ' )),
16
+ 'enabled ' => (bool ) env ('SOAR_SCORE_ENABLED ' , config ('app.debug ' ) && ' local ' === config ( ' app.env ' ) ),
17
17
18
18
// soar 二进制文件
19
19
'binary ' => env ('SOAR_BINARY ' ),
20
20
21
21
// sudo 密码(在 unix 操作系统非 cli 环境中运行时需要设置)
22
22
'sudo_password ' => env ('SOAR_SUDO_PASSWORD ' ),
23
23
24
- // 排除 soar 评分的 sql
24
+ // 排除 soar 评分输出的命令、URL 路径、路由
25
25
'except ' => [
26
+ 'telescope:* ' ,
27
+ '*telescope* ' ,
28
+ ],
29
+
30
+ // 排除 soar 评分的 sql
31
+ 'except_queries ' => [
26
32
'^use \?$ ' ,
27
33
'^set.* ' ,
28
34
'^show.* ' ,
37
43
// 'create table*',
38
44
],
39
45
40
- // 排除 soar 评分输出的命令、URL 路径、路由
41
- 'exclusions ' => [
42
- 'telescope:* ' ,
43
- '*telescope* ' ,
44
- ],
45
-
46
46
// soar 评分输出器
47
47
'outputs ' => [
48
48
// Guanguans\LaravelSoar\Outputs\ClockworkOutput::class,
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ private function logQueries(): void
115
115
116
116
private function isExceptSql (string $ sql ): bool
117
117
{
118
- return Str::is (config ('soar.except ' , []), $ sql );
118
+ return Str::is (config ('soar.except_queries ' , []), $ sql );
119
119
}
120
120
121
121
/**
Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ class OutputManager extends Fluent implements OutputContract
28
28
{
29
29
public function shouldOutput (CommandFinished |Response $ outputter ): bool
30
30
{
31
- $ exclusions = config ('soar.exclusions ' , []);
31
+ $ except = config ('soar.except ' , []);
32
32
33
33
if ($ outputter instanceof CommandFinished) {
34
- return !Str::is ($ exclusions , $ outputter ->command );
34
+ return !Str::is ($ except , $ outputter ->command );
35
35
}
36
36
37
- return !Request::is ($ exclusions ) && !Request::routeIs ($ exclusions );
37
+ return !Request::is ($ except ) && !Request::routeIs ($ except );
38
38
}
39
39
40
40
public function output (Collection $ scores , CommandFinished |Response $ outputter ): mixed
Original file line number Diff line number Diff line change 34
34
});
35
35
36
36
it ('can not output soar scores ' , function (): void {
37
- config ()->set ('soar.exclusions ' , ['outputs ' ]);
37
+ config ()->set ('soar.except ' , ['outputs ' ]);
38
38
39
39
$ this ->artisan ('outputs ' )
40
40
->assertExitCode (Command::SUCCESS )
You can’t perform that action at this time.
0 commit comments