-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,41 @@ | ||
# Apitte/Debug | ||
# Apitte Debug | ||
|
||
## Content | ||
Debug tools for [Apitte](https://github.com/apitte/core), based on [Tracy debugger](https://github.com/nette/tracy). | ||
|
||
- [Installation - how to register a plugin](#plugin) | ||
- [Tracy - debugging](#tracy) | ||
- [Bridges - extra features](#bridges) | ||
- [Playground - real examples](#playground) | ||
## Setup | ||
|
||
## Plugin | ||
First of all, setup [core](https://github.com/apitte/core) package. | ||
|
||
This plugin requires [Apitte/Core](https://github.com/apitte/core) library. | ||
Install and register debug plugin | ||
|
||
At first you have to register the main extension. | ||
|
||
```yaml | ||
extensions: | ||
api: Apitte\Core\DI\ApiExtension | ||
```bash | ||
composer require apitte/debug | ||
``` | ||
|
||
Secondly, add the `DebugPlugin` plugin. | ||
|
||
```yaml | ||
api: | ||
plugins: | ||
plugins: | ||
Apitte\Debug\DI\DebugPlugin: | ||
debug: %debugMode% | ||
``` | ||
## Tracy | ||
This plugin adds 2 Tracy extensions: | ||
|
||
- panel | ||
- bluescreen panel | ||
|
||
## Bridges | ||
|
||
### Apitte/Negotiation | ||
- bar panel - displays all router | ||
- blue screen panel - displays endpoint with invalid schema | ||
This plugin also adds some extra features if you use `apitte/negotiation`. At first take a [quick look at documentation](https://github.com/apitte/negotiation/tree/master/.docs). | ||
## Negotiation | ||
This plugins register 2 more transformers: | ||
If you have [negotiation](https://github.com/apitte/negotiation) plugin installed then you will be able to use two new suffixes. | ||
- `DebugTransformer` - You can type `example.com/user.debug` and you'll see dump of `Apitte\Core\Http\ApiResponse`. In case of exception, you'll see the Tracy-exception. | ||
With these suffixes you will also be able to see **Tracy bar** | ||
- `DebugDataTransformer` - You can type `example.com/user.debugdata` and you'll see dump of response entity data. | ||
`.debug` | ||
|
||
## Playground | ||
- dumps response | ||
- `example.com/api/v1/users.debug` | ||
|
||
I've made a repository with full applications for education. | ||
`.debugdata` | ||
|
||
Take a look: https://github.com/apitte/playground | ||
- dumps response entity | ||
- `example.com/api/v1/users.debugdata` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters