I've developed a simple content management system in PHP, and I'd like
to be able to put the code for it in a single place, and have several
sites on one server seamlessly share the code.
I want to put the app itself in /DOCROOT/MyCMS/.
I want to put a site that uses it in, say, /DOCROOT/site1,
/DOCROOT/site2, etc.
I want to place a symlink to /DOCROOT/MyCMS/ inside each site
directory, so /DOCROOT/site1/MyCMS/index.php is reachable as expected.
Here is the problem. Each individual site will need a separate config
file. So /DOCROOT/site1/ will contain both the symlink to the CMS,
and a config.php file.
I want code in /DOCROOT/MyCMS/ to be able to
require_once(". ./config.php"). But I'm new to symlinks, and a little
testing has shown me that unix command ls seems to disagree with
itself about how to follow symlinks "backwards" . Do I need to take any
special action to make require_once() follow the symlink "back" to the
proper /DOCROOT/siteN/ directory?