2
0
forked from Wavyzz/dolibarr
Files
dolibarr-fork/htdocs/debugbar/class/autoloader.php
Scrutinizer Auto-Fixer 444c293c01 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2020-04-10 08:59:32 +00:00

19 lines
523 B
PHP

<?php
/**
* Simple autoloader, so we don't need Composer just for this.
*/
spl_autoload_register(function($class) {
if (preg_match('/^DebugBar/', $class) || preg_match('/^'.preg_quote('Psr\Log', '/').'/', $class)) {
$file = DOL_DOCUMENT_ROOT.'/includes/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
//var_dump($class.' - '.file_exists($file).' - '.$file);
if (file_exists($file)) {
require_once $file;
return true;
}
return false;
}
return true;
});