miniframe/developer-toolbar
最新稳定版本:v1.1.0
Composer 安装命令:
composer require miniframe/developer-toolbar
包简介
Developer toolbar for the Miniframe PHP Framework
README 文档
README
This library adds a basic developer toolbar to the Miniframe PHP Framework.
How to install
- In your existing project, type:
composer require --dev miniframe/developer-toolbar - Add the directive below to a
/config/development.ini - Add the development.ini to your
.gitignore(you won't want to have this running on production!)
Example development.ini directives
[framework]
middleware[] = Miniframe\Toolbar\Middleware\DeveloperToolbar
[developer-toolbar]
log_path = cache/debug
Add the Middleware as high as possible in the Middleware list, so it's loaded before other middlewares get the chance of throwing errors.
How to use
On each HTML page, a bug icon is added. If you click on it, a new tab will open with debugging information.
When debugging non-HTML pages, look at the headers (Most browsers: F12 -> Network tab) and locate the X-Debug-URL header.
If you open that URL, you will also get the debugging page.
In code, you can add var dumps to the debugging page by using:
dump(['foo', 'bar']);
It's also possible to add custom errors to the debugging page by using:
// notice:
trigger_error('foo bar');
// warning:
trigger_error('foo bar', E_USER_WARNING);
// or a deprecation notice:
trigger_error("Since Core v1.0.0: Test deprecation", E_USER_DEPRECATED);
For Windows Developers
In the bin folder, a few batch files exist, to make development easier.
If you install Docker Desktop for Windows, you can use bin\composer.bat, bin\phpcs.bat, bin\phpunit.bat, bin\phpstan.bat and bin\security-checker.bat as shortcuts for Composer, CodeSniffer, PHPUnit, PHPStan and the Security Checker, without the need of installing PHP and other dependencies on your machine.
The same Docker container and tools are used in Bitbucket Pipelines to automatically test this project.
统计信息
- 总下载量: 991
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: CC-BY-SA-4.0
- 更新时间: 2021-08-19