Posts Tagged PHP

Sep 14 2018

force debug on CakePHP

add forceEnable config into your config/bootstrap.php

if (Configure::read('debug')) {
    Configure::write('DebugKit', ['forceEnable' => true]);
    Plugin::load('DebugKit', ['bootstrap' => true]);
}

in config/app.php
in option "Datasources": create new sub option like this:
'debug_kit' => [
        'className' => 'Cake\Database\Connection',
        'driver' => 'Cake\Database\Driver\Mysql',
        'persistent' => false,
        'host' => DB_HOST,
        'port' => DB_PORT,
        //'port' => 'non_standard_port_number',
        'username' => DB_ACC,
        'password' => DB_PASS,
        'database' => DB_NAME,
        //'encoding' => 'utf8mb4',
        'timezone' => 'UTC',
        'flags' => [],
        'cacheMetadata' => true,
        'log' => false,'quoteIdentifiers' => false,
        'url' => env('DATABASE_URL', null),
    ]
upgrading debugKit
composer require --dev cakephp/debug_kit "~3.16.6"

loading debugKit
bin/cake plugin load DebugKit