Page 1 of 1

DOC Root setting in config.php

PostPosted: Thu Nov 12, 2009 1:08 am
by tvjames
Hi everyone

Would it not be a feasible option to use $_SERVER['DOCUMENT_ROOT'] in the config.php file to set the DOC_ROOT variable which we normally use in ALL our projects?

Won’t it fetch the document root path for us?

If so we can be 100% sure that we always get the right document root.

If this is found to be a feasible option, would really appreciate if this can be followed MANDATORILY by all programmers.

Silvester/Jay please do ponder on this.

Looking forward to your comments.

Re: DOC Root setting in config.php

PostPosted: Thu Nov 12, 2009 1:44 am
by silvester
$_SERVER['DOCUMENT_ROOT'] can be given to set the DOC_ROOT variable. Most of the open sources are following this pattern.

But in the local server we are building the project inside the respective sites folder. So we need to specify the rest of the folder path too.

ex: techwyse is a project inside wyseguyz folder so if we take $_SERVER['DOCUMENT_ROOT'] then we will be getting only /var/www/. Actually its path should be /var/www/wyseguyz/techwyse/.

The config file should be created by Tl's only so that no confusions arise.