Actions

API16

JAdapter/loadAllAdapters

From Joomla! Documentation

< API16:JAdapter
Revision as of 17:37, 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

Loads all adapters

[Edit Descripton]

Description:JAdapter/loadAllAdapters

Syntax

loadAllAdapters()


Defined in

libraries/joomla/base/adapter.php

Importing

jimport( 'joomla.base.adapter' );

Source Body

public function loadAllAdapters() {
        $list = JFolder::files($this->_basepath.DS.$this->_adapterfolder);
        foreach($list as $filename) {
                if(JFile::getExt($filename) == 'php') {
                        // Try to load the adapter object
                        require_once $this->_basepath.DS.$this->_adapterfolder.DS.$filename;
                        $name = JFile::stripExt($filename);
                        $class = $this->_classprefix.ucfirst($name);
                        if (!class_exists($class)) {
                                continue; // skip to next one
                        }
                        $adapter = new $class($this, $this->_db);
                        $this->_adapters[$name] = clone $adapter;
                }
        }
}

[Edit See Also] SeeAlso:JAdapter/loadAllAdapters

Examples

<CodeExamplesForm />