API16

JAuthentication/getInstance: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m clean up
Line 2: Line 2:
Returns the global authentication object, only creating it if it doesn't already exist.
Returns the global authentication object, only creating it if it doesn't already exist.


<span class="editsection" style="font-size:76%;">
 
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>


<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >
Line 38: Line 36:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >



Revision as of 13:39, 24 March 2017

Description

Returns the global authentication object, only creating it if it doesn't already exist.


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

Syntax

static getInstance()


Returns

object The global object

Defined in

libraries/joomla/user/authentication.php

Importing

jimport( 'joomla.user.authentication' );

Source Body

public static function getInstance()
{
        static $instances;

        if (!isset ($instances)) {
                $instances = array ();
        }

        if (empty ($instances[0])) {
                $instances[0] = new JAuthentication();
        }

        return $instances[0];
}


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

Examples

<CodeExamplesForm />