API16

JDatabase/getConnectors

From Joomla! Documentation

< API16:JDatabase
Revision as of 20:26, 24 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

Description[edit]

Get the database connectors


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

Syntax[edit]

getConnectors()


Returns[edit]

array An array of available session handlers

Defined in[edit]

libraries/joomla/database/database.php

Importing[edit]

jimport( 'joomla.database.database' );

Source Body[edit]

public function getConnectors()
{
        jimport('joomla.filesystem.folder');
        $handlers = JFolder::files(dirname(__FILE__).DS.'database', '.php$');

        $names = array();
        foreach($handlers as $handler) {
                $name = substr($handler, 0, strrpos($handler, '.'));
                $class = 'JDatabase'.ucfirst($name);

                if (!class_exists($class)) {
                        require_once dirname(__FILE__).DS.'database'.DS.$name.'.php';
                }

                if (call_user_func_array(array(trim($class), 'test'), array())) {
                        $names[] = $name;
                }
        }

        return $names;
}


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

Examples[edit]

Code Examples[edit]