Doxygen: More comments

This commit is contained in:
Laurent Destailleur 2013-09-18 17:59:57 +02:00
parent 8526d34d3b
commit 04752dbfbe
3 changed files with 26 additions and 21 deletions

View File

@ -14,9 +14,10 @@
// dolibarr_main_url_root
// This parameter defines the root URL of your Dolibarr index.php page.
// It must link to the htdocs directory htdocs.
// In most cases, this is autodetected but it still required to show full
// url bookmarks for some services (ie: agenda rss export url, ...) or
// when using Apache dir aliases (autodetect fails).
// In most cases, this is autodetected but it's still required
// * to show full url bookmarks for some services (ie: agenda rss export url, ...)
// * or when using Apache dir aliases (autodetect fails)
// * or when using nginx (autodetect fails)
// Examples:
// $dolibarr_main_url_root='http://localhost';
// $dolibarr_main_url_root='http://mydolibarrvirtualhost';

View File

@ -145,12 +145,13 @@ if (empty($dolibarr_main_data_root))
define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter)
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents)
define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs)
// Define DOL_MAIN_URL_ROOT and DOL_URL_ROOT
// Try to autodetec DOL_MAIN_URL_ROOT and DOL_URL_ROOT.
// Note: autodetect works only in case 1, 2, 3 and 4 of phpunit test CoreTest.php. For case 5, 6, only setting value into conf.php will works.
$tmp='';
$found=0;
$real_dolibarr_main_document_root=str_replace('\\','/',realpath($dolibarr_main_document_root)); // A) Ex: C:/xxx/dolibarr/htdocs
$pathroot=$_SERVER["DOCUMENT_ROOT"]; // B) Ex: C:/Program Files/wamp/www/
$paths=explode('/',str_replace('\\','/',$_SERVER["SCRIPT_NAME"])); // C) Ex: /dolibarr/htdocs/admin/system/phpinfo.php
$real_dolibarr_main_document_root=str_replace('\\','/',realpath($dolibarr_main_document_root)); // A) Value found into config file, to say where are store htdocs files. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs
$pathroot=$_SERVER["DOCUMENT_ROOT"]; // B) Value reported by web server setup, to say where is root of web server instance. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs
$paths=explode('/',str_replace('\\','/',$_SERVER["SCRIPT_NAME"])); // C) Value reported by web server, to say full path on filesystem of a file. Ex: /dolibarr/htdocs/admin/system/phpinfo.php
$concatpath='';
foreach($paths as $tmppath) // We check to find (B+start of C)=A
{

View File

@ -135,6 +135,7 @@ class CoreTest extends PHPUnit_Framework_TestCase
global $dolibarr_main_db_type;
global $dolibarr_main_db_prefix;
// Case 1:
// Test for subdir dolibarr (that point to htdocs) in root directory /var/www
// URL: http://localhost/dolibarrnew/admin/system/phpinfo.php
$_SERVER["HTTPS"]='';
@ -143,11 +144,9 @@ class CoreTest extends PHPUnit_Framework_TestCase
$_SERVER["DOCUMENT_ROOT"]='/var/www';
$_SERVER["SCRIPT_NAME"]='/dolibarrnew/admin/system/phpinfo.php';
$expectedresult='/dolibarrnew';
// Put this into conf.php if you want to test alt
//$dolibarr_main_url_root='http://localhost/dolibarralias';
//$dolibarr_main_url_root_alt='http://localhost/dolibarralias/custom2';
// Test for subdir aaa (that point to dolibarr) in root directory /var/www
// Case 2:
// Test for subdir aaa (that point to dolibarr) in root directory /var/www
// URL: http://localhost/aaa/htdocs/admin/system/phpinfo.php
$_SERVER["HTTPS"]='';
$_SERVER["SERVER_NAME"]='localhost';
@ -155,10 +154,8 @@ class CoreTest extends PHPUnit_Framework_TestCase
$_SERVER["DOCUMENT_ROOT"]='/var/www';
$_SERVER["SCRIPT_NAME"]='/aaa/htdocs/admin/system/phpinfo.php';
$expectedresult='/aaa/htdocs';
// Put this into conf.php if you want to test alt
//$dolibarr_main_url_root='http://localhost/dolibarralias';
//$dolibarr_main_url_root_alt='http://localhost/dolibarralias/custom2';
// Case 3:
// Test for virtual host localhostdolibarrnew that point to htdocs directory with
// a direct document root
// URL: http://localhostdolibarrnew/admin/system/phpinfo.php
@ -168,10 +165,8 @@ class CoreTest extends PHPUnit_Framework_TestCase
$_SERVER["DOCUMENT_ROOT"]='/home/ldestail/workspace/dolibarr/htdocs';
$_SERVER["SCRIPT_NAME"]='/admin/system/phpinfo.php';
$expectedresult='';
// Put this into conf.php if you want to test alt
//$dolibarr_main_url_root='http://localhost/dolibarralias';
//$dolibarr_main_url_root_alt='http://localhost/dolibarralias/custom2';
// Case 4:
// Test for virtual host localhostdolibarrnew that point to htdocs directory with
// a symbolic link
// URL: http://localhostdolibarrnew/admin/system/phpinfo.php
@ -181,10 +176,8 @@ class CoreTest extends PHPUnit_Framework_TestCase
$_SERVER["DOCUMENT_ROOT"]='/var/www/dolibarr'; // This is a link that point to /home/ldestail/workspace/dolibarr/htdocs
$_SERVER["SCRIPT_NAME"]='/admin/system/phpinfo.php';
$expectedresult='';
// Put this into conf.php if you want to test alt
//$dolibarr_main_url_root='http://localhost/dolibarralias';
//$dolibarr_main_url_root_alt='http://localhost/dolibarralias/custom2';
// Case 5:
// Test for alias /dolibarralias
// URL: http://localhost/dolibarralias/admin/system/phpinfo.php
$_SERVER["HTTPS"]='';
@ -195,8 +188,18 @@ class CoreTest extends PHPUnit_Framework_TestCase
$expectedresult='/dolibarralias';
// Put this into conf.php because autodetect will fails in this case
//$dolibarr_main_url_root='http://localhost/dolibarralias';
//$dolibarr_main_url_root_alt='http://localhost/dolibarralias/custom2';
// Case 6:
// Test when using nginx
// URL: https://localhost/dolibarr/admin/system/phpinfo.php
$_SERVER["HTTPS"]='';
$_SERVER["SERVER_NAME"]='localhost';
$_SERVER["SERVER_PORT"]='80';
$_SERVER["DOCUMENT_ROOT"]='/var/www/dolibarr/htdocs';
$_SERVER["SCRIPT_NAME"]='/dolibarr/admin/system/phpinfo.php';
$expectedresult='/dolibarr';
// Put this into conf.php because autodetect will fails in this case
//$dolibarr_main_url_root='http://localhost/dolibarr';
// Force to rerun filefunc.inc.php
include dirname(__FILE__).'/../../htdocs/filefunc.inc.php';