PHP Класс Profiler\Profiler

Наследование: implements Psr\Log\LoggerAwareInterface
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$enabled boolean Wether the profiler is enabled or not.
$log Psr\Log\LoggerInterface The logger.

Защищенные свойства (Protected)

Свойство Тип Описание
$includedFiles array The included files.
$timers array All of the stored timers.

Открытые методы

Метод Описание
__construct ( Psr\Log\LoggerInterface $logger, mixed $startTime = null, boolean $on = true ) : void Register the logger and application start time.
__toString ( ) : string Render the profiler.
disable ( ) : void Disable the profiler.
enable ( boolean $on = true ) : void Enable the profiler.
endTimer ( string $timer, mixed $endTime = null ) : Profiler End a timer.
getElapsedTime ( string $timer ) : double Get the amount of time that passed during a timer.
getIncludedFiles ( ) : array Get all of the files that have been included.
getLoadTime ( ) : integer Get the current application execution time in milliseconds.
getMemoryPeak ( ) : string Get the peak memory usage in a readable format.
getMemoryUsage ( ) : string Get the current memory usage in a readable format.
getTimer ( string $timer ) : double Get a timer.
getTimers ( ) : array Get all of the timers.
isEnabled ( ) : boolean Check if profiler is enabled
render ( ) : string Render the profiler.
setLogger ( Psr\Log\LoggerInterface $logger ) : void Set the logger.
startTimer ( string $timer, mixed $startTime = null ) : Profiler Start a timer.

Защищенные методы

Метод Описание
readableSize ( integer $size, string $format = null ) : string A helper to convert a size into a readable format

Описание методов

__construct() публичный Метод

Register the logger and application start time.
public __construct ( Psr\Log\LoggerInterface $logger, mixed $startTime = null, boolean $on = true ) : void
$logger Psr\Log\LoggerInterface
$startTime mixed
$on boolean
Результат void

__toString() публичный Метод

Render the profiler.
public __toString ( ) : string
Результат string

disable() публичный Метод

Disable the profiler.
public disable ( ) : void
Результат void

enable() публичный Метод

Enable the profiler.
public enable ( boolean $on = true ) : void
$on boolean
Результат void

endTimer() публичный Метод

End a timer.
public endTimer ( string $timer, mixed $endTime = null ) : Profiler
$timer string
$endTime mixed
Результат Profiler

getElapsedTime() публичный Метод

Get the amount of time that passed during a timer.
public getElapsedTime ( string $timer ) : double
$timer string
Результат double

getIncludedFiles() публичный Метод

Get all of the files that have been included.
public getIncludedFiles ( ) : array
Результат array

getLoadTime() публичный Метод

Get the current application execution time in milliseconds.
public getLoadTime ( ) : integer
Результат integer

getMemoryPeak() публичный Метод

Get the peak memory usage in a readable format.
public getMemoryPeak ( ) : string
Результат string

getMemoryUsage() публичный Метод

Get the current memory usage in a readable format.
public getMemoryUsage ( ) : string
Результат string

getTimer() публичный Метод

Get a timer.
public getTimer ( string $timer ) : double
$timer string
Результат double

getTimers() публичный Метод

Get all of the timers.
public getTimers ( ) : array
Результат array

isEnabled() публичный Метод

Check if profiler is enabled
public isEnabled ( ) : boolean
Результат boolean

readableSize() защищенный Метод

A helper to convert a size into a readable format
protected readableSize ( integer $size, string $format = null ) : string
$size integer
$format string
Результат string

render() публичный Метод

Render the profiler.
public render ( ) : string
Результат string

setLogger() публичный Метод

Set the logger.
public setLogger ( Psr\Log\LoggerInterface $logger ) : void
$logger Psr\Log\LoggerInterface
Результат void

startTimer() публичный Метод

Start a timer.
public startTimer ( string $timer, mixed $startTime = null ) : Profiler
$timer string
$startTime mixed
Результат Profiler

Описание свойств

$enabled публичное свойство

Wether the profiler is enabled or not.
public bool $enabled
Результат boolean

$includedFiles защищенное свойство

The included files.
protected array $includedFiles
Результат array

$log публичное свойство

The logger.
public LoggerInterface,Psr\Log $log
Результат Psr\Log\LoggerInterface

$timers защищенное свойство

All of the stored timers.
protected array $timers
Результат array