As I delve into OO, I was thinking about it in relation to the main app for the company I work for. Basically the app is spread over 5 servers. Each handling different stuff, but in some cases they all need to use the same classes. ErrorHandler, DirectoryManager e.t.c
Is it better to have a copy of these classes sat on the local file system for the scripts to use, or is it ok to use a URL in the require_once() function.
I know that PHP will let you use a URL, but I'm curious about it from a design point of view. Is it a good idea? or should I not touch it even with a 10 foot stick.
Thanks
Remote Classes?
Moderator: General Moderators
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
I recommend version control.
Have one server run a subversion server and then check it out somewhere for that same server to use as well as on all the other servers. If any files are changed you'll have to commit it and update on all the other servers though you could probably use a cron job to run svn update every x minutes/hours.
Have one server run a subversion server and then check it out somewhere for that same server to use as well as on all the other servers. If any files are changed you'll have to commit it and update on all the other servers though you could probably use a cron job to run svn update every x minutes/hours.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Yet even a better method is to implement a post-commit hook using a python or other such script to publish the files to the server. This way if you make an update that needs to be published immediately, you don't have to wait for the scheduled cron job to run.
http://svnbook.red-bean.com/nightly/en/ ... eate.hooks
http://svnbook.red-bean.com/nightly/en/ ... eate.hooks
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US