If you're just including different files based on the request, PHP will also pass all the required $_SERVER values etc. I think this should be perfectly fine, unless someone here thinks of some issue.
Possible to include Laradock app into legacy structure?
We have kind of a special (weird) requirement. We have a legacy application, but we need to integrate a Laravel app now into this legacy application.
Here a quick overview what should work
- foo.bar.tld is hit on (legacy)
index.phpon our servers. Inindex.phpwe decide if the request should be handled by the legacy code path or not - If legacy, all good. The request is processed as usual
- If new path, the Laravel application should handle the request for the same domain
What we tried was just to include the public/index.php from the Laravel project in our legacy index.php at the very beginning. That gives a long error stack trace. :)
The problem I see here is that we just include the Laravel index.php file. But at the end, Laravel might expect this to be called (passed) from a web server. Not by a PHP include.
But this is just me guessing as I have not much experience with Laravel, and did not even create the Laravel application we need to integrate now.
Would this be possible at all at the application level?
Any input is welcome. :)
Please or to participate in this conversation.