JInstaller/isManifest
From Joomla! Documentation
< API16:JInstaller
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Is the xml file a valid Joomla installation manifest file
<! removed transcluded page call, red link never existed >
Syntax[edit]
isManifest($file)
Parameter Name | Default Value | Description |
---|---|---|
$file | $file An xmlfile path to check |
Returns[edit]
mixed A , or null if the file failed to parse
Defined in[edit]
libraries/joomla/installer/installer.php
Importing[edit]
jimport( 'joomla.installer.installer' );
Source Body[edit]
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[edit]
Code Examples[edit]