HEX
Server: Apache
System: Linux srv13.cpanelhost.cl 3.10.0-962.3.2.lve1.5.38.el7.x86_64 #1 SMP Thu Jun 18 05:28:41 EDT 2020 x86_64
User: cca63905 (4205)
PHP: 7.3.20
Disabled: NONE
Upload Files
File: /home4/cca63905/www/guiaweb/htdocs/debugbar/class/autoloader.php
<?php
/* Copyright (C) 2024		MDW							<mdeweerd@users.noreply.github.com>
 */
/**
 * Simple autoloader, so we don't need Composer just for this.
 *
 * @phan-file-suppress PhanTypeMismatchArgumentInternal
 */

spl_autoload_register(
	/**
	 * @param string	$class	Class to load
	 * @return bool				If class could be loaded
	 */
	static function ($class) {
		if (preg_match('/^DebugBar/', $class)) {
			$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;
	}
);