API16:JDatabase/getConnectors
From Joomla! Documentation
Description
Get the database connectors
<! removed transcluded page call, red link never existed >
Syntax
getConnectors()
Returns
array An array of available session handlers
Defined in
libraries/joomla/database/database.php
Importing
jimport( 'joomla.database.database' );
Source Body
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
Code Examples