JProfiler/getInstance
From Joomla! Documentation
< API15:JProfiler
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.
Contents
Description
Returns a reference to the global Profiler 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
& getInstance($prefix= '')
Parameter Name | Default Value | Description |
---|---|---|
$prefix | Prefix used to distinguish profiler objects. |
Returns
The Profiler object.
Defined in
libraries/joomla/error/profiler.php
Importing
jimport( 'joomla.error.profiler' );
Source Body
function &getInstance($prefix = '')
{
static $instances;
if (!isset($instances)) {
$instances = array();
}
if (empty($instances[$prefix])) {
$instances[$prefix] = new JProfiler($prefix);
}
return $instances[$prefix];
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >