[horde] trying to use symbolic links

Edward Burr horde at email.burr.cc
Thu Apr 24 20:08:27 PDT 2003


For ease of maintenance, I attempted to keep all the various
modules separate, and use symbolic links to point to them.
For example, I tried a directory structure like this:

/var/www/html/horde/horde-2.2.1/..
                   /horde-2.2.3/...
                   /imp-3.2.1/...
                   /turba-1.2/...
                   /kronolith-1.0/...
                   /kronolith-1.1-RC3/...
and so on. Then I created symbolic links like so:
                   /horde -> ./horde-2.2.3
                   /imp -> ./imp-3.2.1
                   /turba -> ./turba-1.2
                   /kronolith -> ./kronolith-1.1-RC3
                   /horde-2.2.3/imp -> ../imp
                               /turba -> ../turba
                               /kronolith -> ../kronolith
and so on. I figured this would allow me to install a new
version and get it configured without interrupting or 
possibly corrupting the working installation. Then, once
I have it configured, switch the symbolic link to the new
version and test it. If it fails, switch the link back to
the working version, and play around some more.

This fails.

It appears that when Horde encounters a symbolic link, it
resolves that to the real path, then uses the real path
in everything it does (I assume this because the error 
messages all have the real paths). That all by itself
would not be a problem. However, a number of the php files
use relative references to other files. This plays havoc
when the real directory structure is not what Horde is 
expecting, even though the symbolic links are correctly
set to mimic the correct structure.

For example, the path that *should* be used, with 
symbolic links, is:
   /var/www/html/horde/horde/imp/
When a call is made to define HORDE_BASE in imp/lib/base.php
using relative path "/../.." appended to the current path,
it ends up as
   /var/www/html/horde/imp-3.2.1/lib/../..
ending up in
   /var/www/html/horde
which causes a failure because that is not the right place.
The right place would be:
   /var/www/html/horde/horde/imp/lib/../..
ending up in
   /var/www/html/horde/horde
or, if you must resolve the symbolic link then
   /var/www/html/horde/horde-2.2.3

A structure that works, because resolving the symbolic
links does not change the relative structure, but is not
nearly as easy to update, especially when updating the
underlying horde, is:
   /var/www/html/horde/horde-2.2.1
                                  /imp-3.2.1
                                  /imp -> ./imp-3.2.1
                                  /turba-1.2
                                  /turba -> ./turba-1.2
                                  /kronolith-1.0
                                  /kronolith-1.1-RC3
                                  /kronolith -> kronolith-1.1-RC3
                      /horde-2.2.3
                                  /imp-3.2.1
                                  /imp -> ./imp-3.2.1
                                  /turba-1.2
                                  /turba -> ./turba-1.2
                                  /kronolith-1.0
                                  /kronolith-1.1-RC3
                                  /kronolith -> kronolith-1.1-RC3
                      /horde -> ./horde-2.2.3
Notice that every module is completely duplicated in each
horde update, wasting space, and causing me to have to make
the same change in multiple copies.

I know this is not very important for the day-to-day
operation, but I think what I am trying to do would be 
really nice to have working when upgrading a module or
even the underlying horde framework itself. It would allow
an easy way to maintain a working setup while installing
and configuring a new version. It would also allow a very
fast (5-10 seconds) restoration to the known working level.

I don't know what to suggest to do about this. Maybe when
I learn a little more about PHP, I could come up with some
ideas. If anyone else has any ideas on how I could get this
to work, I would love to hear them.

-- 
   * Think about it:                                     *
   *    Isn't having a smoking section in a restaurant   *
   *    like having a peeing section in a swimming pool? *



More information about the horde mailing list