/** * Dumps key and variable to firebug server panel * * @see FirePHP::DUMP * @param mixed $var * @param string $key * @return true * @throws Exception */ public static function dump($var, $key = 'label') { return parent::dump($key, $var); }
function fb() { if (empty($_SESSION['adwhirl_debug'])) { return; } global $global_fb_count; global $lastTime; $args = func_get_args(); $global_fb_count++; if (count($args) == 2) { if (is_string($args[0])) { $s = $args[0]; $v = $args[1]; } else { $s = $args[1]; $v = $args[0]; } $msg = $s . "<br/>"; } else { $v = $args[0]; $s = ""; FB::dump("", $args[0]); $msg = "Dumping an object <br/>"; } $curTime = microtime(true); $ms = $curTime - $lastTime; $lastTime = $curTime; $s = "{$global_fb_count} - {$ms}: {$s}"; // echo "$s<br>"; $msg = "{$global_fb_count}: {$msg}"; // echo $msg; FB::dump($s, $v); }
/** * {@inheritdoc} */ public function dump($input, $name = NULL) { $fb = new \FB(); $fb->dump($name, $input); }
<?php FB::group('Test Group'); FB::send('Hello World'); FB::groupEnd(); FB::log('Log Message'); FB::info('Info Message'); FB::warn('Info Message'); FB::error('Info Message'); FB::trace('Trace to here'); FB::send('Trace to here', FirePHP::TRACE); FB::table('2 SQL queries took 0.06 seconds', array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2')))); FB::dump('PHP Version', phpversion());
<?php require_once 'FirePHP/fb.php'; FB::setLogToInsightConsole('Firebug'); fb('Log message'); FB::log('Log message'); FB::log('Log message', 'Label'); FB::info('Info message'); FB::warn('Warn message'); FB::error('Error message'); FB::dump('key', 'value'); FB::trace('Trace to here'); try { throw new Exception('Test exception'); } catch (Exception $e) { FB::error($e); } FB::table('2 SQL queries took 0.06 seconds', array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2')))); FB::group('Group 1'); FB::log('Test message 1'); FB::group('Group 2'); FB::log('Test message 2'); FB::groupEnd(); FB::log('Test message 3'); FB::groupEnd();
<?php FB::group('Test Group'); FB::send('Hello World'); FB::groupEnd(); FB::log('Log Message'); FB::info('Info Message'); FB::warn('Info Message'); FB::error('Info Message'); FB::trace('Trace to here'); FB::send('Trace to here', FirePHP::TRACE); FB::table('2 SQL queries took 0.06 seconds', array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2')))); FB::dump('RequestHeaders', apache_request_headers());
trigger_error("Database Connection Error: " . $e->getMessage()); echo "Database Connection Error. Reload the page to try again."; exit; } /*| template engine |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/ Session::init($cfg['guid']); TemplateEngine::init($cfg['dwoo_template_directory'], $cfg['dwoo_compiled_directory'], $cfg['dwoo_cache_directory']); /*| magic quotes |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/ if (get_magic_quotes_gpc()) { function stripslashes_recurse($value) { $value = is_array($value) ? array_map('stripslashes_recurse', $value) : stripslashes($value); return $value; } $_GET = array_map('stripslashes_recurse', $_GET); $_POST = array_map('stripslashes_recurse', $_POST); $_COOKIE = array_map('stripslashes_recurse', $_COOKIE); } /*| debug |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/ if ($cfg['debug']) { if (trim($cfg['firephp_path']) != '') { require_once $cfg['firephp_path']; // dump some common used info to firephp FB::dump('Get', $_GET); FB::dump('Post', $_POST); FB::dump('Cookie', $_COOKIE); if (isset($_SESSION)) { FB::dump('Session', $_SESSION); } } }