joanhey / AdapterMan

Run almost any PHP app faster and asynchronously with Workerman, without touch 1 line of code in your fw or app. Also use it as Serverless.
https://twitter.com/adaptermanphp
MIT License
724 stars 45 forks source link

Can AdapterMan support E-commerce Opencart 4? #34

Open FelipoAntonoff opened 1 year ago

FelipoAntonoff commented 1 year ago

Can it support E-commerce Opencart 4?

Github: https://github.com/opencart/opencart It basically has a micro framework built natively for it and a lot of use of pure PHP, SSL and more direct session.

Uses an index.php to launch: https://github.com/opencart/opencart/blob/master/upload/index.php Which calls the framework.php and startup.php in system https://github.com/opencart/opencart/tree/master/upload/system

It should probably pick up I imagine making adjustments to index.php .

joanhey commented 1 year ago

In theory will work, but perhaps with changes.

The first thing is remove all the exit() in the code, as this will close all the app. I can't change the behavior of exit(), because is a language constructor and not a function. The best solution is use an ExitExeption : https://github.com/joanhey/AdapterMan/blob/master/src/AdapterFunctions.php#L208-L211

FelipoAntonoff commented 1 year ago

Thanks for the answer. In this case, perhaps a small reformulation of the code should solve it, too bad that some modules/plugins can use exit() and thus cause an error, but for a specific project, the adaptation may be well suited if high demand is needed.