mediatekformation

PHPConsoleHandler extends AbstractProcessingHandler
in package

Monolog handler for Google Chrome extension "PHP Console"

Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely

Usage:

  1. Install Google Chrome extension https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef

  2. See overview https://github.com/barbushin/php-console#overview

  3. Install PHP Console library https://github.com/barbushin/php-console#installation

  4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png)

    $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler())); \Monolog\ErrorHandler::register($logger); echo $undefinedVar; $logger->debug('SELECT * FROM users', array('db', 'time' => 0.012)); PC::debug($_SERVER); // PHP Console debugger for any type of vars

Tags
author

Sergey Barbushin https://www.linkedin.com/in/barbushin

phpstan-import-type

Record from \Monolog\Logger

Table of Contents

$bubble  : bool
$formatter  : FormatterInterface|null
$level  : int
$processors  : array<string|int, callable>
$connector  : Connector
$options  : array<string, mixed>
__construct()  : mixed
__destruct()  : mixed
__sleep()  : mixed
close()  : void
Closes the handler.
getBubble()  : bool
Gets the bubbling behavior.
getConnector()  : Connector
getFormatter()  : FormatterInterface
{@inheritDoc}
getLevel()  : int
Gets minimum logging level at which this handler will be triggered.
getOptions()  : array<string, mixed>
handle()  : bool
{@inheritDoc}
handleBatch()  : void
Handles a set of records at once.
isHandling()  : bool
{@inheritDoc}
popProcessor()  : callable
{@inheritDoc}
pushProcessor()  : HandlerInterface
{@inheritDoc}
reset()  : void
setBubble()  : self
Sets the bubbling behavior.
setFormatter()  : HandlerInterface
{@inheritDoc}
setLevel()  : self
Sets minimum logging level at which this handler will be triggered.
getDefaultFormatter()  : FormatterInterface
{@inheritDoc}
processRecord()  : array<string|int, mixed>
Processes a record.
resetProcessors()  : void
write()  : void
Writes the record down to the log of the implementing handler
getRecordTags()  : string
handleDebugRecord()  : void
handleErrorRecord()  : void
handleExceptionRecord()  : void
initConnector()  : Connector
initOptions()  : array<string, mixed>

Properties

$level

protected int $level = \Monolog\Logger::DEBUG
Tags
phpstan-var

Level

$processors

protected array<string|int, callable> $processors = []
Tags
phpstan-var

array<ProcessorInterface|callable(Record): Record>

$options

private array<string, mixed> $options = [ 'enabled' => true, // bool Is PHP Console server enabled 'classesPartialsTraceIgnore' => ['Monolog\\'], // array Hide calls of classes started with... 'debugTagsKeysInContext' => [0, 'tag'], // bool Is PHP Console server enabled 'useOwnErrorsHandler' => false, // bool Enable errors handling 'useOwnExceptionsHandler' => false, // bool Enable exceptions handling 'sourcesBasePath' => null, // string Base path of all project sources to strip in errors source paths 'registerHelper' => true, // bool Register PhpConsole\Helper that allows short debug calls like PC::debug($var, 'ta.g.s') 'serverEncoding' => null, // string|null Server internal encoding 'headersLimit' => null, // int|null Set headers size limit for your web-server 'password' => null, // string|null Protect PHP Console connection by password 'enableSslOnlyMode' => false, // bool Force connection by SSL for clients with PHP Console installed 'ipMasks' => [], // array Set IP masks of clients that will be allowed to connect to PHP Console: array('192.168.*.*', '127.0.0.1') 'enableEvalListener' => false, // bool Enable eval request to be handled by eval dispatcher(if enabled, 'password' option is also required) 'dumperDetectCallbacks' => false, // bool Convert callback items in dumper vars to (callback SomeClass::someMethod) strings 'dumperLevelLimit' => 5, // int Maximum dumped vars array or object nested dump level 'dumperItemsCountLimit' => 100, // int Maximum dumped var same level array items or object properties number 'dumperItemSizeLimit' => 5000, // int Maximum length of any string or dumped array item 'dumperDumpSizeLimit' => 500000, // int Maximum approximate size of dumped vars result formatted in JSON 'detectDumpTraceAndSource' => false, // bool Autodetect and append trace data to debug 'dataStorage' => null, ]

Methods

__construct()

public __construct([array<string, mixed> $options = [] ][, Connector|null $connector = null ][, mixed $level = Logger::DEBUG ][, bool $bubble = true ]) : mixed
Parameters
$options : array<string, mixed> = []

See \Monolog\Handler\PHPConsoleHandler::$options for more details

$connector : Connector|null = null

Instance of \PhpConsole\Connector class (optional)

$level : mixed = Logger::DEBUG
$bubble : bool = true
Tags
throws
RuntimeException
Return values
mixed —

__destruct()

public __destruct() : mixed
Return values
mixed —

__sleep()

public __sleep() : mixed
Return values
mixed —

close()

Closes the handler.

public close() : void
Return values
void —

getBubble()

Gets the bubbling behavior.

public getBubble() : bool
Return values
bool —

true means that this handler allows bubbling. false means that bubbling is not permitted.

getConnector()

public getConnector() : Connector
Return values
Connector —

getLevel()

Gets minimum logging level at which this handler will be triggered.

public getLevel() : int
Tags
phpstan-return

Level

Return values
int —

getOptions()

public getOptions() : array<string, mixed>
Return values
array<string, mixed> —

handle()

{@inheritDoc}

public handle(array<string|int, mixed> $record) : bool
Parameters
$record : array<string|int, mixed>
Return values
bool —

handleBatch()

Handles a set of records at once.

public handleBatch(array<string|int, mixed> $records) : void
Parameters
$records : array<string|int, mixed>

The records to handle (an array of record arrays)

Return values
void —

isHandling()

{@inheritDoc}

public isHandling(array<string|int, mixed> $record) : bool
Parameters
$record : array<string|int, mixed>
Return values
bool —

setBubble()

Sets the bubbling behavior.

public setBubble(bool $bubble) : self
Parameters
$bubble : bool

true means that this handler allows bubbling. false means that bubbling is not permitted.

Return values
self —

setLevel()

Sets minimum logging level at which this handler will be triggered.

public setLevel(mixed $level) : self
Parameters
$level : mixed
Return values
self —

processRecord()

Processes a record.

protected processRecord(array<string|int, mixed> $record) : array<string|int, mixed>
Parameters
$record : array<string|int, mixed>
Tags
phpstan-param

Record $record

phpstan-return

Record

Return values
array<string|int, mixed> —

write()

Writes the record down to the log of the implementing handler

protected write(array<string|int, mixed> $record) : void
Parameters
$record : array<string|int, mixed>
Return values
void —

getRecordTags()

private getRecordTags(array<string|int, mixed> &$record) : string
Parameters
$record : array<string|int, mixed>
Tags
phpstan-param

Record $record

Return values
string —

handleDebugRecord()

private handleDebugRecord(array<string|int, mixed> $record) : void
Parameters
$record : array<string|int, mixed>
Tags
phpstan-param

Record $record

Return values
void —

handleErrorRecord()

private handleErrorRecord(array<string|int, mixed> $record) : void
Parameters
$record : array<string|int, mixed>
Tags
phpstan-param

Record $record

Return values
void —

handleExceptionRecord()

private handleExceptionRecord(array<string|int, mixed> $record) : void
Parameters
$record : array<string|int, mixed>
Tags
phpstan-param

Record $record

Return values
void —

initConnector()

private initConnector([Connector|null $connector = null ]) : Connector
Parameters
$connector : Connector|null = null
Return values
Connector —

initOptions()

private initOptions(array<string, mixed> $options) : array<string, mixed>
Parameters
$options : array<string, mixed>
Return values
array<string, mixed> —

Search results