1 | <?php |
||
57 | class Psr4Autoloader { |
||
58 | |||
59 | /** |
||
60 | * namespace separator |
||
61 | */ |
||
62 | const NS = '\\'; |
||
63 | |||
64 | /** |
||
65 | * An associative array where the key is a namespace prefix and the value |
||
66 | * is an array of base directories for classes in that namespace. |
||
67 | * |
||
68 | * @var array |
||
69 | */ |
||
70 | protected $prefixes = array(); |
||
71 | |||
72 | |||
73 | |||
74 | /** |
||
75 | * returns an array of registered namespace prefixes |
||
76 | * |
||
77 | * @param string $prefix |
||
78 | * @return array |
||
79 | */ |
||
80 | public function prefixes( $prefix = '' ) { |
||
87 | |||
88 | |||
89 | |||
90 | /** |
||
91 | * Register loader with SPL autoloader stack. |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | public function register() { |
||
98 | |||
99 | |||
100 | |||
101 | /** |
||
102 | * Adds a base directory for a namespace prefix. |
||
103 | * |
||
104 | * @param string $prefix The namespace prefix. |
||
105 | * @param string $base_dir A base directory for class files in the |
||
106 | * namespace. |
||
107 | * @param bool $prepend If true, prepend the base directory to the stack |
||
108 | * instead of appending it; this causes it to be searched first rather |
||
109 | * than last. |
||
110 | * @return void |
||
111 | */ |
||
112 | public function addNamespace( $prefix, $base_dir, $prepend = false ) { |
||
128 | |||
129 | |||
130 | |||
131 | /** |
||
132 | * Loads the class file for a given class name. |
||
133 | * |
||
134 | * @param string $class The fully-qualified class name. |
||
135 | * @return mixed The mapped file name on success, or boolean false on |
||
136 | * failure. |
||
137 | */ |
||
138 | public function loadClass( $class ) { |
||
160 | |||
161 | |||
162 | |||
163 | /** |
||
164 | * Load the mapped file for a namespace prefix and relative class. |
||
165 | * |
||
166 | * @param string $prefix The namespace prefix. |
||
167 | * @param string $relative_class The relative class name. |
||
168 | * @return mixed Boolean false if no mapped file can be loaded, or the |
||
169 | * name of the mapped file that was loaded. |
||
170 | */ |
||
171 | protected function loadMappedFile( $prefix, $relative_class ) { |
||
189 | |||
190 | |||
191 | |||
192 | /** |
||
193 | * If a file exists, require it from the file system. |
||
194 | * |
||
195 | * @param string $file The file to require. |
||
196 | * @return bool True if the file exists, false if not. |
||
197 | */ |
||
198 | protected function requireFile( $file ) { |
||
205 | |||
206 | |||
207 | |||
208 | } |
||
209 | // End of file Psr4Autoloader.php |
||
210 | // Location: /core/Psr4Autoloader.php |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: