0

I've developed an app with CakePHP 4.4.11. In production environment, I set debug to false in app_local.php.

'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),

The app is working fine as expected, however, I noticed the tmp/debug_kit.sqlite file has been created and getting bigger even though DebugKit is not in use.

How can I completely disable or safely remove DebugKit? I did some research, but I couldn't find about it.

mmrn
  • 249
  • 2
  • 8
  • 18

1 Answers1

2

If the file keeps growing, that means that the plugin is still being loaded. Out of the box, the default application template will only load the plugin in debug mode, so maybe you don't have that set up in your app:

if (Configure::read('debug')) {
    $this->addPlugin('DebugKit');
}

https://github.com/cakephp/app/blob/4.4.1/src/Application.php#L59-L64

Another possible problem could be that the config file isn't being loaded. Out of the box, the app_local.php file overwrites settings from the app.php config file, but it's only being loaded when explicitly configured in the bootstrap:

if (file_exists(CONFIG . 'app_local.php')) {
    Configure::load('app_local', 'default');
}

https://github.com/cakephp/app/blob/4.4.1/config/bootstrap.php#L90-L92

Also there could of course be an environment variable named DEBUG be present which is set to true, being it a real environment variable, or one from a .env file.

https://github.com/cakephp/app/blob/4.4.1/config/.env.example#L17

ndm
  • 59,784
  • 9
  • 71
  • 110