API15

JDatabase/getConnectors: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Get the database connectors <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</now...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
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 47: Line 47:


<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===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getConnectors
  category=getConnectors
  category=JDatabase
  category=JDatabase
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Latest revision as of 00:25, 25 March 2017

Description

Get the database connectors

[<! removed edit link to red link >]

<! 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

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' ), null)) {
                        $names[] = $name;
                }
        }

        return $names;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples