PHP Класс RedBeanPHP\Logger\RDefault\Debug

A special logger for debugging purposes. Provides debugging logging functions for RedBeanPHP.
Автор: Gabor de Mooij and the RedBeanPHP Community
Наследование: extends RedBeanPHP\Logger\RDefault, implements RedBeanPHP\Logger
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
log ( ) : void Logger method.
setParamStringLength ( integer $len = 20 ) : self Sets the max string length for the parameter output in SQL queries. Set this value to a reasonable number to keep you SQL queries readable.

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

Метод Описание
fillInValue ( mixed $value ) : string Fills in a value of a binding and truncates the resulting string if necessary.
normalizeBindings ( array $bindings ) : array Normalizes the bindings.
normalizeSlots ( string $sql ) : string Normalizes the slots in an SQL string.
output ( string $str ) : void Dependending on the current mode of operation, this method will either log and output to STDIN or just log.

Приватные методы

Метод Описание
writeQuery ( string $newSql, $newBindings ) : string Writes a query for logging with all bindings / params filled in.

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

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

Fills in a value of a binding and truncates the resulting string if necessary.
protected fillInValue ( mixed $value ) : string
$value mixed bound value
Результат string

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

Takes a number of arguments tries to create a proper debug log based on the available data.
public log ( ) : void
Результат void

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

Replaces numeric binding keys with :slot1 :slot2 etc.
protected normalizeBindings ( array $bindings ) : array
$bindings array bindings to normalize
Результат array

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

Replaces question mark slots with :slot1 :slot2 etc.
protected normalizeSlots ( string $sql ) : string
$sql string sql to normalize
Результат string

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

Depending on the value of constant PHP_SAPI this function will format output for console or HTML.
protected output ( string $str ) : void
$str string string to log or output and log
Результат void

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

Sets the max string length for the parameter output in SQL queries. Set this value to a reasonable number to keep you SQL queries readable.
public setParamStringLength ( integer $len = 20 ) : self
$len integer string length
Результат self