public function addClass($class, $basePath = '')
{
$this->loadCache();
if (!$this->cached) {
if (is_string($class) && !class_exists($class)) {
throw new Exception('Invalid method or class');
} elseif (!is_string($class) && !is_object($class)) {
throw new Exception('Invalid method or class; must be a classname or object');
}
if (substr($basePath, 0, 1) == '/') {
$basePath = substr($basePath, 1);
}
if ($basePath && substr($basePath, -1) != '/') {
$basePath .= '/';
}
$this->generateMap($class, $basePath);
}
}