07-20-2023, 05:18 AM
I have a big PHP project in which I didn't use any framework (nor MVC pattern), and I want to gradually port it on Laravel with (almost) no downtime.
<br/>I'm searching for ways of making transparent the migration for pieces of code already ported to Laravel, while mantaining functional older plain PHP code.
<br/><br/>For example, Laravel "overwrites" superglobals ($_GET, $_POST, etc.) using classes and methods, (ex. Input::get()). My plain PHP project of course makes direct use of superglobals. How can I overcome these "uncompatibilities" under Laravel without having to rewrite instantly all my PHP code?<br/><br/>Otherwise, if you think this task being too difficult, is there any PHP framework that, thanks to its internal structure, would make this task easier?
***UPDATE:***<br/>
The use of superglobals is still possible in laravel. I was getting a sneaky error: Laravel internally sets error_reporting to E_ALL and shows a custom error stack trace page even for PHP E_NOTICE, but <b>without explicitly specifying the error level</b> (that it is a NOTICE error), even if this was done by default by PHP error reporting message engine.<br/><br/>Let me say, for Laravel core developers, that I consider this "partially silent" behaviour as generally misleading for any PHP developer trying to port his code on to their framework.
<br/>I'm searching for ways of making transparent the migration for pieces of code already ported to Laravel, while mantaining functional older plain PHP code.
<br/><br/>For example, Laravel "overwrites" superglobals ($_GET, $_POST, etc.) using classes and methods, (ex. Input::get()). My plain PHP project of course makes direct use of superglobals. How can I overcome these "uncompatibilities" under Laravel without having to rewrite instantly all my PHP code?<br/><br/>Otherwise, if you think this task being too difficult, is there any PHP framework that, thanks to its internal structure, would make this task easier?
***UPDATE:***<br/>
The use of superglobals is still possible in laravel. I was getting a sneaky error: Laravel internally sets error_reporting to E_ALL and shows a custom error stack trace page even for PHP E_NOTICE, but <b>without explicitly specifying the error level</b> (that it is a NOTICE error), even if this was done by default by PHP error reporting message engine.<br/><br/>Let me say, for Laravel core developers, that I consider this "partially silent" behaviour as generally misleading for any PHP developer trying to port his code on to their framework.