| Conditions | 4 |
| Paths | 5 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | function PSFSAutoloader($class) |
||
| 12 | { |
||
| 13 | // it only autoload class into the Rain scope |
||
| 14 | if (strpos($class, 'PSFS') !== false) { |
||
| 15 | |||
| 16 | // Change order src |
||
| 17 | $class = str_replace('PSFS', '', $class); |
||
| 18 | // transform the namespace in path |
||
| 19 | $path = str_replace("\\", DIRECTORY_SEPARATOR, $class); |
||
| 20 | |||
| 21 | // filepath |
||
| 22 | $abs_path = SOURCE_DIR . DIRECTORY_SEPARATOR . $path . ".php"; |
||
| 23 | if (!file_exists($abs_path)) { |
||
| 24 | pre('→ ' . $class); |
||
| 25 | pre('→ ' . $path); |
||
| 26 | pre('→ ' . $abs_path); |
||
| 27 | } |
||
| 28 | |||
| 29 | // require the file |
||
| 30 | if (file_exists($abs_path)) { |
||
| 31 | require_once $abs_path; |
||
| 32 | } |
||
| 33 | } |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | |||
| 40 |