Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Laravel Ignition #3954

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Added support for Laravel Ignition #3954

merged 2 commits into from
Apr 24, 2024

Conversation

fballiano
Copy link
Contributor

@fballiano fballiano commented Apr 23, 2024

Laravel Ignition is a pretty famous module for a better handling of error pages: https://flareapp.io/docs/ignition/introducing-ignition/overview

I thought it could be interesting for developers to have built-in, but absolutely optional (it's a pretty big package) in openmage.

The logic is:

  • if there's a PHP error or exception
  • and is in DeveloperMode
  • and the spatie-ignition composer module is installed
  • then the error is passed to ignition for the display

If DeveloperMode is disabled or the spatie-ignition package is not installed, OM behaves as usual.
It shouldn't introduce any performance degradation.

This is the error page for a PHP error (function doesn't exist):
Screenshot 2024-04-23 alle 13 25 13

This is the error page for a default PHP exception:
Screenshot 2024-04-23 alle 13 25 44

And this is a Mage::throwException:
Screenshot 2024-04-23 alle 13 25 58

How to test

  1. composer require "spatie/ignition" (as of 24 april 2024 you also need composer require laravel/serializable-closure)
  2. enable developer mode
  3. modify one of your files in order to generate an error

@github-actions github-actions bot added Component: Core Relates to Mage_Core Mage.php Relates to app/Mage.php labels Apr 23, 2024
@fballiano fballiano merged commit fd3b1ab into OpenMage:next Apr 24, 2024
17 checks passed
@fballiano fballiano deleted the ignitionsupport branch April 24, 2024 06:49
@empiricompany
Copy link
Contributor

For those who want to try it immediately on latest v20.6.0

composer require "spatie/ignition"

add to your composer.json

"extra": {
    "enable-patching": true,
    "magento-force": true,
    "magento-core-package-type": "magento-source",
    "magento-root-dir": ".",
    "patches": {
        "openmage/magento-lts": {
            "Added support for Laravel Ignition #3954": "https://github.com/OpenMage/magento-lts/pull/3954.patch"
        }
    }
}

composer update

@empiricompany
Copy link
Contributor

if i want to change theme here:
settings
this attempt to make this post request
post

@fballiano
Copy link
Contributor Author

yep I don't think this "save configuration" works at all

@empiricompany
Copy link
Contributor

yep I don't think this "save configuration" works at all

I started a discussion on how to better implement the integration:
#3955

@freekmurze
Copy link

Hi there 👋 Ignition creator here! It's cool that you're considering using our error page in Magento.

I notice that this merge was already reverted. If I can help in any way with integration this in Magento let me know! All questions welcome.

@empiricompany
Copy link
Contributor

Hi @freekmurze! Thank you for your awesome package!
We've decided to integrate Ignition in OpenMage via an external package:
https://github.com/empiricompany/openmage_ignition/

As developer of the package empiricompany/openmage_ignition, is it possible to obtain a developer license for Flare ?
I am currently in the trial period, which expires in 10 days.

We've also opened a PR to list our module among the compatible platforms:
spatie/ignition#628

@fballiano
Copy link
Contributor Author

Hi @freekmurze it's an honor to have you here, as @empiricompany was saying we created a much better solution to integrate Ignition in OpenMage in an external module , supporting Flare and OpenAI suggestions ;-)

@freekmurze
Copy link

@empiricompany I can give you a coupon so you can use Flare for free. Send a mail to [email protected] if you'd like that coupon 👍

@freekmurze
Copy link

I think Magento 2 could also benefit from having Ignition as its error page. Unfortunately, I'm not that familiar with the Magento community where I should pitch that idea.

If you think the maintainers of Magento 2 might be interested, feel free to send them my way should they have questions.

@fballiano
Copy link
Contributor Author

@freekmurze Magento2 already has this: https://github.com/swissup/module-ignition ;-)

fballiano added a commit that referenced this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Relates to Mage_Core Mage.php Relates to app/Mage.php
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants