API16:JApplicationHelper/parseXMLLangMetaFile
From Joomla! Documentation
<! removed transcluded page call, red link never existed >
Syntax
static parseXMLLangMetaFile($path)
| Parameter Name | Default Value | Description |
|---|---|---|
| $path |
Defined in
libraries/joomla/application/helper.php
Importing
jimport( 'joomla.application.helper' );
Source Body
public static function parseXMLLangMetaFile($path)
{
// Read the file to see if it's a valid component XML file
$xml = JFactory::getXML($path);
if( ! $xml)
{
return false;
}
/*
* Check for a valid XML root tag.
*
* Should be 'langMetaData'.
*/
if ($xml->getName() != 'metafile') {
unset($xml);
return false;
}
$data = array();
$data['name'] = (string)$xml->name;
$data['type'] = $xml->attributes()->type;
$data['creationDate'] =((string)$xml->creationDate) ? (string)$xml->creationDate : JText::_('Unknown');
$data['author'] =((string)$xml->author) ? (string)$xml->author : JText::_('Unknown');
$data['copyright'] = (string)$xml->copyright;
$data['authorEmail'] = (string)$xml->authorEmail;
$data['authorUrl'] = (string)$xml->authorUrl;
$data['version'] = (string)$xml->version;
$data['description'] = (string)$xml->description;
$data['group'] = (string)$xml->group;
return $data;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples