how to install php-debugbar
Hi, I'm having a hard time installing the debugbar for SilverStripe 4.1.1. I've made the requirements, and used terminal, but the bar does not show on Firefox Developer Edition browser.
Here is the terminal:
composer require maximebf/debugbar
Warning: Module 'intl' already loaded in Unknown on line 0
Plugin command require-recipe (SilverStripe\RecipePlugin\RequireRecipeCommand) would override a Composer command and has been skipped
Plugin command update-recipe (SilverStripe\RecipePlugin\UpdateRecipeCommand) would override a Composer command and has been skipped
Using version ^1.15 for maximebf/debugbar
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package tractorcow/recipe-plugin is abandoned, you should avoid using it. Use silverstripe/recipe-plugin instead.
Generating autoload files
The docs say: 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
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>
I don't know what to do with this. Is debug bar supposed to go in the global space, or is it for a certain project. I don't see any debugbar files in the src folder of the project.
Is the above code supposed to be installed on the Page.ss, or is this for Page.php
Here's part of the composer.json file:
{
"name": "silverstripe/installer",
"type": "silverstripe-recipe",
"description": "The SilverStripe Framework Installer",
"require": {
"php": ">=5.6.0",
"silverstripe/recipe-plugin": "^1",
"silverstripe/recipe-cms": "1.1.1@stable",
"silverstripe-themes/simple": "~3.2.0",
"maximebf/debugbar": ">=1.0.0",
"jdorn/sql-formatter": "dev-master"
}
}
Perhaps check https://github.com/lekoala/silverstripe-debugbar for more information about how to integrate with SilverStripe.
Hi barryvdh,
I have many times... it requires this debug bar to work. I've followed the instructions here of adding the requirements in the composer.json file and using the terminal command, but when I'm viewing the project as localhost:8888/tpan the debugbar does not appear.
Using a mac mini, with Firefox Developer Edition.
Did you raise an issue there?
yes, https://github.com/lekoala/silverstripe-debugbar/issues/96
debugbar is a requirement does not appear in the browser window. Do have any ideas why? composer.json has it included, terminal command has been executed.
Hi barrybdh,
How do you typically use this file?
<?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>
Does the bar show up on any localhost:8888/siteyouareworkingon ?