Actions

API16

JProfiler/getInstance

< API16:JProfiler

The "API16" 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

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



Syntax

static 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

public static function getInstance($prefix = '')
{
        static $instances;
 
        if (!isset($instances)) {
                $instances = array();
        }
 
        if (empty($instances[$prefix])) {
                $instances[$prefix] = new JProfiler($prefix);
        }
 
        return $instances[$prefix];
}



Examples

Code Examples


Advertisement