Merge pull request #1746 from marcosgdf/patch-1

Removed @ operator from dol_include_once
This commit is contained in:
Laurent Destailleur 2014-07-20 04:43:38 +02:00
commit ffe7b531a6

View File

@ -236,16 +236,21 @@ function dol_getprefix()
* *
* @param string $relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...) * @param string $relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...)
* @param string $classname Class name * @param string $classname Class name
* @return int false if include fails. * @return bool
*/ */
function dol_include_once($relpath, $classname='') function dol_include_once($relpath, $classname='')
{ {
global $conf,$langs,$user,$mysoc; // Other global var must be retreived with $GLOBALS['var'] $fullpath = dol_buildpath($relpath);
if (!file_exists($fullpath)) {
dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR);
return false;
}
if (! empty($classname) && ! class_exists($classname)) { if (! empty($classname) && ! class_exists($classname)) {
return @include dol_buildpath($relpath); // Remove @ to find error into php log file if you have problems return include $fullpath;
} else { } else {
return @include_once dol_buildpath($relpath); // Remove @ to find error into php log file if you have problems return include_once $fullpath;
} }
} }