定制 phuongdev89/yii2-debug 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phuongdev89/yii2-debug

Composer 安装命令:

composer require phuongdev89/yii2-debug

包简介

Yii2 Debug

关键字:

README 文档

README

Dependent

Must have phpstorm-protocol before

Composer

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist phuongdev89/yii2-debug "@dev"

or add

"phuongdev89/yii2-debug": "@dev"

to the require section of your composer.json file.

Configuration

'modules' => [
    'debug' => [
        'class' => 'phuongdev89\debug\Module',
    ], 
],

or

$config['bootstrap'][]      = 'debug';
$config['modules']['debug'] = [
    'class' => 'phuongdev89\debug\Module',
];

Backtrace Usage

Use to see traces of given Object

Initialize the backtrace with an existed active record.

Example:

if($model->save()) {
   Backtrace::init($model);
}

Save traces to file with json formatted

Example:

$model = new Model;
$model->id = 1;
$model->username = 'test';
if($model->save()) {
  Backtrace::init($model)->toFile('@runtime/test.json');
  //Output is /runtime/test.json
}

Return json format

Example:

if($model->save()) {
 $traceJson = Backtrace::init($model)->toJson();
}

output:

[
    {
        "function": "actionUpdate",
        "class": "backend\\controllers\\UserController",
        "type": "->"
    },
    {
        "file": "backend/controllers/UserController.php",
        "line": 366,
        "function": "save",
        "class": "common\\models\\User",
        "type": "->"
    },
    {
        "file": "/var/www/tribe/common/models/User.php",
        "line": 289,
        "function": "toJson",
        "class": "phuongdev89\\debug\\db\\Backtrace",
        "type": "::"
    }
]

Return php array format

Example:

if($model->save()) {
 $traceJson = Backtrace::init($model)->toArray();
}

Output:

[
    [
        "function" => "actionUpdate",
        "class" => "backend\\controllers\\UserController",
        "type" => "->"
    ],
    [
        "file" => "backend/controllers/UserController.php",
        "line" => 366,
        "function" => "save",
        "class" => "common\\models\\User",
        "type" => "->"
    ],
    [
        "file" => "/var/www/tribe/common/models/User.php",
        "line" => 289,
        "function" => "toJson",
        "class" => "phuongdev89\\debug\\db\\Backtrace",
        "type" => "::"
    ]
]

Automated update the given column with json data

Example:

if($model->save()) {
 Backtrace::init($model)->toAttribute('trace');
}

统计信息

  • 总下载量: 113
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固