I have developed my own little framework for webpages. And for different websites I had to change some parts of the framework respectively developed new features / improvements. But in some cases I missed to copy the changes in the original framework code.

How do you manage your frameworks? I copy the complete framework to a library folder in my projects folder structure. So I have a copy of the framework in every project. I would like to have it on one place in order to modify / improve / bugfix it once and then distribute it on the projects.

  • Put your framework code into a source control system like git or subversion if it's not already.

  • On your live "deployed" server, check out the code to some commonly accessible directory like /opt/mylib.

  • Configure your framework to look in /opt/mylib for your code instead of /path/to/this/site/mylib. If your code doesn't support the notion of being installed into any arbitrary location, then you can simply symlink each /path/to/this/site/mylib to /opt/mylib.

  • Make a check out in your home dir for your development work. When fixing a bug or adding a new feature, commit/push as normal.

  • If you want the live server to start using the new code, simply run "git pull" or "svn up" (or whatever) in /opt/mylib.

| improve this answer | |
  • Thanks for your advice with symlinks. I missed this possibility of linking the framework ;) – Georg Leber Mar 9 '11 at 7:52

Most languages have a way for you to use files stored in a different location. This is, for example, how django works. You will need to look at the specifics of the language you are working in for details on how to do this.

Another option is to your framework in a repository like SVN or Git. Then you create working copies for each site. If you use a graphical client, it can store all of the working copies that you have and you can just go down the list and update all of them. That way you won't miss any.

I personally use SVN for most projects and RapidSVN is a good client that stores a list of all of your working copies. I'm pretty sure Git has similar clients if you prefer Git.

| improve this answer | |

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.