FirePHP adapter.
Constructor.
| Type | Description |
|---|---|
| array | Configuration |
NULL
public function __construct(array $config)
{
if(!headers_sent())
{
header('X-Wf-Protocol-1: http://meta.wildfirehq.org/Protocol/JsonStream/0.2');
header('X-Wf-1-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3');
header('X-Wf-1-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1');
}
}
Writes message to log.
| Type | Description |
|---|---|
| string | The message to write to the log |
| int | (optional) Message type |
boolean TRUE on success or FALSE on failure.
public function write($message, $type = Log::ERROR)
{
if(!headers_sent())
{
$content = json_encode(array(array('Type' => $this->types[$type]), $message));
header('X-Wf-1-1-1-' . ++$this->counter . ': ' . strlen($content) . '|' . $content . '|');
return true;
}
return false;
}