Actions

API16

JProfiler/getInstance

From Joomla! Documentation

< API16:JProfiler
Revision as of 17:47, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

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

[Edit Descripton]

Description:JProfiler/getInstance

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];
}

[Edit See Also] SeeAlso:JProfiler/getInstance

Examples

<CodeExamplesForm />