/
loader.php
37 lines (32 loc) · 917 Bytes
/
loader.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
<?php
require 'interface.php';
$dir = opendir(dirname(__FILE__).'/classes');
while ($file = readdir($dir)) {
if ($file != '.' && $file != '..' && $file != pathinfo(__FILE__, PATHINFO_BASENAME)) {
include 'classes/'.$file;
}
}
class Debugger
{
public static $debuggerName;
public static $debuggerInstance;
private function __construct($debuggerName)
{
}
public static function setDebugger($name = 'default')
{
self::$debuggerName = $name;
$args = func_get_args();
array_shift($args);
$className = 'Debugger'.$name;
self::$debuggerInstance = new $className($args[0], $args[1]);
}
public static function getInstance()
{
return self::$debuggerInstance;
}
public static function __callStatic($name, array $args)
{
return call_user_func_array(array(self::getInstance(), $name), $args);
}
}