本文整理汇总了PHP中FB::setOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP FB::setOptions方法的具体用法?PHP FB::setOptions怎么用?PHP FB::setOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FB
的用法示例。
在下文中一共展示了FB::setOptions方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initFirePHP
public function initFirePHP()
{
// 开启FirePHP调试或者关闭
$options = array('maxObjectDepth' => 10, 'maxArrayDepth' => 10, 'maxDepth' => 10, 'useNativeJsonEncode' => true, 'includeLineNumbers' => true);
\FirePHP::getInstance(true)->setEnabled(true);
\FB::setOptions($options);
}
示例2: __construct
/**
* The possible options are:
* - debug_level: level of debug if it's not specified it's set by debugObject to DEBUG_DEFAULT_LEVEL
* - max_depth (int): maximum depth to traverse objects and arrays (Default 10).
* - show_line (bool): include File and Line information in message (Default true).
*
* @param array $options
*/
public function __construct($options = null)
{
parent::__construct($options);
$this->_max_depth = isset($options['max_depth']) ? filter_var($options['max_depth'], FILTER_VALIDATE_INT, array('options' => array('default' => 10, 'min_range' => 0))) : 10;
$this->_show_line = isset($options['show_line']) ? filter_var($options['show_line'], FILTER_VALIDATE_BOOLEAN, array('options' => array('default' => true))) : true;
$FBoptions = array('maxObjectDepth' => $this->_max_depth, 'maxArrayDepth' => $this->_max_depth, 'maxDepth' => $this->_max_depth, 'useNativeJsonEncode' => true, 'includeLineNumbers' => $this->_show_line);
FB::setEnabled(true);
FB::setOptions($FBoptions);
$this->msg('Debug Console started at ' . date('c', time()) . ' from ' . gethostbyaddr($_SERVER['REMOTE_ADDR']), DEBUG_INFO);
}
示例3: __construct
public function __construct($opts=array()) {
if(empty($opts)){
$opts = array( 'maxObjectDepth' => 5,
'maxArrayDepth' => 5,
'maxDepth' => 10,
'useNativeJsonEncode' => true,
'includeLineNumbers' => true);
}
$this->opts = $opts;
\FB::setOptions($opts);
}
示例4: log
/**
*
* {@inheritDoc}
*
* @see \Psr\Log\LoggerInterface::log()
*/
public function log($level, $message, array $context = array())
{
foreach ($context as $property => $val) {
if (property_exists($this, $property)) {
$this->{$property} = $val;
}
}
$fb = new \FB();
if (!empty($this->options)) {
$fb->setOptions($this->options);
}
$fb->send($message, $this->label, $level);
if ($level == LogLevel::DEBUG) {
foreach ($context as $label => $object) {
$fb->send($object, $label, $level);
}
}
}
示例5: onAfterInitialise
/**
* onAfterInitialise handler
*
* Register FirePHP libraries and set options according to paramters
*
* @access public
* @return null
*/
public function onAfterInitialise()
{
require_once 'jfirephp' . DS . 'firephpcore' . DS . 'fb.php';
// JFirePHP is installed and loaed
define('JFIREPHP', 1);
// Before doing any checks lets disable logging
FB::setEnabled(false);
// Check if the integration is set to enabled
$enable = (bool) $this->params->get('enable', 0);
// Only turn on if enabled
if ($enable) {
// if limited to debug mode, check JDEBUG
$limittodebug = (bool) $this->params->get('limittodebug', 1);
if ($limittodebug == false || JDEBUG) {
// We are enabled and either in Debug mode, or it does not matter
FB::setEnabled(true);
$verbose = (bool) $this->params->get('verbose', 0);
if ($verbose) {
FB::group('JFirePHP Startup', array('Collapsed' => true, 'Color' => '#FF4000'));
FB::log('JFirePHP enabled! - Verbose Output Mode: ON');
}
$options = array('maxObjectDepth' => intval($this->params->get('maxObjectDepth', 10)), 'maxArrayDepth' => intval($this->params->get('maxArrayDepth', 20)), 'useNativeJsonEncode' => intval($this->params->get('useNativeJsonEncode', 1)), 'includeLineNumbers' => intval($this->params->get('includeLineNumbers', 1)));
FB::setOptions($options);
if ($verbose) {
FB::log('JFirePHP: Options Set - maxObjectDepth:' . $options['maxObjectDepth'] . ' maxArrayDepth:' . $options['maxArrayDepth'] . ' useNativeJsonEncode:' . $options['useNativeJsonEncode'] . ' includeLineNumbers:' . $options['includeLineNumbers']);
}
$redirectphp = (bool) $this->params->get('redirectphp', 0);
if ($redirectphp) {
// Convert E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE and
// E_RECOVERABLE_ERROR errors to ErrorExceptions and send all Exceptions to Firebug automatically
FB::registerErrorHandler(true);
FB::registerExceptionHandler();
FB::registerAssertionHandler(true, false);
if ($verbose) {
FB::log('JFirePHP: E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE and E_RECOVERABLE_ERROR redirected.');
}
}
if ($verbose) {
FB::groupEnd();
}
}
}
}
示例6: TestObject
<?php
$firephp = FirePHP::getInstance(true);
$firephp->setOptions(array('maxObjectDepth' => 2));
FB::setOptions(array('maxArrayDepth' => 3));
class TestObject
{
var $name = 'test data';
}
class TestObject2
{
var $name1 = 'name 1';
var $name2 = 'name 2';
var $name3 = 'name 3';
}
$obj = new TestObject();
$obj->child = new TestObject();
$obj->child->child = new TestObject();
$obj->child->child->child = new TestObject();
$obj->child->child->child->child = new TestObject();
$obj->child2 = new TestObject2();
$obj->child2->name4 = 'name 4';
$firephp->setObjectFilter('TestObject2', array('name2', 'name4'));
$firephp->fb($obj);
$array = array();
$array['name'] = 'test data';
$array['child']['name'] = 'test data';
$array['child']['obj'] = $obj;
$array['child']['child']['name'] = 'test data';
$array['child']['child']['child']['name'] = 'test data';
$obj->childArray = $array;
示例7: array
// nastavit DbControl config file cestu
DbCfg::$cfgFilepath = LBoxLoaderConfig::getInstance()->getPathOf("db");
// pokud nemame pearovsky firePHP pouzivame lokani LBOXovy
@(include "FirePHPCore/fb.php");
if (!class_exists("FirePHP")) {
require LBOX_PATH_CORE . $slash . "firephp" . $slash . "0.3.1" . $slash . "lib" . $slash . "FirePHPCore" . $slash . "fb.php";
}
// disable firePHP on remote mashines (enabled on localhost only!!!)
if (LBOX_REQUEST_IP != LBOX_REQUEST_IP_MY) {
FirePHP::getInstance(true)->setEnabled(false);
FB::setEnabled(false);
}
$firePHPOptions = array('maxObjectDepth' => 10, 'maxArrayDepth' => 20, 'useNativeJsonEncode' => true, 'includeLineNumbers' => true);
FirePHP::getInstance(true)->getOptions();
FirePHP::getInstance(true)->setOptions($firePHPOptions);
FB::setOptions($firePHPOptions);
// log exclude of:
/*FirePHP::getInstance(true)->setObjectFilter('ClassName',
array('MemberName'));*/
// TAL load
// pokud nemame pearovsky PHPTAL pouzivame lokani LBOXovy
@(include "PHPTAL.php");
if (!@constant("PHPTAL_VERSION")) {
define("LBOX_PATH_PHPTAL", LBOX_PATH_CORE . $slash . "TAL" . $slash . "PHPTAL-1.2.1");
define("LBOX_PATH_PHPTAL_GETTEXTTRANSLATOR", LBOX_PATH_PHPTAL . $slash . "PHPTAL");
require LBOX_PATH_PHPTAL . $slash . "PHPTAL.php";
} else {
define("LBOX_PATH_PHPTAL", "PHPTAL");
define("LBOX_PATH_PHPTAL_GETTEXTTRANSLATOR", LBOX_PATH_PHPTAL);
}
// TAL translator service to extend the standard
示例8: getFirePHP
/**
* Retrieve an instance of FirePHP
*
* @param array $options optional global options.
* @return FirePHP
*/
public static function getFirePHP($options = null)
{
if (!isset(self::$_FirePHP) || !empty($options)) {
if (!class_exists('\\FirePHP')) {
throw new THEDEBUGException("FirePHP not available");
}
/* Start output buffer so we can debug after headers would be sent regular */
if (!isset(self::$_FirePHP)) {
ob_start();
}
if (!empty($options)) {
\FB::setOptions($options);
}
self::$_FirePHP = \FirePHP::getInstance(true);
}
return self::$_FirePHP;
}
示例9: setUpLogging
private static function setUpLogging()
{
$errorLogLocation = ini_get('error_log');
if (!isset($errorLogLocation) || $errorLogLocation == false) {
ini_set('error_log', '/dev/stdout');
}
$inDevMode = self::get('debug');
//$inDevMode = true;
Log4PHP::init($inDevMode ? Log4PHP::DEBUG : Log4PHP::ERROR);
if (self::get('FireBug') && $inDevMode) {
FB::setOptions(['useNativeJsonEncode' => false]);
ob_start();
Log4PHP::setOutput(Log4PHP::FIREBUG);
} else {
if (Cfg::get('quercus', false)) {
Log4PHP::setOutput(Log4PHP::FILE);
} else {
Log4PHP::setOutput(Log4PHP::FILE);
}
}
//Log4PHP::setOutput ( Log4PHP::SCREEN );
self::$log = Log4PHP::logFactory(__CLASS__);
}