Basic implementation event signup

This commit is contained in:
2024-05-27 16:59:30 +02:00
parent a66f2d2422
commit a69d83bc0a
321 changed files with 138376 additions and 644 deletions

View File

@ -0,0 +1,42 @@
<?php
namespace Dompdf;
/**
* Autoloads Dompdf classes
*
* @package Dompdf
*/
class Autoloader
{
const PREFIX = 'Dompdf';
/**
* Register the autoloader
*/
public static function register()
{
spl_autoload_register(array(new self, 'autoload'));
}
/**
* Autoloader
*
* @param string
*/
public static function autoload($class)
{
if ($class === 'Cpdf') {
require_once __DIR__ . "/../lib/Cpdf.php";
return;
}
$prefixLength = strlen(self::PREFIX);
if (0 === strncmp(self::PREFIX, $class, $prefixLength)) {
$file = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, $prefixLength));
$file = realpath(__DIR__ . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php');
if (file_exists($file)) {
require_once $file;
}
}
}
}