whimmel wrote on Friday, August 26, 2011:
(never realized how short that subject line field is here)
https://github.com/whimmel/openemr/tree/long-webroot
This method (adapted from an answer on stackoverflow) does a better job of determining the absolute and webroot paths of the EMR’s installation.
I’ve had to hardcode the paths previously because most of my installs involve a symlink from the DocumentRoot to somewhere else in the filesystem, particularly my development workspaces.
For example:
/var/www is the DocumentRoot
/var/www/workspace -> /home/whimmel/workspace is the symbolic link
/home/whimmel/workspace/openemr is where my local git repos lives
The existing assumption made on strlen($_SERVER trims off 8 characters and sets $webroot to be:
immel/workspace/openemr
Which clearly won’t work for me.