Adding App::location() method to be able to obtain the defined path for a class

This commit is contained in:
Jose Lorenzo Rodriguez 2011-07-12 00:38:50 -04:30
parent 273125d2f5
commit f8ab1d3c73
2 changed files with 23 additions and 0 deletions

View file

@ -587,6 +587,19 @@ class App {
return false;
}
/**
* Returns the package name where a class was defined to be located at
*
* @param string $className name of the class to obtain the package name from
* @return string package name or null if not declared
*/
public static function location($className) {
if (!empty(self::$__classMap[$className])) {
return self::$__classMap[$className];
}
return null;
}
/**
* Finds classes based on $name or specific file(s) to search. Calling App::import() will
* not construct any classes contained in the files. It will only find and require() the file.