定制 webrgp/craft-ignition-core 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webrgp/craft-ignition-core

最新稳定版本:v1.1.0

Composer 安装命令:

composer require webrgp/craft-ignition-core

包简介

Ignition error handling alternative for Craft CMS.

README 文档

README

Error handling alternative for Craft CMS that uses Ignition for better developer experience.

Screenshot of ignition

Requirements

  • Craft CMS 4.3.0 or higher
  • PHP 8.0 or higher

Installation

You can install the plugin via Composer:

composer require  --dev -W webrgp/craft-ignition-core

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:

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

How It Works

This package introduces the IgnitionErrorHandler class, which extends Craft's default ErrorHandler class. It overrides the $exceptionView property to use this package's custom exception view file, which renders Ignition's error page.

Flare Middleware

This package also includes a few middleware classes that add Craft specific data to the Ignition error report and prevent Ignition from sharing sensitive information with Flare:

AddCraftInfo middleware

This middleware Application Info, Plugins, and Modules information present in Craft's System Report to the Ignition's and Flare's error report.

CraftSensitiveKeywords middleware

This middleware prevents Ignition from sharing sensitive information with Flare. It removes sensitive information from the error report before sharing it with Flare by testing each body parameter against Craft Security's isSensitive method.

You can customize the sensitive keywords by overriding the sensitiveKeywords in the Security component of the Craft app config:

return [
    'components' => [
        'security' => [
            'class' => \craft\services\Security::class,
            'sensitiveKeywords' => [
                'lorem',
            ],
        ],
    ]
];

These are the default sensitive keywords in Craft CMS.

Censored Headers middleware

Besides the sensitive keywords, this module also censors the following headers from the error report:

  • API-KEY
  • Authorization
  • Cookie
  • Set-Cookie
  • X-CSRF-TOKEN
  • X-XSRF-TOKEN
  • ip
  • x-forwarded-for
  • x-real-ip
  • x-request-ip
  • x-client-ip
  • cf-connecting-ip
  • fastly-client-ip
  • true-client-ip
  • forwarded
  • proxy-client-ip
  • wl-proxy-client-ip

Roadmap

  • Add environment variable to disable Craft Ignition.
  • Add Craft-specific solutions to Ignition.

License

This plugin is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 290
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-19