> For the complete documentation index, see [llms.txt](https://docs.cs-cart.jp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cs-cart.jp/debuging/debugger.md).

# デバッガー

{% hint style="info" %}
HINT

デバッグモードは、英語でのご提供となります。
{% endhint %}

CS-Cartはプロファイリングやログ及びデータ設定へのアクセスが簡単になる便利なデバッガを内蔵してます。

デバッガはHTTPリクエスト、SQLクエリ及びストアフロントや管理パネルの任意のページのテンプレートの読み込みを点検するために使用することが出来ます。

## デバッグモードの有効化

管理パネルでデバックモードを有効にするには、URLの文字列に`debug`パラメータを追加することでデバッグモードを起動できます。

＜画像＞

`config.php`や`local_conf.php`ファイルで以下のような一行を追加することでも、\
デバッグモードを常に有効にできます。

```php
<?php
...
define('DEBUG_MODE', true);
```

{% hint style="warning" %}
警告

開発時以外でこのモードを使用しないでください。 ショップがすでにオープンしている状態の場合、ショップに訪れる人がデバックデータへのアクセスを出来てしまいます。
{% endhint %}

デバッグモードを有効にして管理パネルにアクセスすると、ページの右上のにある半透明の虫（bug）のアイコンが表示されます。

＜画像＞

デバッガのサイドバーを開いたり閉じたりするにはそのアイコンをクリックします。\
あるいは、 `Ctrl + Alt + D` を押します。

## デバッガー・サイドバー

### Serverタブ

＜画像＞

`サーバー`タブでは、システム内のインストールされたPHPとPHPモジュールに関する情報と一般的なシステム情報が表示されます：バージョン、パス、コンフィグ変数の値、など

### Requestタブ

＜画像＞

リクエストタブでは、最新のHTTPリクエストとそれぞれのサーバーの対応に関する情報のほか、Cookieの値が表示されます。

### Configタブ

* Config

＜画像＞

値は、コンフィグレーションファイルから取り出されます。(config.php and local\_conf.php )

* Settings

＜画像＞

現在の設定値はデータベースから取り出されます。\
( `cscart_settings` tables)

* Runtime

＜画像＞

現在実行されるスクリプトに関連するデータ

### SQL

＜画像＞

このタブでは、それぞれの実行時間とページの読み込み中に実行されたSQLクエリを見ることができます。また、\_Queries parse\_タブ でカスタムSQLクエリを送信することができます。

### Logging

＜画像＞

このタブでは、メモリ消費、読み込まれたファイル数、実行されたSQLクエリ及びページの読み込みに費やされた時間のデータを見ることができます：

* 初期化の前
* 初期化後
* テンプレート読み込み前
* テンプレート読み込み後

### Templates

＜画像＞

この`テンプレート`タブでは、テンプレートの階層やページの背後のデータに関する詳細情報を確認することができます。 テンプレートツリーとすべてのテンプレートで使用される変数のリストを見つけることができます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cs-cart.jp/debuging/debugger.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
