[Tickets] New ticket (114): Horde relocatability

bugs at bugs.horde.org bugs at bugs.horde.org
Fri Apr 23 11:46:34 PDT 2004


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

-Ticket 114
-Queue: Horde Base
-Created By: 

-Summary:
Horde relocatability

Comment by mike at nerone.org on Fri Apr 23 11:46:34 2004 (today):
Currently, users are forced to edit registry.php when putting Horde in any
hierarchy other than "/horde". The code already uses the "__FILE__" constant
in other areas, and this can easily be used to remove this burden on users.

An easy example of how useful this is is that it would allow someone to
create a Horde-only site simply by setting the DocumentRoot to the horde
directory. It also has the benefit of being trivially easy. My example below
is a replacement for the horde stanza in registry.php. It only adds two
lines and modifies three others. It works as-is, though a proper
implementation would have a bit more sanity-checking, I should think. It
should also look less kludgy, of course. :D

==========
$webrootkludge = str_replace('/config/registry.php', '',
str_replace($_SERVER['DOCUMENT_ROOT'], '', __FILE__));
$webrootkludgecookie = $webrootkludge or $webrootkludgecookie = '/';

$this->applications['horde'] = array(
    'fileroot' => dirname(__FILE__) . '/..',
    'webroot' => $webrootkludge,
    'initial_page' => 'login.php',
    'icon' => "$webrootkludge/graphics/home.gif",
    'name' => _("Horde"),
    'allow_guests' => true,
    'status' => 'active',
    'templates' => dirname(__FILE__) . '/../templates',
    'cookie_domain' => $_SERVER['SERVER_NAME'],
    'cookie_path' => $webrootkludgecookie,
    'server_name' => $_SERVER['SERVER_NAME'],
    'server_port' => $_SERVER['SERVER_PORT']
);
==========

The above is my change against 2.2.5 Final and that's what I posted this bug
for, but my opinion is that it should be used for all future versions,
unless, of course, this presents a specific problem. If that's the case,
please enlighten me. I've actually tried to figure out why something so easy
wasn't done already.

--


http://bugs.horde.org/details.php?id=114

-- 
This mail was automatically generated by Tickets (http://bugs.horde.org/).


More information about the bugs mailing list