Actions

API15

JInstaller/getParams

From Joomla! Documentation

< API15:JInstaller
Revision as of 17:24, 22 March 2010 by Doxiki (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

Method to parse the parameters of an extension, build the INI string for it's default parameters, and return the INI string.

[Edit Descripton]

Description:JInstaller/getParams

Syntax

getParams()


Returns

string INI string of parameter values

Defined in

libraries/joomla/installer/installer.php

Importing

jimport( 'joomla.installer.installer' );

Source Body

function getParams()
{
        // Get the manifest document root element
        $root = & $this->_manifest->document;
 
        // Get the element of the tag names
        $element =& $root->getElementByPath('params');
        if (!is_a($element, 'JSimpleXMLElement') || !count($element->children())) {
                // Either the tag does not exist or has no children therefore we return zero files processed.
                return null;
        }
 
        // Get the array of parameter nodes to process
        $params = $element->children();
        if (count($params) == 0) {
                // No params to process
                return null;
        }
 
        // Process each parameter in the $params array.
        $ini = null;
        foreach ($params as $param) {
                if (!$name = $param->attributes('name')) {
                        continue;
                }
 
                if (!$value = $param->attributes('default')) {
                        continue;
                }
 
                $ini .= $name."=".$value."\n";
        }
        return $ini;
}

[Edit See Also] SeeAlso:JInstaller/getParams

Examples

<CodeExamplesForm />