2019-03-16 16:27:14 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Simple autoloader, so we don't need Composer just for this.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-10-31 21:04:38 +01:00
|
|
|
spl_autoload_register(function ($class) {
|
2020-09-07 21:00:40 +02:00
|
|
|
if (preg_match('/^DebugBar/', $class)) {
|
2020-09-08 21:27:28 +02:00
|
|
|
$file = DOL_DOCUMENT_ROOT.'/includes/maximebf/debugbar/src/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
|
|
|
|
|
//var_dump($class.' - '.file_exists($file).' - '.$file);
|
|
|
|
|
if (file_exists($file)) {
|
|
|
|
|
require_once $file;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (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;
|
|
|
|
|
}
|
|
|
|
|
if (preg_match('/^'.preg_quote('Symfony\Component\VarDumper', '/').'/', $class)) {
|
|
|
|
|
$class = preg_replace('/'.preg_quote('Symfony\Component\VarDumper', '/').'/', '', $class);
|
|
|
|
|
$file = DOL_DOCUMENT_ROOT.'/includes/symfony/var-dumper/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
|
|
|
|
|
if (file_exists($file)) {
|
|
|
|
|
require_once $file;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2019-03-16 23:17:23 +01:00
|
|
|
});
|