I manage a website. Let's name it Website A. Website A is written in PHP, procedural-style, with a few different and out-dated frameworks in it. No surprise, it is a mess to maintain and to upgrade. I want to create Website B with a clean framework (Symfony2) and using OOP. Slowly I will refactor Website A into Website B. Any new features will also be done in Website B.
The catch? I want content from Website A to appear in the layout of Website B. I can't simply include the files of Website A in Website B as the configuration of it messes with the framework of Website B. What's the best way to achieve it? Using an iframe? Using Curl? Or using another method?
When I tried using AJAX, the integration went smoothly. Since they're on the same domain the cookies are shared, so even if the user logs in on Website B, Website A is aware of it. It was, however, slow to output and I had problems with the responsive design (even though I know responsive iframe can be done).
When using Curl, it was much faster to output and no responsive problems. However, since it's PHP that connects to Website A, I need to find a way to pass the authentication from one Website to another.
Both methods need some work in order to function properly. I lean toward the curl method, but is there a "best practice" in my case?
Both websites has personalized content, it's not simply a firewall-type authentification.
I'm not sure whether you're authentication involves personalised content, which would be harder, or just firewalled content. This would make a difference. The best approach I've seen to this problem was to use nginx as a reverse proxy.