Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nfaiz/ci4-debug-toolbar
SQL Syntax Highlighter for CodeIgniter 4 Database Debug Toolbar.
https://github.com/nfaiz/ci4-debug-toolbar
codeigniter debugging php sql toolbar
Last synced: 3 months ago
JSON representation
SQL Syntax Highlighter for CodeIgniter 4 Database Debug Toolbar.
- Host: GitHub
- URL: https://github.com/nfaiz/ci4-debug-toolbar
- Owner: nfaiz
- License: mit
- Created: 2021-07-04T08:18:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-30T08:56:13.000Z (over 3 years ago)
- Last Synced: 2024-10-01T11:06:16.020Z (4 months ago)
- Topics: codeigniter, debugging, php, sql, toolbar
- Language: PHP
- Homepage:
- Size: 127 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![GitHub](https://img.shields.io/github/license/nfaiz/ci4-debug-toolbar)
![GitHub repo size](https://img.shields.io/github/repo-size/nfaiz/ci4-debug-toolbar?label=size)
![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=nfaiz/ci4-debug-toolbar)# Moved to [here](https://github.com/nfaiz/dbtoolbar)
# ci4-debug-toolbar
SQL Syntax Highlighter for CodeIgniter 4 Database Debug Toolbar.## Description
Make CodeIgniter 4 Database Debug Toolbar SQL Syntax to be **more readable and themeable**.## Table of contents
* [Requirement](Requirement)
* [Installation](#installation)
* [Setup](#setup)
* [Usage](#usage)
* [Change stylesheet](#change-stylesheet)
* [Utilities](#utilities)
* [Screenshot](#screenshots)
* [Default database toolbar](#default-database-toolbar)
* [After Using Highlighter](#after-using-highlighter)
* [Another Example](#another-example)
* [Credit](#credit)## Requirement
* [Codeigniter 4](https://github.com/codeigniter4/CodeIgniter4)
* [Highlight.php](https://github.com/scrivo/highlight.php)## Installation
Install library via composer:composer require nfaiz/ci4-debug-toolbar
Or refer [here](docs/MANUAL.md#installation) for manual installation.
## Setup
Library setup can be done via spark:php spark debugtoolbar:database
This command will try to overwrite some content in **app/Config/Events.php** and **app/Config/Toolbar.php**.
Choose overwrite [`y`] when prompted.Or refer [here](docs/MANUAL.md#setup) for manual setup.
After library installation and setup are completed, refresh page to see result.
See [usage](#usage) to configure with other pre-installed stylesheet themes.## Usage
### Change StyleSheet
Open **app/Config/Toolbar.php**.Find `$sqlCssTheme` property.
```php
public $sqlCssTheme = [
'light' => 'github',
'dark' => 'dracula'
];
```
* `light` and `dark` are mode options for CodeIghniter 4 debug toolbar.
* Assign stylesheet name without `.css` extension. E.g `'github'`
* Available stylesheets can be found using [utilities](#utilities)### Utilities
Use HighlightUtilities function from Highlight.php.
Please see [highlighter-utilities](https://github.com/scrivo/highlight.php#highlighter-utilities) for more information.E.g In **Controller**
```php
// Get available stylesheets.
$list = \HighlightUtilities\getAvailableStyleSheets();
d($list);// Set true to get available stylesheets with absolute path.
$listPath = \HighlightUtilities\getAvailableStyleSheets(true);
d($listPath);// Get specific stylesheet path.
$path = \HighlightUtilities\getStyleSheetPath('github');
d($path);
```## Screenshot
### Default Database Toolbar
* Light
* Dark
### After using highlighter
* Light (using default.css)
* Dark (using dark.css)
### Another example
* Light (using atom-one-light.css)
* Dark (using atom-one-dark.css)
## Credit
- [Highlight.php](https://github.com/scrivo/highlight.php)
- Inspired by this [pull request](https://github.com/codeigniter4/CodeIgniter4/pull/3515)