Actions

API16

JInstaller/isManifest

From Joomla! Documentation

< API16:JInstaller
Revision as of 20:59, 13 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Is the xml file a valid Joomla installation manifest file

[<! removed edit link to red link >]

<! 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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />