Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ For details and older versions see [version map](https://github.com/cakephp/debu

* Install the plugin with [Composer](https://getcomposer.org/) from your CakePHP Project's ROOT directory (where the **composer.json** file is located)
```sh
php composer.phar require --dev cakephp/debug_kit:"^5.0"
php composer.phar require --dev cakephp/debug_kit:"^6.0"
```

* [Load the plugin](https://book.cakephp.org/5/en/plugins.html#loading-a-plugin)
* [Load the plugin](https://book.cakephp.org/6/en/plugins.html#loading-a-plugin)
```
bin/cake plugin load DebugKit --only-debug
```
Expand Down Expand Up @@ -60,7 +60,7 @@ requests](https://help.github.com/articles/using-pull-requests) or open
## Documentation

Documentation for DebugKit can be found in the
[CakePHP documentation](https://book.cakephp.org/debugkit/5/en/index.html).
[CakePHP documentation](https://book.cakephp.org/debugkit/6/en/index.html).

## Panels
Panels by other plugins:
Expand Down
11 changes: 6 additions & 5 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const tocJa = require('./toc_ja.json')
const tocPt = require('./toc_pt.json')

const versions = {
text: '5.x',
text: '6.x',
items: [
{ text: '5.x (current)', link: 'https://book.cakephp.org/debugkit/5/', target: '_self' },
{ text: '6.x (current)', link: 'https://book.cakephp.org/debugkit/6/', target: '_self' },
{ text: '5.x', link: 'https://book.cakephp.org/debugkit/5/', target: '_self' },
{ text: '4.x', link: 'https://book.cakephp.org/debugkit/4/en/', target: '_self' },
],
}
Expand All @@ -20,12 +21,12 @@ export default {
srcDir: '.',
title: 'DebugKit',
description: 'CakePHP DebugKit Documentation',
base: '/debugkit/5/',
base: '/debugkit/6/',
rewrites: {
'en/:slug*': ':slug*',
},
sitemap: {
hostname: 'https://book.cakephp.org/debugkit/5/',
hostname: 'https://book.cakephp.org/debugkit/6/',
},
themeConfig: {
siteTitle: false,
Expand All @@ -34,7 +35,7 @@ export default {
{ icon: 'github', link: 'https://github.com/cakephp/debug_kit' },
],
editLink: {
pattern: 'https://github.com/cakephp/debug_kit/edit/5.x/docs/:path',
pattern: 'https://github.com/cakephp/debug_kit/edit/6.x/docs/:path',
text: 'Edit this page on GitHub',
},
sidebar: tocEn,
Expand Down
8 changes: 7 additions & 1 deletion docs/en/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration

DebugKit supports several configuration keys that let you tailor the toolbar for local development.
DebugKit supports several configuration keys that let you tailor the toolbar for local development. Every key below is listed with its default value in DebugKit's `config/app.example.php`, which you can copy into your application's `config` directory.

* `DebugKit.panels` enables or disables individual panels:

Expand Down Expand Up @@ -32,6 +32,12 @@ Configure::write('DebugKit.forceEnable', function () {
Configure::write('DebugKit.ignorePathsPattern', '/\.(jpg|png|gif)$/');
```

* `DebugKit.requestCount` controls how many requests are kept in the History panel. The default is `20`:

```php
Configure::write('DebugKit.requestCount', 50);
```

* `DebugKit.maxDepth` controls how many levels of nested data are rendered in general debug output. The default is `5`.
* `DebugKit.variablesPanelMaxDepth` controls how many levels of nested data are rendered in the Variables panel. The default is `5`.

Expand Down
6 changes: 3 additions & 3 deletions docs/en/custom-panels.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ Custom panels must extend `DebugPanel`.

## Callbacks

Panel objects hook into the current request through the `Controller.initialize` and `Controller.shutdown` events by default. If your panel needs additional events, implement `implementedEvents()` and return the full event map your panel requires.
By default panels only subscribe to the `Controller.shutdown` event, which is where `shutdown()` collects the panel data. The `initialize()` hook is called for every loaded panel by DebugKit's middleware before the controller runs. If your panel needs additional events, implement `implementedEvents()` and return the full event map your panel requires.

The built-in panels are the best reference when you need examples.

## Panel Elements

Each panel should have a matching view element that renders the panel content. The element name is the underscored form of the class name:

* `SessionPanel` maps to `session_panel.php`
* `SqllogPanel` maps to `sqllog_panel.php`
* `CachePanel` maps to `cache_panel.php`
* `SqlLogPanel` maps to `sql_log_panel.php`

Store panel elements in `templates/element`.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DebugKit stores panel data in a database. The default setup uses SQLite through
Install the plugin with Composer from your application's root directory:

```bash
php composer.phar require --dev cakephp/debug_kit:"^5.0"
php composer.phar require --dev cakephp/debug_kit:"^6.0"
```

Then load the plugin in debug mode:
Expand Down
12 changes: 7 additions & 5 deletions docs/en/toolbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ The DebugKit toolbar appears after you click the CakePHP icon in the lower-right
Built-in panels include:

* **Cache** shows cache usage during the request and lets you clear caches.
* **Deprecations** renders deprecation warnings in a less disruptive format.
* **Environment** shows PHP and CakePHP environment details.
* **History** lists previous requests and lets you inspect their panel data.
* **Include** groups included files by type.
* **Log** shows log entries created during the request.
* **Packages** lists installed dependencies, their versions, and outdated packages.
* **Mail** captures mail sent during the request and supports previews.
* **Packages** lists installed dependencies, their versions, and outdated packages.
* **Plugins** lists the plugins loaded by the application.
* **Request** shows request data, route information, cookies, and request parameters.
* **Session** displays the active session contents.
* **Sql Logs** shows SQL logs for each datasource.
* **Routes** lists the routes matched during the request.
* **Sql Log** shows SQL logs for each datasource.
* **Timer** displays timers from `DebugKit\DebugTimer` and memory readings from `DebugKit\DebugMemory`.
* **Variables** shows view variables set in the controller.
* **Deprecations** renders deprecation warnings in a less disruptive format.

The deprecated **Include** and **Session** panels still exist but are disabled by default. Use the Environment panel instead of Include, and the Request panel instead of Session.

You can use the built-in panels as-is or register your own custom panels alongside them.
17 changes: 10 additions & 7 deletions docs/fr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Par défaut, DebugKit est installé avec le squelette d'application. Si vous l'avez retiré, réinstallez-le depuis le répertoire racine de l'application :

```bash
php composer.phar require --dev cakephp/debug_kit:"^5.0"
php composer.phar require --dev cakephp/debug_kit:"^6.0"
```

Chargez ensuite le plugin :
Expand All @@ -31,18 +31,21 @@
Chaque panneau inspecte un aspect différent de l'application :

* **Cache** montre l'utilisation du cache et permet de le vider.
* **Deprecations** affiche les avertissements de dépréciation dans un format moins intrusif.
* **Environment** affiche les variables d'environnement liées à PHP et CakePHP.
* **History** affiche la liste des requêtes précédentes et permet de recharger leurs données.
* **Include** montre les fichiers inclus par type.
* **Log** affiche les écritures de log de la requête.
* **Packages** affiche les dépendances installées et les versions obsolètes.
* **Mail** affiche les emails envoyés pendant la requête.
* **Packages** affiche les dépendances installées et les versions obsolètes.
* **Plugins** liste les plugins chargés par l'application.
* **Request** affiche les informations de requête, de route et les cookies.
* **Session** affiche le contenu de la session.
* **Sql Logs** affiche les logs SQL pour chaque connexion.
* **Routes** liste les routes correspondantes à la requête.
* **Sql Log** affiche les logs SQL pour chaque connexion.
* **Timer** affiche les timers créés avec `DebugKit\\DebugTimer` ainsi que l'usage mémoire via `DebugKit\\DebugMemory`.
* **Variables** affiche les variables de vue définies par le contrôleur.

Les panneaux dépréciés **Include** et **Session** existent toujours mais sont désactivés par défaut. Utilisez le panneau Environment à la place de Include, et le panneau Request à la place de Session.

## Utiliser le panneau History

Le panneau History permet de consulter les données de requêtes précédentes, y compris après une erreur ou une redirection.
Expand All @@ -51,13 +54,13 @@

Lorsque des données historiques sont chargées, les titres des panneaux changent pour indiquer que vous ne regardez plus la requête active.

<video controls preload="metadata" src="/history-panel-use.mp4"></video>

Check failure on line 57 in docs/fr/index.md

View workflow job for this annotation

GitHub Actions / validate / Lint Markdown

Inline HTML

docs/fr/index.md:57:1 MD033/no-inline-html Inline HTML [Element: video] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md

## Utiliser le panneau Mail

Le panneau Mail permet de suivre tous les emails envoyés pendant une requête.

<video controls preload="metadata" src="/mail-panel.mp4"></video>

Check failure on line 63 in docs/fr/index.md

View workflow job for this annotation

GitHub Actions / validate / Lint Markdown

Inline HTML

docs/fr/index.md:63:1 MD033/no-inline-html Inline HTML [Element: video] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md

## Développer vos propres panneaux

Expand All @@ -80,11 +83,11 @@

### Callbacks

Par défaut, les panneaux s'abonnent aux événements `Controller.initialize` et `Controller.shutdown`. Si vous avez besoin d'autres événements, implémentez `implementedEvents()`.
Par défaut, les panneaux ne s'abonnent qu'à l'événement `Controller.shutdown`, dans lequel `shutdown()` collecte les données du panneau. La méthode `initialize()` est appelée pour chaque panneau chargé par le middleware de DebugKit avant l'exécution du contrôleur. Si vous avez besoin d'autres événements, implémentez `implementedEvents()`.

### Éléments de panneau

Chaque panneau s'appuie sur un élément de vue. Le nom suit la convention underscore de la classe, par exemple `SessionPanel` devient `session_panel.php`.
Chaque panneau s'appuie sur un élément de vue. Le nom suit la convention underscore de la classe, par exemple `CachePanel` devient `cache_panel.php`.

### Titres et éléments personnalisés

Expand Down
18 changes: 11 additions & 7 deletions docs/ja/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
アプリケーションのルートディレクトリーで次を実行します。

```bash
php composer.phar require --dev cakephp/debug_kit:"^5.0"
php composer.phar require --dev cakephp/debug_kit:"^6.0"
```

続いてプラグインを有効化します。
Expand All @@ -26,6 +26,7 @@
* `DebugKit.includeSchemaReflection` を `true` にするとスキーマリフレクションのクエリーを記録します。
* `DebugKit.safeTld` でローカル開発用の TLD を追加できます。
* `DebugKit.forceEnable` で DebugKit を強制表示できます。
* `DebugKit.requestCount` で履歴パネルに保持するリクエスト数を変更できます(デフォルトは `20`)。

## データベース設定

Expand All @@ -36,18 +37,21 @@
DebugKit ツールバーはブラウザー右下の CakePHP アイコンから開けます。各パネルはアプリケーションの異なる側面を表示します。

* **Cache** キャッシュ使用状況の確認と削除。
* **Deprecations** 非破壊的な形式で非推奨警告を表示します。
* **Environment** PHP と CakePHP の環境情報。
* **History** 過去のリクエスト一覧とそのデータの再表示。
* **Include** 読み込まれたファイル一覧。
* **Log** リクエスト中に書かれたログ。
* **Packages** 依存パッケージとバージョン情報。
* **Mail** 送信メールの確認とプレビュー。
* **Packages** 依存パッケージとバージョン情報。
* **Plugins** アプリケーションで読み込まれたプラグインの一覧。
* **Request** 現在のリクエスト情報、ルート、Cookie。
* **Session** セッション内容。
* **Sql Logs** 接続ごとの SQL ログ。
* **Routes** リクエストでマッチしたルートの一覧。
* **Sql Log** 接続ごとの SQL ログ。
* **Timer** `DebugKit\\DebugTimer` と `DebugKit\\DebugMemory` の情報。
* **Variables** ビュー変数。

非推奨の **Include** と **Session** パネルも残っていますが、デフォルトでは無効です。Include の代わりに Environment パネル、Session の代わりに Request パネルを使ってください。

## 履歴パネルを使う

履歴パネルではエラーやリダイレクトを含む過去のリクエストを確認できます。
Expand All @@ -56,17 +60,17 @@

過去のデータが読み込まれると、パネルタイトルが切り替わり、現在のリクエストではないことが分かります。

<video controls preload="metadata" src="/history-panel-use.mp4"></video>

Check failure on line 63 in docs/ja/index.md

View workflow job for this annotation

GitHub Actions / validate / Lint Markdown

Inline HTML

docs/ja/index.md:63:1 MD033/no-inline-html Inline HTML [Element: video] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md

## メールパネルを使う

メールパネルではリクエスト中に送信されたすべてのメールを確認できます。

<video controls preload="metadata" src="/mail-panel.mp4"></video>

Check failure on line 69 in docs/ja/index.md

View workflow job for this annotation

GitHub Actions / validate / Lint Markdown

Inline HTML

docs/ja/index.md:69:1 MD033/no-inline-html Inline HTML [Element: video] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md

メールプレビューを使うと、送信前に内容を確認できます。

<video controls preload="metadata" src="/mail-previewer.mp4"></video>

Check failure on line 73 in docs/ja/index.md

View workflow job for this annotation

GitHub Actions / validate / Lint Markdown

Inline HTML

docs/ja/index.md:73:1 MD033/no-inline-html Inline HTML [Element: video] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md

### プレビュークラスの作成

Expand Down Expand Up @@ -107,11 +111,11 @@

### コールバック

デフォルトでは `Controller.initialize` と `Controller.shutdown` を購読します。追加イベントが必要なら `implementedEvents()` を定義してください。
デフォルトではパネルは `Controller.shutdown` イベントのみを購読し、`shutdown()` でパネルデータを収集します。`initialize()` はコントローラー実行前に DebugKit のミドルウェアが各パネルに対して呼び出します。追加イベントが必要なら `implementedEvents()` を定義してください。

### パネル要素

パネル表示用のビュー要素を用意します。名前はクラス名のアンダースコア形式です。例えば `SessionPanel` は `session_panel.php` を使います。
パネル表示用のビュー要素を用意します。名前はクラス名のアンダースコア形式です。例えば `CachePanel` は `cache_panel.php` を使います。

### カスタムタイトルとエレメント

Expand Down
17 changes: 11 additions & 6 deletions docs/pt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
No diretório raiz da aplicação, execute:

```bash
php composer.phar require --dev cakephp/debug_kit:"^5.0"
php composer.phar require --dev cakephp/debug_kit:"^6.0"
```

Depois carregue o plugin:
Expand All @@ -31,23 +31,28 @@
Cada painel mostra uma parte diferente da aplicação:

* **Cache** mostra o uso de cache e permite limpá-lo.
* **Deprecations** exibe avisos de depreciação de forma menos intrusiva.
* **Environment** exibe variáveis de ambiente relacionadas a PHP e CakePHP.
* **History** mostra requisições anteriores e permite recarregar seus dados.
* **Include** exibe os arquivos incluídos por tipo.
* **Log** mostra as entradas de log da requisição.
* **Mail** mostra os e-mails enviados durante a requisição e permite pré-visualização.
* **Packages** mostra as dependências instaladas e as versões desatualizadas.
* **Plugins** lista os plugins carregados pela aplicação.
* **Request** exibe dados da requisição atual, rota e cookies.
* **Session** exibe o conteúdo da sessão.
* **Sql Logs** mostra logs SQL por conexão.
* **Routes** lista as rotas correspondentes à requisição.
* **Sql Log** mostra logs SQL por conexão.
* **Timer** exibe timers criados com `DebugKit\\DebugTimer` e dados de memória com `DebugKit\\DebugMemory`.
* **Variables** exibe variáveis de view definidas no controller.

Os painéis depreciados **Include** e **Session** ainda existem, mas estão desativados por padrão. Use o painel Environment no lugar do Include e o painel Request no lugar do Session.

## Usando o painel History

O painel History permite revisar dados de requisições anteriores, incluindo erros e redirecionamentos.

![Screenshot do painel History](/history-panel.png)

<video controls preload="metadata" src="/history-panel-use.mp4"></video>

Check failure on line 55 in docs/pt/index.md

View workflow job for this annotation

GitHub Actions / validate / Lint Markdown

Inline HTML

docs/pt/index.md:55:1 MD033/no-inline-html Inline HTML [Element: video] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md033.md

## Desenvolvendo seus próprios painéis

Expand All @@ -70,11 +75,11 @@

### Callbacks

Por padrão os painéis se inscrevem nos eventos `Controller.initialize` e `Controller.shutdown`. Se precisar de eventos adicionais, implemente `implementedEvents()`.
Por padrão os painéis apenas assinam o evento `Controller.shutdown`, no qual `shutdown()` coleta os dados do painel. O hook `initialize()` é chamado para cada painel carregado pelo middleware do DebugKit antes da execução do controller. Se precisar de eventos adicionais, implemente `implementedEvents()`.

### Elementos do painel

Cada painel precisa de um elemento de view. O nome deve ser a versão underscore do nome da classe, por exemplo `session_panel.php`.
Cada painel precisa de um elemento de view. O nome deve ser a versão underscore do nome da classe, por exemplo `cache_panel.php`.

### Títulos e elementos personalizados

Expand Down
Loading