Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d8594790
authored
Jan 03, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
订单
parent
e9812549
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
app/Providers/AppServiceProvider.php
app/Providers/AppServiceProvider.php
View file @
d8594790
...
...
@@ -16,33 +16,33 @@ class AppServiceProvider extends ServiceProvider
*/
public
function
boot
()
{
// 只在本地环境生效
if
(
$this
->
app
->
environment
(
'local'
))
{
// 自定义一个新的 Handler
\Symfony\Component\VarDumper\VarDumper
::
setHandler
(
function
(
$var
)
{
$cloner
=
new
VarCloner
();
$dumper
=
new
HtmlDumper
();
//
// 只在本地环境生效
//
if ($this->app->environment('local')) {
//
// 自定义一个新的 Handler
//
\Symfony\Component\VarDumper\VarDumper::setHandler(function ($var) {
//
$cloner = new VarCloner();
//
$dumper = new HtmlDumper();
// 关键:自定义白色背景的样式(覆盖默认黑色)
$dumper
->
setStyles
([
'default'
=>
'background-color:#fff; color:#222; line-height:1.5; font-weight: normal; font:12px Menlo, Monaco, Consolas, "Courier New", monospace; padding: 15px; border:1px solid #ddd; border-radius:4px; margin:10px 0;'
,
'num'
=>
'color:#a71d5d;'
,
'const'
=>
'color:#795da3;'
,
'str'
=>
'color:#df5000;'
,
'note'
=>
'color:#a71d5d;'
,
'ref'
=>
'color:#a0a0a0;'
,
'public'
=>
'color:#795da3;'
,
'protected'
=>
'color:#795da3;'
,
'private'
=>
'color:#795da3;'
,
'meta'
=>
'color:#b729d9;'
,
'key'
=>
'color:#df5000;'
,
'index'
=>
'color:#a71d5d;'
,
]);
//
// 关键:自定义白色背景的样式(覆盖默认黑色)
//
$dumper->setStyles([
//
'default' => 'background-color:#fff; color:#222; line-height:1.5; font-weight: normal; font:12px Menlo, Monaco, Consolas, "Courier New", monospace; padding: 15px; border:1px solid #ddd; border-radius:4px; margin:10px 0;',
//
'num' => 'color:#a71d5d;',
//
'const' => 'color:#795da3;',
//
'str' => 'color:#df5000;',
//
'note' => 'color:#a71d5d;',
//
'ref' => 'color:#a0a0a0;',
//
'public' => 'color:#795da3;',
//
'protected' => 'color:#795da3;',
//
'private' => 'color:#795da3;',
//
'meta' => 'color:#b729d9;',
//
'key' => 'color:#df5000;',
//
'index' => 'color:#a71d5d;',
//
]);
// 正确传参:先 cloner 克隆,再 dumper 输出
$dumper
->
dump
(
$cloner
->
cloneVar
(
$var
));
});
}
//
// 正确传参:先 cloner 克隆,再 dumper 输出
//
$dumper->dump($cloner->cloneVar($var));
//
});
//
}
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment