public static function get($name = null, $key = null)
{
$configs = static::$_configurations;
if (!$name && !$key) {
return $configs;
}
if ($name === true) {
$name = static::$_default;
}
if (is_array($name) || !$name && $key) {
$name = $name ?: array_keys(static::$_configurations);
$call = array(get_called_class(), 'get');
return array_combine($name, array_map($call, $name, array_fill(0, count($name), $key)));
}
$config = isset($configs[$name]) ? $configs[$name] : null;
if ($key) {
return isset($config[$key]) ? $config[$key] : null;
}
if (strpos($name, '\\') === false) {
return $config;
}
foreach (static::$_configurations as $library => $config) {
if ($config['prefix'] && strpos($name, $config['prefix']) === 0) {
return $library;
}
}
}