CakePHP 3 のDebugKit

テスト環境でCakePHP 3 のDebugKitが読み込まれず。
あれこれ試すもダメ。
で、検索してみたら、先人の書かれた記事がありました。

http://kojirooooocks.hatenablog.com/entry/2018/04/19/021442

DebugKitのなかで、動作しているホストがローカル環境かを調べているようです。
やや無理矢理ですが、
debug_kit/src/ToolbarService.php
の isEnabled() の
if ($enabled && !$this->isSuspiciouslyProduction())

if ($enabled)
に書き換えました。

親切といえば親切、大きなお世話といえば大きなお世話ですなあ。

===追記
ログを見てたら、

Warning: DebugKit is disabling itself as your host `develop.xxxxxxx.com` is not in the known safe list of top-level-domains (localhost, dev, invalid, test, example, local). If you would like to force DebugKit on use the `DebugKit.forceEnable` Configure option.

といった内容が…
DebugKitをloadする直前で以下を追加すればOKみたいです。

Configure::write(‘DebugKit.forceEnable’, true);

https://book.cakephp.org/3.0/en/debug-kit.html#configuration

カテゴリー: Webコンテンツ パーマリンク