1

Current situation: I've got 2 different servers, each one hosting its own CI installation, and everything is working fine, except a lot of code is duplicated (custom libraries, some views, etc)

My goal: keep everything on one of the 2 servers and have the other one access those files, or even better, keep the whole installation on a third server I'm running that I use to serve unparsed PHP file (mostly for include commands) I tried changing the $system variable to the full URL of the third server (http://server.com/ci/system) but that didn't work as planned and returns an error

Is there any way to do this? Using the same /system between installations would be good, being able to share most of the /application folder as well (libraries, some views) would be even better

1

Having a server serve unparsed PHP files is a big security hole. It means anyone else would be able to read the code. What happens if you have some files with a password on there?

The other issue is speed: loading so many files (dozens, if not hundreds) from a completely different server would be very slow.

If you were hosting multiple sites on the same server it would be quite easy to do by making the system directory a symbolic link to a common location.

For sites on different servers I think the best method would be to use version control. You could create your own git repo with the shared files, then pull that down on each server. If you update CI or make other changes you commit them then pull the changes down again on each server.

If you are already using git for the sites themselves you can set up that repo as a submodule in your site's repo.

  • I'm sorry I didn't specify this earlier, but everything I'm working on is on a local network with no direct access from the internet, so security isn't a concern here (plus, it's a mere collection of classes I use across various projects so there are no sensitive informations). Apparently the repo is the best way to go here, I'll look into it – Mdk Dec 2 '14 at 8:30
  • @Mdk even so, if the files are not on the same computer it's still likely to be slow. – DisgruntledGoat Dec 2 '14 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.