API16

JLibraryManifest/loadManifestFromXML

From Joomla! Documentation

< API16:JLibraryManifest
Revision as of 22:05, 13 May 2013 by JoomlaWikiBot (talk | contribs) (removing red link to edit, no existant pages)

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.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax[edit]

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

Defined in[edit]

libraries/joomla/installer/librarymanifest.php

Importing[edit]

jimport( 'joomla.installer.librarymanifest' );

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
        {
                $this->name = (string)$xml->name;
                $this->libraryname = (string)$xml->libraryname;
                $this->version = (string)$xml->version;
                $this->description = (string)$xml->description;
                $this->creationdate = (string)$xml->creationdate;
                $this->author = (string)$xml->author;
                $this->authoremail = (string)$xml->authorEmail;
                $this->authorurl = (string)$xml->authorUrl;
                $this->packager = (string)$xml->packager;
                $this->packagerurl = (string)$xml->packagerurl;
                $this->update = (string)$xml->update;

                if(isset($xml->files) && isset($xml->files->file) && count($xml->files->file))
                {
                        foreach ($xml->files->file as $file) {
                                $this->filelist[] = (string)$file;
                        }
                }
                return true;
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />