Re: Common Files

From: Date: Sun, 16 Apr 2006 10:09:25 +0000
Subject: Re: Common Files
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-234067@lists.php.net to get a copy of this message
Alister Bulman wrote:
On 16/04/06, Jochem Maas <jochem@iamjochem.com> wrote:
Shaun wrote:
Hi, We have a dedicated UNIX server running FreeBSD, is it possible to set a directory where we can place a set of common files that can be used by all of our web sites?
also check out PEAR (pear.php.net) which does exactly what you asked about, the pear system may give you more/some ideas about how to structure and access you common files.
I tend to collect all my common code into a single directory heirarchy, and put a copy into the systems' PEAR directory. Then I can just go require_once 'MyCompany/filename.php'; from anywhere on the system. Until PEAR produces a module called 'MyCompany' (unlikely), it will live there entirely happily.
sounds like a good plan - in the future you could even consider setting up your own pear channel (pear server) which houses custom packages (e.g. 'MyCompany') which you could then install into any pear installation you need it. just a thought :-)
Alister


« previous php.general (#234067) next »