mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-06-22 18:55:04 +02:00
386 lines
11 KiB
HTML
386 lines
11 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
<title>PHP Debug Bar</title>
|
|
|
|
<link type="text/css" rel="stylesheet" href="/docs/assets/css/reset.css">
|
|
<link type="text/css" rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/sunburst.min.css">
|
|
<link type="text/css" rel="stylesheet" href="/docs/assets/css/docs.css">
|
|
<link type="text/css" rel="stylesheet" href="/docs/assets/css/print.css" media="print">
|
|
<link type="text/css" rel="stylesheet" href="style.css">
|
|
|
|
<script type="text/javascript" src="/docs/assets/js/jquery-1.10.1.min.js"></script>
|
|
<script type="text/javascript" src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script>
|
|
<script type="text/javascript" src="/docs/assets/js/lunr.min.js"></script>
|
|
|
|
|
|
|
|
<script type="text/javascript">var BASE_URL = "/docs/";</script>
|
|
<script type="text/javascript" src="/docs/assets/js/viewer.js"></script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<div id="page">
|
|
<a name="top" />
|
|
<header id="header">
|
|
<h1><a href="/docs/">PHP Debug Bar</a></h1>
|
|
</header>
|
|
|
|
|
|
<div id="sidebar">
|
|
<form action="/docs/search.html"><input id="search" type="text" placeholder="Search" name="q" /></form>
|
|
<nav id="toc">
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/readme.html#php-debug-bar">PHP Debug Bar</a>
|
|
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/readme.html#installation">Installation</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/readme.html#quick-start">Quick start</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/data-collectors.html#collecting-data">Collecting Data</a>
|
|
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/data-collectors.html#using-collectors">Using collectors</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/data-collectors.html#creating-collectors">Creating collectors</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/rendering.html#rendering">Rendering</a>
|
|
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/rendering.html#assets">Assets</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/rendering.html#the-javascript-object">The javascript object</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#base-collectors">Base collectors</a>
|
|
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#messages">Messages</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#timedata">TimeData</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#exceptions">Exceptions</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#pdo">PDO</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#requestdata">RequestData</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#config">Config</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#aggregatedcollector">AggregatedCollector</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/base-collectors.html#others">Others</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#bridge-collectors">Bridge collectors</a>
|
|
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#cachecache">CacheCache</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#doctrine">Doctrine</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#monolog">Monolog</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#propel">Propel</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#slim">Slim</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#swift-mailer">Swift Mailer</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/bridge-collectors.html#twig">Twig</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/storage.html#storage">Storage</a>
|
|
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/storage.html#available-storage">Available storage</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/storage.html#creating-your-own-storage">Creating your own storage</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/storage.html#request-id-generator">Request ID generator</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/openhandler.html#open-handler">Open handler</a>
|
|
|
|
|
|
<ol>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/javascript-bar.html#javascript-bar">Javascript Bar</a>
|
|
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<a href="/docs/javascript-bar.html#tabs-and-indicators">Tabs and indicators</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/javascript-bar.html#data-mapping">Data mapping</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/javascript-bar.html#datasets">Datasets</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/javascript-bar.html#widgets">Widgets</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/javascript-bar.html#custom-tabs-and-indicators">Custom tabs and indicators</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<a href="/docs/javascript-bar.html#openhandler">OpenHandler</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
</nav>
|
|
|
|
<nav id="links">
|
|
<ul>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
<a name="php-debug-bar"></a><h1>PHP Debug Bar</h1>
|
|
<p><a href="https://packagist.org/packages/maximebf/debugbar"><img src="https://poser.pugx.org/maximebf/debugbar/v/stable.png" alt="Latest Stable Version"></a> <a href="https://travis-ci.org/maximebf/php-debugbar"><img src="https://travis-ci.org/maximebf/php-debugbar.png?branch=master" alt="Build Status"></a></p>
|
|
<p>Displays a debug bar in the browser with information from php.
|
|
No more <code>var_dump()</code> in your code!</p>
|
|
<p><img src="https://raw.github.com/maximebf/php-debugbar/master/docs/screenshot.png" alt="Screenshot"></p>
|
|
<p><strong>Features:</strong></p>
|
|
<ul>
|
|
<li>Generic debug bar with no other dependencies</li>
|
|
<li>Easy to integrate with any project</li>
|
|
<li>Clean, fast and easy to use interface</li>
|
|
<li>Handles AJAX request</li>
|
|
<li>Includes generic data collectors and collectors for well known libraries</li>
|
|
<li>The client side bar is 100% coded in javascript</li>
|
|
<li>Easily create your own collectors and their associated view in the bar</li>
|
|
<li>Save and re-open previews requests</li>
|
|
<li><a href="http://phpdebugbar.com/docs">Very well documented</a></li>
|
|
</ul>
|
|
<p>Includes collectors for:</p>
|
|
<ul>
|
|
<li><a href="http://php.net/manual/en/book.pdo.php">PDO</a></li>
|
|
<li><a href="http://maximebf.github.io/CacheCache/">CacheCache</a></li>
|
|
<li><a href="http://doctrine-project.org">Doctrine</a></li>
|
|
<li><a href="https://github.com/Seldaek/monolog">Monolog</a></li>
|
|
<li><a href="http://propelorm.org/">Propel</a></li>
|
|
<li><a href="http://slimframework.com">Slim</a></li>
|
|
<li><a href="http://swiftmailer.org/">Swift Mailer</a></li>
|
|
<li><a href="http://twig.sensiolabs.org/">Twig</a></li>
|
|
</ul>
|
|
<p>Checkout the <a href="https://github.com/maximebf/php-debugbar/tree/master/demo">demo</a> for
|
|
examples and <a href="http://phpdebugbar.com">phpdebugbar.com</a> for a live example.</p>
|
|
<a name="installation"></a><h2>Installation</h2>
|
|
<p>The easiest way to install DebugBar is using <a href="https://github.com/composer/composer">Composer</a>
|
|
with the following requirement:</p>
|
|
<pre><code>{
|
|
"require": {
|
|
"maximebf/debugbar": ">=1.0.0"
|
|
}
|
|
}</code></pre>
|
|
<p>Alternatively, you can <a href="https://github.com/maximebf/php-debugbar/zipball/master">download the archive</a>
|
|
and add the src/ folder to PHP's include path:</p>
|
|
<pre><code>set_include_path('/path/to/src' . PATH_SEPARATOR . get_include_path());</code></pre>
|
|
<p>DebugBar does not provide an autoloader but follows the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0 convention</a>.<br>You can use the following snippet to autoload DebugBar classes:</p>
|
|
<pre><code>spl_autoload_register(function($className) {
|
|
if (substr($className, 0, 8) === 'DebugBar') {
|
|
$filename = str_replace('\\', DIRECTORY_SEPARATOR, trim($className, '\\')) . '.php';
|
|
require_once $filename;
|
|
}
|
|
});</code></pre>
|
|
<a name="quick-start"></a><h2>Quick start</h2>
|
|
<p>DebugBar is very easy to use and you can add it to any of your projets in no time.
|
|
The easiest way is using the <code>render()</code> functions</p>
|
|
<pre><code><?php
|
|
use DebugBar\StandardDebugBar;
|
|
use DebugBar\JavascriptRenderer;
|
|
|
|
$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></code></pre>
|
|
<p>The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are
|
|
automated but others are manual. Use the <code>DebugBar</code> like an array where keys are the
|
|
collector names. In our previous example, we add a message to the <code>MessagesCollector</code>:</p>
|
|
<pre><code>$debugbar["messages"]->addMessage("hello world!");</code></pre>
|
|
<p><code>StandardDebugBar</code> activates the following collectors:</p>
|
|
<ul>
|
|
<li><code>MemoryCollector</code> (<em>memory</em>)</li>
|
|
<li><code>MessagesCollector</code> (<em>messages</em>)</li>
|
|
<li><code>PhpInfoCollector</code> (<em>php</em>)</li>
|
|
<li><code>RequestDataCollector</code> (<em>request</em>)</li>
|
|
<li><code>TimeDataCollector</code> (<em>time</em>)</li>
|
|
<li><code>ExceptionsCollector</code> (<em>exceptions</em>)</li>
|
|
</ul>
|
|
<p>Learn more about DebugBar in the <a href="http://phpdebugbar.com/docs">docs</a>.</p>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<footer id="footer">
|
|
Powered by <a href="http://github.com/maximebf/beautiful-docs">beautiful-docs</a> -
|
|
<a href="#top">Back to top</a> - <a href="/docs/all.html">Everything on a single page</a>
|
|
- <a href="?print=1">Print current page</a> - <a href="/docs/all.html?print=1">Print all pages</a>
|
|
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|