empiricompany / maho-ignition
Error pages and diagnostics integration for Maho Commerce using Spatie Ignition.
Package info
github.com/empiricompany/maho-ignition
Type:maho-module
pkg:composer/empiricompany/maho-ignition
Requires
- php: >=8.3
- composer-runtime-api: ^2.0
- spatie/ignition: ^1.15.1
Requires (Dev)
Suggests
- openai-php/client: OpenAI API client for Ignition's OpenAI solution provider.
Provides
None
Conflicts
None
Replaces
None
README
Integrate Spatie Ignition error pages, optional OpenAI solutions, and optional Flare reporting into Maho.
Requirements
- PHP 8.3 or newer
- Maho with the
mage_run_installed_exceptionandmage_run_exceptionevents spatie/ignition1.15.1 or newer within the 1.x series
Installation
Install the module with Composer:
composer require empiricompany/maho-ignition
The package is a Maho module published as empiricompany/maho-ignition.
Configuration
Open System > Configuration > Advanced > Developer > Ignition Settings.
Available settings include:
- Enabled — Enable or disable Ignition error pages.
- Default Editor — Select the editor used by Ignition (default:
clipboard). - Default Theme — Select
auto,light, ordark(default:auto). - Save Custom Settings in Session — Allow session-based editor and theme overrides.
- Enable AI-Generated Solutions — Enable OpenAI-powered solutions.
- OpenAI API Key — Provide the key used by the optional OpenAI integration.
- Enable Flare — Send integration errors to Flare.
- Flare API Key — Provide the key for the Flare project.
- Anonymize IP — Anonymize IP addresses sent to Flare.
The Ignition UI is available only when Maho developer mode is enabled. Flare reporting is configured separately and can also send reports while developer mode is enabled; enabling Flare does not make the Ignition UI available in non-developer mode.
The OpenAI integration is optional. Enable AI-generated solutions only after installing the additional client:
composer require openai-php/client
openai-php/client is required for the AI solutions provider, but is not
required for the Ignition UI or Flare integration.
Runtime error and Flare reporting
Ignition and Flare serve two different roles:
- Developer mode renders the Ignition page for HTML requests. Ignition runs
with
inProductionEnvironment(false), which also suppresses its own Flare send, so the report Ignition already built is forwarded to Flare explicitly. Because Ignition writes a full HTML document, the response is terminated as soon as it renders (with a 500 status) soMage::printException()cannot append its raw<pre>dump after the page. This never interferes with API, AJAX or JSON requests: for those the error is reported to Flare and the response is left to Maho. - Production never instantiates Ignition.
FlareClientis used directly: it registers error/exception handlers that report to Flare and then delegate to the previous (Maho) handler, so warnings are still logged instead of being turned into fatal errors, plus a shutdown hook that reports uncatchable fatal errors (error_get_last()).
mage_run_installed_exception / mage_run_exception cover late middleware / bootstrap
exceptions. Ignition remains a developer-mode-only tool; Flare reporting is
controlled separately by whether a key is configured.
Known limits
controller_front_init_before (where the production handlers are registered)
and Mage::run() only cover web requests, so CLI and cron are not covered,
and neither are errors that happen before that event (store init, bad
local.xml, DB down) or before bootstrap at all (parse errors, missing
vendor). Fatal OOM can also prevent the shutdown hook from building the report.
Delivery failures are swallowed by the Flare client; check the Flare dashboard
and PHP/application logs separately, and never log the Flare key.
Ignition configuration endpoint
The POST /_ignition/update-config endpoint is available through the
developer/ignition path and accepts a JSON request body. The implementation
accepts only these configuration keys:
theme—auto,light, ordark.editor— one of the editor options exposed by Ignition.
Screenshots
| Ignition error page | Flare |
|---|---|
| ) |
License
This module is released under the Open Software License 3.0 (OSL-3.0). See LICENSE.txt.