phalcon/cphalcon — pull request #845 by sjinks (2013-07-14 17:22:29+00:00)
Title: [NFR] FirePHP Log Adapter and Formatter

The idea was taken from the [https://github.com/phalcon/incubator/tree/master/Library/Phalcon/Logger](incubator).

The adapter is meant to send messages to FireBug with FirePHP extension enabled.

This implementation differs from the incubator's:
* `_initialized` and `_index` properties are static — if by accident the user instantiates two loggers, FirePHP will be very confused;
* very long messages are split into 5KB chunks so that Firefox be able to read the headers properly.

Bonuses:
* much shorter version of `Phalcon\Logger\Formatter::getTypeString()`
* results returned by json_encode() are always NUL-terminated (otherwise Zend Engine complains loudly if PHP is built with debugging support)