3 Star 1 Fork 0

Gitee 极速下载 / PHPDebugBar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/maximebf/php-debugbar
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

PHP Debug Bar

Latest Stable Version Total Downloads License Tests

Displays a debug bar in the browser with information from php. No more var_dump() in your code!

Screenshot

Features:

  • Generic debug bar
  • Easy to integrate with any project
  • Clean, fast and easy to use interface
  • Handles AJAX request
  • Includes generic data collectors and collectors for well known libraries
  • The client side bar is 100% coded in javascript
  • Easily create your own collectors and their associated view in the bar
  • Save and re-open previous requests
  • Very well documented

Includes collectors for:

Checkout the demo for examples and phpdebugbar.com for a live example.

Integrations with other frameworks:

(drop me a message or submit a PR to add your DebugBar related project here)

Installation

The best way to install DebugBar is using Composer with the following command:

composer require maximebf/debugbar

Quick start

DebugBar is very easy to use and you can add it to any of your projects in no time. The easiest way is using the render() functions

<?php

// Require the Composer autoloader, if not already loaded
require 'vendor/autoload.php';

use DebugBar\StandardDebugBar;

$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer();

$debugbar["messages"]->addMessage("hello world!");
?>
<html>
    <head>
        <?php echo $debugbarRenderer->renderHead() ?>
    </head>
    <body>
        ...
        <?php echo $debugbarRenderer->render() ?>
    </body>
</html>

The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are automated but others are manual. Use the DebugBar like an array where keys are the collector names. In our previous example, we add a message to the MessagesCollector:

$debugbar["messages"]->addMessage("hello world!");

StandardDebugBar activates the following collectors:

  • MemoryCollector (memory)
  • MessagesCollector (messages)
  • PhpInfoCollector (php)
  • RequestDataCollector (request)
  • TimeDataCollector (time)
  • ExceptionsCollector (exceptions)

Learn more about DebugBar in the docs.

Demo

To run the demo, clone this repository and start the Built-In PHP webserver from the root:

php -S localhost:8000

Then visit http://localhost:8000/demo/

Testing

To test, run php vendor/bin/phpunit. To debug Browser tests, you can run PANTHER_NO_HEADLESS=1 vendor/bin/phpunit --debug

Copyright (C) 2013 Maxime Bouroumeau-Fuseau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

DebugBar 很容易就能集成到项目中,可以显示应用所有部分的分析数据,它带有内置的标准 PHP 特性和流行项目的数据收集器 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/mirrors/PHPDebugBar.git
git@gitee.com:mirrors/PHPDebugBar.git
mirrors
PHPDebugBar
PHPDebugBar
master

搜索帮助