/**
* Get the library information.
*
* @param string $element Element of the library in the extensions table.
* @param boolean $strict If set and the library does not exist, the enabled attribute will be set to false.
*
* @return \stdClass An object with the library's information.
*
* @since 3.2
*/
public static function getLibrary($element, $strict = false)
{
// Is already cached?
if (isset(static::$libraries[$element]) || static::loadLibrary($element)) {
$result = static::$libraries[$element];
// Convert the params to an object.
if (\is_string($result->params)) {
$result->params = new Registry($result->params);
}
} else {
$result = new \stdClass();
$result->enabled = $strict ? false : true;
$result->params = new Registry();
}
return $result;
}