JAuthentication/getInstance: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Returns the global authentication object, only creating it if it doesn't already exist.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Descrip... |
m preparing for archive only |
||
| (2 intermediate revisions by the same user not shown) | |||
| 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. | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 38: | Line 36: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=getInstance | category=getInstance | ||
category=JAuthentication | category=JAuthentication | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Latest revision as of 01:19, 25 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
Code Examples