Skip to content

Latest commit

 

History

History
81 lines (64 loc) · 2.02 KB

MANUAL.md

File metadata and controls

81 lines (64 loc) · 2.02 KB

Manual

Installation

1. Download and set autoload

Download this library, extract and rename this folder to ci4-debug-toolbar. Enable it by editing app/Config/Autoload.php and adding the Nfaiz\DebugToolbar namespace to the $psr4 array.
See namespace for more information.

E.g Using app/ThirdParty directory path:

    $psr4 = [
        APP_NAMESPACE => APPPATH, // For custom app namespace
        'Config'      => APPPATH . 'Config',
        'Nfaiz\DebugToolbar' => APPPATH . 'ThirdParty\ci4-debug-toolbar\src',
    ];

2. Install Highlight.php

Install package via composer:

composer require scrivo/highlight.php:^v9.18

Setup

In app/Config directory edit

1. Events

app/Config/Events.php

Change database collector namespace

From

Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');

To

// Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
Events::on('DBQuery', 'Nfaiz\DebugToolbar\Collectors\Database::collect');

2. Toolbar

app/Config/Toolbar.php

i. Change database collector namespace

From

use CodeIgniter\Debug\Toolbar\Collectors\Database;

To

// use CodeIgniter\Debug\Toolbar\Collectors\Database;
use Nfaiz\DebugToolbar\Collectors\Database;

ii. Add $sqlCssTheme property

    public $maxQueries = 100;

    /**
     * -------------------------------------------------------------
     * SQL CSS Theme
     * -------------------------------------------------------------
     * 
     * Configuration for light and dark mode SQL syntax highlighter.
     * 
     * @var array
     */
    public $sqlCssTheme = [
        'light' => 'default',
        'dark'  => 'dark'
    ];