* Prevent back reference issues in TracedStatement
* Prevent substring replacement
If a previously replaced value in the query string contains the placeholder
for a future replacement, the string inside was being replaced
Also, PHP allows the bindParameter syntax to omit the leading ':', so we
test to make sure it's there and add it if not
Introduce a new HtmlVariableListWidget that is similar to
VariableListWidget but for variables with HTML contents.
Update the collectors that use the existing VariableListWidget to use
DebugBarVarDumper to dump the variables using the VarDumper HtmlDumper.
Because many debug bar users may not yet support inline static assets,
default to use the old VariableListWidget for now.
Updated collectors:
* ConfigCollector
* RequestDataCollector
Use the new DebugBarVarDumper class to support dumping variables in
interactive collapsible HTML; the new useHtmlVarDumper() function will
enable this.
Since this will require users to handle the new inline assets provided
by the JavascriptRenderer, make this dumping format optional and default
to the old behavior for now.
The Symfony VarDumper component includes an HtmlDumper that dumps
variables in a rich HTML format that allows for expanding and collapsing
individual tree nodes in the dumped variable. This makes it much more
practical to navigate large/deep variables that have been dumped.
DebugBarVarDumper provides a Debug Bar-friendly wrapper around the
VarDumper component. It’s intended as a better alternative to
DataFormatter::formatVar. It provides for:
* Debug Bar-friendly styles for the VarDumper HTML.
* Implements AssetProvider for returning VarDumper static assets
(requires users of JavascriptRenderer to support inline assets).
* Simplifies VarCloner and HtmlDumper function calls for cloning and
dumping variables in a Debug Bar environment. VarDumper was
originally written/targeted to be a replacement for var_dump, so the
default behavior of HtmlDumper echoing static assets and variable
dumps directly to the page output isn’t really appropriate.
Furthermore, we must contend with several different Symfony versions
going back to v2.6.0. This class provides a friendly wrapper.
I have tested this with these Symfony versions:
* v2.6.0
* v2.7.0
* v2.8.0
* v3.0.0
* v3.1.0
* v3.2.0
* v3.3.0
All seem to work fine, with graceful degradation as needed.
Furthermore, the class is ready to take advantage of new features that I
added and are upcoming in Symfony v3.4:
* setMinDepth: https://github.com/symfony/symfony/pull/23515
This feature will be valuable for the upcoming BacktraceCollector.
Add new inline_css, inline_js, and inline_head keys on the
AssetProvider::getAssets() function. This allows us to support
collectors that require static assets that are not actually saved to a
file.
Then, update all the asset functions in JavascriptRenderer to support
these new keys.
An initial use case for this is supporting the HtmlDumper in Symfony’s
VarDumper. HtmlDumper only provides the styles and scripts in inline
HTML form. The static assets can be customized based on some
configuration properties available on the HtmlDumper class. One can
actually view the CSS/JS as a long PHP string/heredoc embedded in the
HtmlDumper.php source code. They are only accessible via the
getDumpHeader function, which returns the CSS/JS in a combined HTML
string.
By default, the debug bar will immediately show new AJAX requests. If
your page makes a lot of requests in the background (e.g. tracking),
this constant switching of the active data set can be disruptive to the
debug bar user.
This commit adds an option for disabling this behavior by calling
setAjaxHandlerAutoShow(false) on the JavascriptRenderer, like this:
$renderer = $debugbar->getJavascriptRenderer();
$renderer->setAjaxHandlerAutoShow(false);
When this behavior is disabled, AJAX requests are still available in the
drop-down list, but won’t become active until the user explicitly
selects them.
debugbar header is now split in left and right containers for better responsivity
changed the way the indicators position is handled (not a property of the indicator anymore)
moved resize-handle out of body
when closed, the debugbar will always restore to opened state