Tracy 2.9 and evolution of the iconic screen
Tracy's distinctive red screen has barely changed in the 15 years of its existence, and it's an exaggeration to say that the evolution has been in search of the ideal shade of red. In fact, there have been plenty of minor visual improvements, but not until version 2.9 has something major been introduced.
Tabs have been added to the red screen. These allow you to switch between template and PHP code if an error occurs in Latte. They make the Environment section much clearer. And they also made it possible to combine the HTTP request and response into a single HTTP section.
The call stack has also been modernized. The listing is now aligned by the names of the called methods and functions. The source and also the argument list can be accessed by a single click on the method name.
And oh look, you can now switch between Latte template and PHP code tabs directly in the call stack!
(If you don't use Tracy's linking with the editor,
you can turn off clicking through file names by setting
Debugger::$editor = null).
In order for the Debug bar to display AJAX requests and redirects, Tracy
stores the data in a session. As of version 2.9, it doesn't use the native PHP
session, but uses its own temporary files and sends itself a key in a cookie
tracy-session. This allows you to better debug the behavior of the
PHP session in your application, since Tracy does not require its presence and
therefore does not turn it on.
(Tracy can be set to use the native session as well).
Tracy can create new files and classes. If the name of a non-existing class
or file appears in the exception message, it will give an offer to create it via
create. As of version 2.9, its contents can also be defined.
It can create presenters or Latte templates, for example.
This gives us an interesting and elegant way of developing applications that starts from entering a URL into the browser.
To make it work, update
$screamaccepts error levels in addition to true/false, e.g.
Debugger::$scream = E_DEPRECATED | E_USER_DEPRECATED
- in configuration files, the values of options
screamcan be written as an expression used in PHP (e.g.
E_ALL & ~E_NOTICE)