/**
* Is the XML file a valid Joomla installation manifest file.
*
* @param string $file An xmlfile path to check
*
* @return \SimpleXMLElement|null A \SimpleXMLElement, or null if the file failed to parse
*
* @since 3.1
*/
public function isManifest($file)
{
$xml = simplexml_load_file($file);
// If we cannot load the XML file return null
if (!$xml) {
return;
}
// Check for a valid XML root tag.
if ($xml->getName() !== 'extension') {
return;
}
// Valid manifest file return the object
return $xml;
}