6.0.0-alpha12
6/7/25

[#5751] Modified _detect_webroot() to overcome installation issues
Summary Modified _detect_webroot() to overcome installation issues
Queue Horde Base
Queue Version HEAD
Type Enhancement
State No Feedback
Priority 1. Low
Owners Horde Developers (at) , mrubinsk (at) horde (dot) org
Requester todd (at) magnifisites (dot) com
Created 09/27/2007 (6463 days ago)
Due
Updated 10/24/2007 (6436 days ago)
Assigned 09/29/2007 (6461 days ago)
Resolved 10/24/2007 (6436 days ago)
Milestone
Patch No

History
10/24/2007 02:12:33 PM Chuck Hagenbuch State ⇒ No Feedback
 
09/29/2007 08:31:03 AM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Can you please create test cases for horde/lib/tests/webroot.phpt 
which cover the issues you found? All of them sound like they are 
already fixed in the current CVS version.
09/29/2007 03:31:16 AM Chuck Hagenbuch Assigned to Michael Rubinsky
Assigned to Horde DevelopersHorde Developers
 
09/29/2007 03:31:04 AM Chuck Hagenbuch Version ⇒ HEAD
State ⇒ Assigned
Queue ⇒ Horde Base
 
09/27/2007 03:12:57 PM todd (at) magnifisites (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Modified _detect_webroot() to overcome installation issues
Queue ⇒ Horde Framework Packages
New Attachment: registry.php.patch Download
State ⇒ New
Reply to this comment
Although the initial issue discovery was on a Windows install, I 
discovered another issue that impacts ANY installation.



I was having difficulty with my initial installation of Horde on a 
local Windows laptop.  I discovered that the /config/registry.php 
_detect_webroot() function was causing my issues.  I modified the 
function to use DIRECTORY_SEPARATOR to overcome the Windows-specific 
issue mentioned in the base comment.  The patch will fix Windows 
issues and work just fine in *nix installations.



One other thing I noted was that the existing code structure did not 
handle multiple directory levels deep for ANY installation, not just 
Windows.  I know it is highly improbable, but an installation to a 
directory structure such as



   /root/path/to/document_root/path/to/horde/horde/horde/config/registry.php



will incorrectly set the $web_root variable in the function as it 
exists today.  I discovered this when I created my VirtualHost 
DOCUMENT_ROOT directory as 'horde' and then extracted the horde 
application into a subdirectory of the same name within the 'horde' 
DOCUMENT_ROOT directory.  The modifications I made address this issue 
as well.



Lastly, the final modification will also allow a user to install horde 
directly into the DOCUMENT_ROOT if they so desire.  If for some odd 
reason they are opposed to creating a 'horde' directory within the 
DOCUMENT_ROOT and extract the package directly into their 
DOCUMENT_ROOT directory, the logic in the new _detect_webroot() 
function will allow such an install.  Of course, the configuration 
cookie path must also be set correctly ...



   $conf['cookie']['path'] = '/';



Hopefully I have selected the correct queue and prepared the patch 
correctly --

Todd

Saved Queries