1 | <?php |
||
10 | class AutoLoader |
||
11 | { |
||
12 | /** |
||
13 | * @var string The namespace prefix for this instance. |
||
14 | */ |
||
15 | protected $namespace = ''; |
||
16 | |||
17 | /** |
||
18 | * @var string The filesystem prefix to use for this instance |
||
19 | */ |
||
20 | protected $path = ''; |
||
21 | |||
22 | /** |
||
23 | * Build the instance of the autoloader |
||
24 | * |
||
25 | * @param string $namespace The prefixed namespace this instance will load |
||
26 | * @param string $path The filesystem path to the root of the namespace |
||
27 | */ |
||
28 | public function __construct($namespace, $path) |
||
33 | |||
34 | /** |
||
35 | * Try to load a class |
||
36 | * |
||
37 | * @param string $class The class name to load |
||
38 | * |
||
39 | * @return boolean If the loading was successful |
||
40 | */ |
||
41 | public function load($class) |
||
61 | |||
62 | /** |
||
63 | * Register the autoloader to PHP |
||
64 | * |
||
65 | * @return boolean The status of the registration |
||
66 | */ |
||
67 | public function register() |
||
71 | |||
72 | /** |
||
73 | * Unregister the autoloader to PHP |
||
74 | * |
||
75 | * @return boolean The status of the unregistration |
||
76 | */ |
||
77 | public function unregister() |
||
81 | } |
||
82 |