API16

Difference between revisions of "JDatabase/getConnectors"

From Joomla! Documentation

< API16:JDatabase
(New page: ===Description=== Get the database connectors <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</now...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JDatabase/getConnectors|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JDatabase/getConnectors}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 46: Line 46:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JDatabase/getConnectors|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JDatabase/getConnectors}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 61: Line 61:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Revision as of 21:57, 12 May 2013

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 edit link to red link >]

<! 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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />