Actions

API15

JInstaller/setAdapter

From Joomla! Documentation

< API15:JInstaller
Revision as of 17:23, 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

Set an installer adapter by name

[Edit Descripton]

Description:JInstaller/setAdapter

Syntax

setAdapter($name, $adapter=null)
Parameter Name Default Value Description
$name $name Adapter name
$adapter null $adapter Installer adapter object

Returns

boolean True if successful

Defined in

libraries/joomla/installer/installer.php

Importing

jimport( 'joomla.installer.installer' );

Source Body

function setAdapter($name, $adapter = null)
{
        if (!is_object($adapter))
        {
                // Try to load the adapter object
                require_once(dirname(__FILE__).DS.'adapters'.DS.strtolower($name).'.php');
                $class = 'JInstaller'.ucfirst($name);
                if (!class_exists($class)) {
                        return false;
                }
                $adapter = new $class($this);
                $adapter->parent =& $this;
        }
        $this->_adapters[$name] =& $adapter;
        return true;
}

[Edit See Also] SeeAlso:JInstaller/setAdapter

Examples

<CodeExamplesForm />