mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-06-10 16:15:43 +02:00
updated
This commit is contained in:
@ -369,6 +369,7 @@ examples and <a href="http://phpdebugbar.com">phpdebugbar.com</a> for a live exa
|
||||
<li><a href="https://github.com/barryvdh/laravel-debugbar">Laravel</a></li>
|
||||
<li><a href="http://atomikframework.com/docs/error-log-debug.html#debug-bar">Atomik</a></li>
|
||||
<li><a href="http://xoops.org/modules/news/article.php?storyid=6538">XOOPS</a></li>
|
||||
<li><a href="https://github.com/snapshotpl/ZfSnapPhpDebugBar">Zend Framework 2</a></li>
|
||||
</ul>
|
||||
<p><em>(drop me a message or submit a PR to add your DebugBar related project here)</em></p>
|
||||
<a name="installation"></a><h2>Installation</h2>
|
||||
@ -450,6 +451,7 @@ examples and <a href="http://phpdebugbar.com">phpdebugbar.com</a> for a live exa
|
||||
<li><a href="https://github.com/barryvdh/laravel-debugbar">Laravel</a></li>
|
||||
<li><a href="http://atomikframework.com/docs/error-log-debug.html#debug-bar">Atomik</a></li>
|
||||
<li><a href="http://xoops.org/modules/news/article.php?storyid=6538">XOOPS</a></li>
|
||||
<li><a href="https://github.com/snapshotpl/ZfSnapPhpDebugBar">Zend Framework 2</a></li>
|
||||
</ul>
|
||||
<p><em>(drop me a message or submit a PR to add your DebugBar related project here)</em></p>
|
||||
<a name="installation"></a><h2>Installation</h2>
|
||||
@ -553,6 +555,41 @@ in <code>JavascriptRenderer::addControl($name, $options)</code> (see Rendering c
|
||||
}
|
||||
}</code></pre>
|
||||
<p>This will have the result of adding a new indicator to the debug bar.</p>
|
||||
<p>When implementing the Renderable interface, you may use widgets which are not provided
|
||||
with the default install. You can add new assets by implementing the <code>DebugBar\DataCollector\AssetProvider</code> interface.</p>
|
||||
<p>to implement it, you must define the <code>getAssets()</code> method. It must return an array with the
|
||||
following keys:</p>
|
||||
<ul>
|
||||
<li>base_path: base path of assets (optional, if omitted or null, will use the base path of the JavascriptRenderer)</li>
|
||||
<li>base_url: base url of assets (optional, same as base_path)</li>
|
||||
<li>css: an array of css filenames</li>
|
||||
<li>js: an array of javascript filenames</li>
|
||||
</ul>
|
||||
<p>Example:</p>
|
||||
<pre><code>class MyDbCollector extends DebugBar\DataCollector\DataCollector implements DebugBar\DataCollector\Renderable, DebugBar\DataCollector\AssetProvider
|
||||
{
|
||||
// ...
|
||||
|
||||
public function getWidgets()
|
||||
{
|
||||
return array(
|
||||
"database" => array(
|
||||
"icon" => "inbox",
|
||||
"widget" => "PhpDebugBar.Widgets.SQLQueriesWidget",
|
||||
"map" => "pdo",
|
||||
"default" => "[]"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function getAssets()
|
||||
{
|
||||
return array(
|
||||
'css' => 'widgets/sqlqueries/widget.css',
|
||||
'js' => 'widgets/sqlqueries/widget.js'
|
||||
);
|
||||
}
|
||||
}</code></pre>
|
||||
|
||||
<a name="rendering"></a><h1>Rendering</h1>
|
||||
<p>Rendering is performed using the `DebugBar\JavascriptRenderer̀ class. It contains
|
||||
|
@ -391,6 +391,41 @@ in <code>JavascriptRenderer::addControl($name, $options)</code> (see Rendering c
|
||||
}
|
||||
}</code></pre>
|
||||
<p>This will have the result of adding a new indicator to the debug bar.</p>
|
||||
<p>When implementing the Renderable interface, you may use widgets which are not provided
|
||||
with the default install. You can add new assets by implementing the <code>DebugBar\DataCollector\AssetProvider</code> interface.</p>
|
||||
<p>to implement it, you must define the <code>getAssets()</code> method. It must return an array with the
|
||||
following keys:</p>
|
||||
<ul>
|
||||
<li>base_path: base path of assets (optional, if omitted or null, will use the base path of the JavascriptRenderer)</li>
|
||||
<li>base_url: base url of assets (optional, same as base_path)</li>
|
||||
<li>css: an array of css filenames</li>
|
||||
<li>js: an array of javascript filenames</li>
|
||||
</ul>
|
||||
<p>Example:</p>
|
||||
<pre><code>class MyDbCollector extends DebugBar\DataCollector\DataCollector implements DebugBar\DataCollector\Renderable, DebugBar\DataCollector\AssetProvider
|
||||
{
|
||||
// ...
|
||||
|
||||
public function getWidgets()
|
||||
{
|
||||
return array(
|
||||
"database" => array(
|
||||
"icon" => "inbox",
|
||||
"widget" => "PhpDebugBar.Widgets.SQLQueriesWidget",
|
||||
"map" => "pdo",
|
||||
"default" => "[]"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function getAssets()
|
||||
{
|
||||
return array(
|
||||
'css' => 'widgets/sqlqueries/widget.css',
|
||||
'js' => 'widgets/sqlqueries/widget.js'
|
||||
);
|
||||
}
|
||||
}</code></pre>
|
||||
|
||||
|
||||
|
||||
|
@ -369,6 +369,7 @@ examples and <a href="http://phpdebugbar.com">phpdebugbar.com</a> for a live exa
|
||||
<li><a href="https://github.com/barryvdh/laravel-debugbar">Laravel</a></li>
|
||||
<li><a href="http://atomikframework.com/docs/error-log-debug.html#debug-bar">Atomik</a></li>
|
||||
<li><a href="http://xoops.org/modules/news/article.php?storyid=6538">XOOPS</a></li>
|
||||
<li><a href="https://github.com/snapshotpl/ZfSnapPhpDebugBar">Zend Framework 2</a></li>
|
||||
</ul>
|
||||
<p><em>(drop me a message or submit a PR to add your DebugBar related project here)</em></p>
|
||||
<a name="installation"></a><h2>Installation</h2>
|
||||
|
@ -12,7 +12,7 @@ documentTitles["/docs/readme.html#php-debug-bar"] = "PHP Debug Bar";
|
||||
index.add({
|
||||
url: "/docs/readme.html#php-debug-bar",
|
||||
title: "PHP Debug Bar",
|
||||
body: "# PHP Debug Bar [](https://packagist.org/packages/maximebf/debugbar) [](https://travis-ci.org/maximebf/php-debugbar) Displays a debug bar in the browser with information from php. No more `var_dump()` in your code!  **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](http://phpdebugbar.com/docs) Includes collectors for: - [PDO](http://php.net/manual/en/book.pdo.php) - [CacheCache](http://maximebf.github.io/CacheCache/) - [Doctrine](http://doctrine-project.org) - [Monolog](https://github.com/Seldaek/monolog) - [Propel](http://propelorm.org/) - [Slim](http://slimframework.com) - [Swift Mailer](http://swiftmailer.org/) - [Twig](http://twig.sensiolabs.org/) Checkout the [demo](https://github.com/maximebf/php-debugbar/tree/master/demo) for examples and [phpdebugbar.com](http://phpdebugbar.com) for a live example. Integrations with other frameworks: - [Laravel](https://github.com/barryvdh/laravel-debugbar) - [Atomik](http://atomikframework.com/docs/error-log-debug.html#debug-bar) - [XOOPS](http://xoops.org/modules/news/article.php?storyid=6538) *(drop me a message or submit a PR to add your DebugBar related project here)* "
|
||||
body: "# PHP Debug Bar [](https://packagist.org/packages/maximebf/debugbar) [](https://travis-ci.org/maximebf/php-debugbar) Displays a debug bar in the browser with information from php. No more `var_dump()` in your code!  **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](http://phpdebugbar.com/docs) Includes collectors for: - [PDO](http://php.net/manual/en/book.pdo.php) - [CacheCache](http://maximebf.github.io/CacheCache/) - [Doctrine](http://doctrine-project.org) - [Monolog](https://github.com/Seldaek/monolog) - [Propel](http://propelorm.org/) - [Slim](http://slimframework.com) - [Swift Mailer](http://swiftmailer.org/) - [Twig](http://twig.sensiolabs.org/) Checkout the [demo](https://github.com/maximebf/php-debugbar/tree/master/demo) for examples and [phpdebugbar.com](http://phpdebugbar.com) for a live example. Integrations with other frameworks: - [Laravel](https://github.com/barryvdh/laravel-debugbar) - [Atomik](http://atomikframework.com/docs/error-log-debug.html#debug-bar) - [XOOPS](http://xoops.org/modules/news/article.php?storyid=6538) - [Zend Framework 2](https://github.com/snapshotpl/ZfSnapPhpDebugBar) *(drop me a message or submit a PR to add your DebugBar related project here)* "
|
||||
});
|
||||
|
||||
documentTitles["/docs/readme.html#installation"] = "Installation";
|
||||
@ -35,7 +35,7 @@ documentTitles["/docs/readme.html#php-debug-bar"] = "PHP Debug Bar";
|
||||
index.add({
|
||||
url: "/docs/readme.html#php-debug-bar",
|
||||
title: "PHP Debug Bar",
|
||||
body: "# PHP Debug Bar [](https://packagist.org/packages/maximebf/debugbar) [](https://travis-ci.org/maximebf/php-debugbar) Displays a debug bar in the browser with information from php. No more `var_dump()` in your code!  **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](http://phpdebugbar.com/docs) Includes collectors for: - [PDO](http://php.net/manual/en/book.pdo.php) - [CacheCache](http://maximebf.github.io/CacheCache/) - [Doctrine](http://doctrine-project.org) - [Monolog](https://github.com/Seldaek/monolog) - [Propel](http://propelorm.org/) - [Slim](http://slimframework.com) - [Swift Mailer](http://swiftmailer.org/) - [Twig](http://twig.sensiolabs.org/) Checkout the [demo](https://github.com/maximebf/php-debugbar/tree/master/demo) for examples and [phpdebugbar.com](http://phpdebugbar.com) for a live example. Integrations with other frameworks: - [Laravel](https://github.com/barryvdh/laravel-debugbar) - [Atomik](http://atomikframework.com/docs/error-log-debug.html#debug-bar) - [XOOPS](http://xoops.org/modules/news/article.php?storyid=6538) *(drop me a message or submit a PR to add your DebugBar related project here)* "
|
||||
body: "# PHP Debug Bar [](https://packagist.org/packages/maximebf/debugbar) [](https://travis-ci.org/maximebf/php-debugbar) Displays a debug bar in the browser with information from php. No more `var_dump()` in your code!  **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](http://phpdebugbar.com/docs) Includes collectors for: - [PDO](http://php.net/manual/en/book.pdo.php) - [CacheCache](http://maximebf.github.io/CacheCache/) - [Doctrine](http://doctrine-project.org) - [Monolog](https://github.com/Seldaek/monolog) - [Propel](http://propelorm.org/) - [Slim](http://slimframework.com) - [Swift Mailer](http://swiftmailer.org/) - [Twig](http://twig.sensiolabs.org/) Checkout the [demo](https://github.com/maximebf/php-debugbar/tree/master/demo) for examples and [phpdebugbar.com](http://phpdebugbar.com) for a live example. Integrations with other frameworks: - [Laravel](https://github.com/barryvdh/laravel-debugbar) - [Atomik](http://atomikframework.com/docs/error-log-debug.html#debug-bar) - [XOOPS](http://xoops.org/modules/news/article.php?storyid=6538) - [Zend Framework 2](https://github.com/snapshotpl/ZfSnapPhpDebugBar) *(drop me a message or submit a PR to add your DebugBar related project here)* "
|
||||
});
|
||||
|
||||
documentTitles["/docs/readme.html#installation"] = "Installation";
|
||||
@ -72,7 +72,7 @@ documentTitles["/docs/data-collectors.html#creating-collectors"] = "Creating col
|
||||
index.add({
|
||||
url: "/docs/data-collectors.html#creating-collectors",
|
||||
title: "Creating collectors",
|
||||
body: "## Creating collectors Collectors must implement the `DebugBar\DataCollector\DataCollectorInterface`. They may subclass `DebugBar\DataCollector\DataCollector` which provides utility methods. Collectors must provide a `getName()` function returning their unique name and a `collect()` function returning some json-encodable data. The latter will be called at the same time the `DebugBar::collect()` method is called. class MyDataCollector extends DebugBar\DataCollector\DataCollector { public function collect() { return array(\"uniqid\" => uniqid()); } public function getName() { return 'mycollector'; } } $debugbar->addCollector(new MyDataCollector()); This however won't show anything in the debug bar as no information are provided on how to display these data. You could do that manually as you'll see in later chapter or implement the `DebugBar\DataSource\Renderable` interface. To implement it, you must define a `getWidgets()` function which returns an array of key/value pairs where key are control names and values control options as defined in `JavascriptRenderer::addControl($name, $options)` (see Rendering chapter). class MyDataCollector extends DebugBar\DataCollector\DataCollector implements DebugBar\DataCollector\Renderable { // ... public function getWidgets() { return array( \"mycollector\" => array( \"icon\" => \"cogs\", \"tooltip\" => \"uniqid()\", \"map\" => \"uniqid\", \"default\" => \"''\" ) ); } } This will have the result of adding a new indicator to the debug bar. "
|
||||
body: "## Creating collectors Collectors must implement the `DebugBar\DataCollector\DataCollectorInterface`. They may subclass `DebugBar\DataCollector\DataCollector` which provides utility methods. Collectors must provide a `getName()` function returning their unique name and a `collect()` function returning some json-encodable data. The latter will be called at the same time the `DebugBar::collect()` method is called. class MyDataCollector extends DebugBar\DataCollector\DataCollector { public function collect() { return array(\"uniqid\" => uniqid()); } public function getName() { return 'mycollector'; } } $debugbar->addCollector(new MyDataCollector()); This however won't show anything in the debug bar as no information are provided on how to display these data. You could do that manually as you'll see in later chapter or implement the `DebugBar\DataSource\Renderable` interface. To implement it, you must define a `getWidgets()` function which returns an array of key/value pairs where key are control names and values control options as defined in `JavascriptRenderer::addControl($name, $options)` (see Rendering chapter). class MyDataCollector extends DebugBar\DataCollector\DataCollector implements DebugBar\DataCollector\Renderable { // ... public function getWidgets() { return array( \"mycollector\" => array( \"icon\" => \"cogs\", \"tooltip\" => \"uniqid()\", \"map\" => \"uniqid\", \"default\" => \"''\" ) ); } } This will have the result of adding a new indicator to the debug bar. When implementing the Renderable interface, you may use widgets which are not provided with the default install. You can add new assets by implementing the `DebugBar\DataCollector\AssetProvider` interface. to implement it, you must define the `getAssets()` method. It must return an array with the following keys: - base\_path: base path of assets (optional, if omitted or null, will use the base path of the JavascriptRenderer) - base\_url: base url of assets (optional, same as base\_path) - css: an array of css filenames - js: an array of javascript filenames Example: class MyDbCollector extends DebugBar\DataCollector\DataCollector implements DebugBar\DataCollector\Renderable, DebugBar\DataCollector\AssetProvider { // ... public function getWidgets() { return array( \"database\" => array( \"icon\" => \"inbox\", \"widget\" => \"PhpDebugBar.Widgets.SQLQueriesWidget\", \"map\" => \"pdo\", \"default\" => \"[]\" ) ); } public function getAssets() { return array( 'css' => 'widgets/sqlqueries/widget.css', 'js' => 'widgets/sqlqueries/widget.js' ); } }"
|
||||
});
|
||||
|
||||
|
||||
|
@ -369,6 +369,7 @@ examples and <a href="http://phpdebugbar.com">phpdebugbar.com</a> for a live exa
|
||||
<li><a href="https://github.com/barryvdh/laravel-debugbar">Laravel</a></li>
|
||||
<li><a href="http://atomikframework.com/docs/error-log-debug.html#debug-bar">Atomik</a></li>
|
||||
<li><a href="http://xoops.org/modules/news/article.php?storyid=6538">XOOPS</a></li>
|
||||
<li><a href="https://github.com/snapshotpl/ZfSnapPhpDebugBar">Zend Framework 2</a></li>
|
||||
</ul>
|
||||
<p><em>(drop me a message or submit a PR to add your DebugBar related project here)</em></p>
|
||||
<a name="installation"></a><h2>Installation</h2>
|
||||
|
Reference in New Issue
Block a user