API16:JInstaller/isManifest
From Joomla! Documentation
Description
Is the xml file a valid Joomla installation manifest file
<! removed transcluded page call, red link never existed >
Syntax
isManifest($file)
| Parameter Name | Default Value | Description |
|---|---|---|
| $file | $file An xmlfile path to check |
Returns
mixed A , or null if the file failed to parse
Defined in
libraries/joomla/installer/installer.php
Importing
jimport( 'joomla.installer.installer' );
Source Body
public function isManifest($file)
{
// Initialise variables.
$xml = JFactory::getXML($file);
// If we cannot load the xml file return null
if( ! $xml)
{
return null;
}
/*
* Check for a valid XML root tag.
* @todo: Remove backwards compatability in a future version
* Should be 'extension', but for backward compatability we will accept 'extension' or 'install'.
*/
// 1.5 uses 'install'
// 1.6 uses 'extension'
if($xml->getName() != 'install' && $xml->getName() != 'extension')
{
return null;
}
// Valid manifest file return the object
return $xml;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples