Corrected file_exists check and little refactor
This commit is contained in:
parent
ad4512cb24
commit
bcafa2c790
@ -240,16 +240,17 @@ function dol_getprefix()
|
|||||||
*/
|
*/
|
||||||
function dol_include_once($relpath, $classname='')
|
function dol_include_once($relpath, $classname='')
|
||||||
{
|
{
|
||||||
|
$fullpath = dol_buildpath($relpath);
|
||||||
|
|
||||||
if (!file_exists($relpath)) {
|
if (!file_exists($fullpath)) {
|
||||||
dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR);
|
dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($classname) && ! class_exists($classname)) {
|
if (! empty($classname) && ! class_exists($classname)) {
|
||||||
return include dol_buildpath($relpath);
|
return include $fullpath;
|
||||||
} else {
|
} else {
|
||||||
return include_once dol_buildpath($relpath);
|
return include_once $fullpath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user