API16

JPackageManifest/loadManifestFromXML

From Joomla! Documentation

< API16:JPackageManifest
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.

Syntax[edit]

loadManifestFromXML($xmlfile)
Parameter Name Default Value Description
$xmlfile

Defined in[edit]

libraries/joomla/installer/packagemanifest.php

Importing[edit]

jimport( 'joomla.installer.packagemanifest' );

Source Body[edit]

function loadManifestFromXML($xmlfile)
{
        $this->manifest_file = JFile::stripExt(basename($xmlfile));

        $xml = JFactory::getXML($xmlfile);

        if( ! $xml)
        {
                $this->_errors[] = 'Failed to load XML File: '.$xmlfile;
                return false;
        }
        else
        {
                $xml = $xml->document;
                $this->name = (string)$xml->name;
                $this->packagename = (string)$xml->packagename;
                $this->update = (string)$xml->update;
                $this->authorurl = (string)$xml->authorUrl;
                $this->author = (string)$xml->author;
                $this->authoremail = (string)$xml->authorEmail;
                $this->description = (string)$xml->description;
                $this->packager = (string)$xml->packager;
                $this->packagerurl = (string)$xml->packagerurl;
                $this->version = (string)$xml->version;
                if (isset($xml->files->file) && count($xml->files->file))
                {
                        foreach ($xml->files->file as $file) {
                                $this->filelist[] = new JExtension((string)$file);
                        }
                }
                return true;
        }
}



Examples[edit]

Code Examples[edit]