Loads the class definition specified by `$class`. Also calls the `__init()` method on the
class, if defined. Looks through the list of libraries defined in `$_configurations`, which
are added through `lithium\core\Libraries::add()`.
Parameters
- string $class The fully-namespaced (where applicable) name of the class to load.
- boolean $require Specifies whether the class must be loaded or considered an exception. Defaults to `false`.
Returns
voidSource
public static function load($class, $require = false) {
$path = isset(static::$_cachedPaths[$class]) ? static::$_cachedPaths[$class] : null;
$path = $path ?: static::path($class);
if ($path && include $path) {
static::$_cachedPaths[$class] = $path;
method_exists($class, '__init') ? $class::__init() : null;
} elseif ($require) {
throw new RuntimeException("Failed to load class `{$class}` from path `{$path}`.");
}
}