API15

JAuthentication/getInstance

From Joomla! Documentation

< API15:JAuthentication
Revision as of 08:43, 12 May 2013 by JoomlaWikiBot (talk | contribs) (removing red link to edit, no existant pages)

The "API15" 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]

Returns a reference to a global authentication object, only creating it if it doesn't already exist.

[<! removed edit link to red link >]

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

Syntax[edit]

& getInstance()


Returns[edit]

object The global object

Defined in[edit]

libraries/joomla/user/authentication.php

Importing[edit]

jimport( 'joomla.user.authentication' );

Source Body[edit]

function & getInstance()
{
        static $instances;

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

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

        return $instances[0];
}

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

Examples[edit]

<CodeExamplesForm />