From 90b3b85a3271926de94f2eef9fe895599d3cce3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Dec 2010 10:39:41 +0000 Subject: [PATCH] Qual: Removed useless function. A "require" must be done only for "main", all other includes must use "include" that is better to allow error management. --- htdocs/lib/functions.lib.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 2120c81f418..2e5691749fa 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -86,6 +86,10 @@ function dol_getprefix() /** * Make an include_once using default root and alternate root if it fails. + * WARNING: In most cases, you should not use this function: + * To link to a core file, use include(DOL_DOCUMENT_ROOT.'/pathtofile') + * To link to a module file from a module file, use include('./mymodulefile'); + * To link to a module file from a core file, then this function can be used. * @param relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...) * @return int Result */ @@ -95,16 +99,6 @@ function dol_include_once($relpath) return include_once(dol_buildpath($relpath)); } -/** - * Make an require_once using default root and alternate root if it fails. - * @param relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...) - * @return int Result - */ -function dol_require_once($relpath) -{ - global $conf,$langs,$user,$mysoc; // Other global var must be retreived with $GLOBALS['var'] - return require_once(dol_buildpath($relpath)); -} /** * Return path of url or filesystem. Return default_root or alternate root if file_exist fails.