| @@ -71,9 +71,22 @@ | ||
| 71 | 71 | self::$instances[$prefix] = new CJT_Framework_Autoload_Loader($prefix, $path); |
| 72 | 72 | } |
| 73 | 73 | return isset(self::$instances[$prefix]) ? self::$instances[$prefix] : null; |
| 74 | 74 | } |
| 75 | - | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * Get an already registered loader by its exact prefix. | |
| 78 | + * | |
| 79 | + * Unlike autoLoad() this never registers anything, so it is safe to call | |
| 80 | + * with a prefix that came from the request. | |
| 81 | + * | |
| 82 | + * @param string $prefix Loader prefix to look up. | |
| 83 | + * @return CJT_Framework_Autoload_Loader|null Loader when registered, NULL otherwise. | |
| 84 | + */ | |
| 85 | + public static function getRegisteredLoader($prefix) { | |
| 86 | + return isset(self::$instances[$prefix]) ? self::$instances[$prefix] : null; | |
| 87 | + } | |
| 88 | + | |
| 76 | 89 | /** |
| 77 | 90 | * Find ClassAutoloader instance used for loading specific class. |
| 78 | 91 | * |
| 79 | 92 | * The method is using Prefix algorithm for finding class autoloader |