https://github.com/webrgp/craft-ignition
Ignition error handling alternative for Craft CMS
https://github.com/webrgp/craft-ignition
craftcms error-handling ignition php yii2-extension
Last synced: 6 months ago
JSON representation
Ignition error handling alternative for Craft CMS
- Host: GitHub
- URL: https://github.com/webrgp/craft-ignition
- Owner: webrgp
- License: mit
- Created: 2024-11-20T22:25:30.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-05T05:52:07.000Z (6 months ago)
- Last Synced: 2024-12-05T06:28:51.426Z (6 months ago)
- Topics: craftcms, error-handling, ignition, php, yii2-extension
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Ignition Error Handler for Craft CMS
Error handling alternative for Craft CMS that uses [Ignition](https://github.com/spatie/ignition) for better developer experience.

## Requirements
- Craft CMS 4.3.0 or higher
- PHP 8.0 or higher## Installation
You can install the plugin via Composer:
```bash
composer require webrgp/craft-ignition# OR if you only want to use it in development
composer require webrgp/craft-ignition --dev
```This extension will bootstrap itself automatically once installed. Now you can enjoy Ignition's beautiful error pages in your Craft CMS project.
## Customizing Ignition
You can configure Ignition by adding the following settings to your `.env` file:
```env
CRAFT_IGNITION_EDITOR=vscode
CRAFT_IGNITION_THEME=light
CRAFT_IGNITION_REMOTE_SITES_PATH=/var/www/html
CRAFT_IGNITION_LOCAL_SITES_PATH=/Users/yourusername/Code/YourProject
CRAFT_IGNITION_SHARE_ENDPOINT=https://flareapp.io/api/public-reports
CRAFT_IGNITION_ENABLE_SHARE_BUTTON=true
CRAFT_IGNITION_ENABLE_RUNNABLE_SOLUTIONS=true
CRAFT_IGNITION_HIDE_SOLUTIONS=false
```Or directly to the component, in your `config/app.php` file:
```php
return [
// ...
'components' => [
'errorHandler' => [
'class' => \webrgp\ignition\IgnitionErrorHandler::class,
'editor' => 'vscode',
'theme' => 'light',
'remote_sites_path' => '\your\remote\sites\path',
'local_sites_path' => '\your\local\sites\path',
'shareEndpoint' => 'https://flareapp.io/api/public-reports',
'enableShareButton' => false,
'enableRunnableSolutions' => false,
'hideSolutions' => true,
'editorOptions' => [],
],
],
];
```**Note:** The settings in the `config/app.php` file will override the ones in the `.env` file.
## How It Works
This package introduces the `IgnitionErrorHandler` class, which extends Craft's default `ErrorHandler` class. It overrides the `renderException` method to use Ignition's `renderException` method instead.
This way, you can enjoy Ignition's beautiful error pages while keeping the rest of Craft's error handling functionality in place.
## License
This plugin is open-sourced software licensed under the MIT license.