quantum-php-core icon indicating copy to clipboard operation
quantum-php-core copied to clipboard

refactors Mvc directory and Middleware

Open ematrito opened this issue 1 year ago • 7 comments

Hi, i'm glad to contribute to your project! i tried to refactor as issue #253 requires. I refactored the MvcManager class (renamed to RouteDispatcher) by extracting middleware and view cache logic into separate classes — MiddlewareExecutor and ViewCacheHandler. Additionally, i merged the QtController functionality into RouteController, eliminating unnecessary inheritance and simplifying the controller structure.

ematrito avatar Apr 19 '25 09:04 ematrito

I tried to resolve test errors but I'm afraid that anything went wrong on my machine, please let me know

ematrito avatar Apr 22 '25 18:04 ematrito

Hi Arno, I don't know why those 3 tests fail even with composer dump-autoload command executed. The issue called for streamlining the QtController by implementing a route dispatcher, but I'm currently struggling to find a viable solution. Could you offer some assistance?

ematrito avatar Apr 24 '25 09:04 ematrito

Hi Arno, I don't know why those 3 tests fail even with composer dump-autoload command executed. The issue called for streamlining the QtController by implementing a route dispatcher, but I'm currently struggling to find a viable solution. Could you offer some assistance?

Hello, sure, I'm happy to help you. I checked your code and identified the problems. You have 3 errors in the unit test: 2 ViewCacheHandler not found errors, and one QtController not found error.

ViewCacheHandler error: It seems that the file containing this class has the name VIewCacheHandler.php (with uppercase I). Try to correct that and see if the error persists.

QtController error: This is a bit tricky, as the ModuleManager itself doesn't use it, but the errors show that it has occurred there. The ModuleManager class serves as a tool that lets you generate modules from templates. You can see them in the Libraries/Modules/Templates folder. In the folder (which basically contains PHP files but with .tpl extension) change the use of QtController and replace it with the proper class.

I hope I explained it clearly. If you have any questions or need some help, feel free to ask.

Arno2005 avatar Apr 24 '25 10:04 Arno2005

Thank you! I'll fix asap!

ematrito avatar Apr 24 '25 12:04 ematrito

Hello, I just pushed fix commit but I haven't found VIewCacheHandler.php file (with uppercase I). I also replace QtController where not properly required

ematrito avatar Apr 28 '25 21:04 ematrito

Hello, I just pushed fix commit but I haven't found VIewCacheHandler.php file (with uppercase I). I also replace QtController where not properly required

Looks like most of the issues are resolved now, only one error is left: Error: Class 'Quantum\Handlers\ViewCacheHandler' not found this is because the class name is ViewCacheHandler whereas the class file name is VIewCacheHandler.php, see the screenshot attached.

Screenshot 2025-04-29 112006

armanist avatar Apr 29 '25 08:04 armanist

Got it! Thank you!

ematrito avatar Apr 29 '25 10:04 ematrito

Closes #256

armanist avatar Apr 30 '25 09:04 armanist