dolibarr 19.0.4
autoloader.php
1<?php
6spl_autoload_register(function ($class) {
7 if (preg_match('/^DebugBar/', $class)) {
8 $file = DOL_DOCUMENT_ROOT.'/includes/maximebf/debugbar/src/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
9 //var_dump($class.' - '.file_exists($file).' - '.$file);
10 if (file_exists($file)) {
11 require_once $file;
12 return true;
13 }
14 return false;
15 }
16 if (preg_match('/^'.preg_quote('Psr\Log', '/').'/', $class)) {
17 $file = DOL_DOCUMENT_ROOT.'/includes/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
18 //var_dump($class.' - '.file_exists($file).' - '.$file);
19 if (file_exists($file)) {
20 require_once $file;
21 return true;
22 }
23 return false;
24 }
25 if (preg_match('/^'.preg_quote('Symfony\Component\VarDumper', '/').'/', $class)) {
26 $class = preg_replace('/'.preg_quote('Symfony\Component\VarDumper', '/').'/', '', $class);
27 $file = DOL_DOCUMENT_ROOT.'/includes/symfony/var-dumper/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
28 if (file_exists($file)) {
29 require_once $file;
30 return true;
31 }
32 return false;
33 }
34 return true;
35});