3 * StatusNet Plugin: 0.9
5 * Description: Sends StatusNet log output to FirePHP
7 * Author: Craig Andrews <candrews@integralblue.com>
8 * Author URI: http://candrews.integralblue.com/
12 * StatusNet - the distributed open-source microblogging tool
13 * Copyright (C) 2009, StatusNet, Inc.
15 * This program is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Affero General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU Affero General Public License for more details.
25 * You should have received a copy of the GNU Affero General Public License
26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 * @package MinifyPlugin
29 * @maintainer Craig Andrews <candrews@integralblue.com>
30 * @author Craig Andrews <candrews@integralblue.com>
31 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
32 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
33 * @link http://status.net/
36 if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
38 // We bundle the FirePHP library...
39 set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/FirePHP/lib');
41 class FirePHPPlugin extends Plugin
45 function onInitializePlugin()
47 //Output buffering has to be enabled so FirePHP can send the HTTP headers it needs
49 require_once('FirePHPCore/FirePHP.class.php');
50 $this->firephp = FirePHP::getInstance(true);
53 function onStartLog(&$priority, &$msg, &$filename)
55 static $firephp_priorities = array(FirePHP::ERROR, FirePHP::ERROR, FirePHP::ERROR, FirePHP::ERROR,
56 FirePHP::WARN, FirePHP::LOG, FirePHP::LOG, FirePHP::INFO);
57 $fp_priority = $firephp_priorities[$priority];
58 $this->firephp->fb($msg, $fp_priority);
61 function onPluginVersion(array &$versions)
63 $versions[] = array('name' => 'FirePHP',
64 'version' => GNUSOCIAL_VERSION,
65 'author' => 'Craig Andrews',
66 'homepage' => 'http://status.net/wiki/Plugin:FirePHP',
68 // TRANS: Plugin description.
69 _m('The FirePHP plugin writes StatusNet\'s log output to FirePHP.'));