I’ve developed a PHP Application Development Platform that I want to use for all the projects I’m going to be working on.
However, rather than installing the framework on all the multiple projects, I want to house it in a CDN (a la Rackspace Cloud Files) and then include the parts I need when I need it.
include("<path_to_cdn>/myfile.php");
I see this a lot with Javascript (e.g. JQuery), however I’m unsure if it’s the right approach for PHP.
Kindly advise.
Thanks.
No; the performance of remote
include()is very poor. (Consider that PHP must fetch and reparse the content on every request — PHP opcode caches only work for local includes.) Also keep in mind that newer versions of PHP disableallow_url_includeby default for security reasons.