-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoload.php
44 lines (40 loc) · 1.01 KB
/
autoload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
error_reporting(E_ALL);
error_reporting(-1);
ini_set('error_reporting', E_ALL);
if (!function_exists('dd')) {
function dd(...$data) {
$x = debug_backtrace();
print_r($x[0]['file'].':'.$x[0]['line'].PHP_EOL);
foreach ($data as $d) {
//var_dump($d);
echo '<pre>';
print_r($d);
echo '</pre>';
}
exit();
}
}
function d(...$data) {
$x = debug_backtrace();
print_r($x[0]['file'].':'.$x[0]['line'].PHP_EOL);
foreach ($data as $d) {
//var_dump($d);
echo '<pre>';
print_r($d);
echo '</pre>';
echo PHP_EOL;
}
}
spl_autoload_register(function ($class) {
$class = trim($class, '\\');
$path = 'PhpDom\\';
if (strpos($class, $path) === 0) {
$class = str_replace($path, '', $class);
$file = __DIR__.'/src/'.$class.'.php';
$file = str_replace('\\', '/', $file);
if (file_exists($file)) {
require_once($file);
}
}
});