Download the PHP package yangweijie/think-debugbar without Composer

On this page you can find all versions of the php package yangweijie/think-debugbar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-debugbar

think-debugbar

用于ThinkPHP6+的DebugBar扩展。

安装

composer

composer require yangweijie/think-debugbar --dev

.env 修改

[debugbar]
DEBUGBAR_ENABLED=true

其他配置参考 config/debugbar里的环境变量使用

nginx

nginx 项目的rewrite里要配ThinkPHP的

location / {
    index index.php;
    if (!-e $request_filename){
        rewrite  ^(.*)$  /index.php?s=$1  last;
        break;
    }
}

静态资源缓存要注释掉

#    location ~ .+\.(gif|jpg|jpeg|png|bmp|swf)$
#    {
#        expires      1d;
#        error_log nul;
#        access_log off;
#    }

#    location ~ .+\.(js|css)$
#    {
#        expires      1h;
#        error_log nul;
#        access_log off;
#    }

扩展

collectors

普通

class MyDataCollector extends DebugBar\DataCollector\DataCollector
{
    public function collect()
    {
        return array("uniqid" => uniqid());
    }

    public function getName()
    {
        return 'mycollector';
    }
}
class MyDataCollector extends DebugBar\DataCollector\DataCollector implements DebugBar\DataCollector\Renderable
{
    // ...

    public function getWidgets()
    {
        return array(
            "mycollector" => array(
                "icon" => "cogs",
                "tooltip" => "uniqid()",
                "map" => "uniqid",
                "default" => "''"
            ),
            "mycollector:badge" => [
                "map" => "SQL.nb_statements",
                "default" => 0
            ]
        );
    }
}

badge 角标,可以从collect 取map的key

让message里可以打开指定文件

如文件加载列表

    /**
     * {@inheritDoc}
     */
    public function collect()
    {
        $files = $this->getIncludedFiles();

        $included = [];
        if(!$this->getXdebugLinkTemplate()){
            $this->setEditorLinkTemplate(app()->config->get('debugbar.editor'));
        }
        foreach ($files as $file) {

            if (Str::contains($file, $this->ignored)) {
                continue;
            }

            $included[] = [
                'message'   => "'" . $this->stripBasePath($file) . "',",
                // Use PHP syntax so we can copy-paste to compile config file.
                'is_string' => true,
                'xdebug_link'=>$this->getXdebugLink($file),
            ];
        }

        return [
            'messages' => $included,
            'count'    => count($included),
        ];
    }

message 里 包含 xdebug_link $this->getXdebugLink($file)

资源

扩展 JavascriptRenderer 类, 实现 renderHead 方法替换静态资源头部 然后 注册路由控制器来实现 资源地址动态返回js文件

升级功能

SQL tab

将sql 日志 独立出来 显示在SQL tab 里 有timeline、 可以点击跳转编辑器、可以一件复制

Ajax 监听

支持xhr 请求监听, 可以切换历史请求看调试信息

添加模型显示

显示请求中使用的模型 可以打开跳转

加载文件可以打开跳转源文件

tab 中文化

logo显示官方logo

编辑器、ide 打开方式

sublime

需要安装 GitHub - thecotne/subl-protocol: sublime text protocol 插件

phpstorm

参考 laravel-debugbar 中正确使用 ide phpstorm 打开项目文件的方式 | Laravel China 社区 文章放置 js 和 添加注册表即可


All versions of think-debugbar with dependencies

PHP Build Version
Package Version
Requires topthink/framework Version ^6.0 | ^6.1 | ^8.0
maximebf/debugbar Version ^1.19
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yangweijie/think-debugbar contains the following files

Loading the files please wait ...