本文整理汇总了PHP中FB::setEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP FB::setEnabled方法的具体用法?PHP FB::setEnabled怎么用?PHP FB::setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FB
的用法示例。
在下文中一共展示了FB::setEnabled方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Load FirePHP at the start
*
* @param $css
* @return $css string
*/
public static function initialize()
{
# Load FirePHP
if (!class_exists('FB')) {
require dirname(__FILE__) . '/libraries/FirePHPCore/fb.php';
}
# Enable it
FB::setEnabled(true);
}
示例2: initialize
static function initialize($settings, $version = "-")
{
self::$version = $version;
self::$debug = (isset($settings) and isset($settings["debug"]) and $settings['debug'] === TRUE);
self::$firebug = (isset($settings) and isset($settings["firebug_logging"]) and $settings['firebug_logging'] === TRUE);
if (self::$firebug) {
require_once 'FirePHPCore/fb.php';
FB::setEnabled(true);
}
}
示例3: __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);
}
示例4: executeInit
public function executeInit()
{
try {
parent::executeInit();
if ($this->showConnivance()) {
FirePHP::getInstance(true)->setEnabled(true);
FB::setEnabled(true);
}
} catch (Exception $e) {
throw $e;
}
}
示例5: __construct
private function __construct()
{
// Handles debugging. If TRUE, displays all errors and enables FirePHP logging
if (ACTIVATE_DEBUG_MODE === TRUE) {
ini_set("display_errors", 1);
ERROR_REPORTING(E_ALL);
FB::setEnabled(TRUE);
FB::warn("FirePHP logging is enabled! Sensitive data may be exposed.");
ChromePhp::warn("ChromePHP logging is enabled! Sensitive data may be exposed.");
} else {
ini_set("display_errors", 0);
error_reporting(0);
FB::setEnabled(FALSE);
}
}
示例6: 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();
}
}
}
}
示例7:
<?php
$firephp = FirePHP::getInstance(true);
if ($firephp->getEnabled()) {
$firephp->info('Enabled');
}
$firephp->fb('This should show');
$firephp->setEnabled(false);
if (!$firephp->getEnabled()) {
$firephp->info('Disabled');
}
$firephp->fb('This should NOT show');
$firephp->setEnabled(true);
if ($firephp->getEnabled()) {
$firephp->info('Enabled');
}
$firephp->fb('This should show');
if (FB::getEnabled()) {
FB::info('Enabled');
}
FB::log('This should show');
FB::setEnabled(false);
if (!FB::getEnabled()) {
FB::info('Disabled');
}
FB::send('This should NOT show');
FB::setEnabled(true);
if (FB::getEnabled()) {
FB::info('Enabled');
}
FB::log('This should show');
示例8: error_reporting
* cmx; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*
* @package cmx
*/
/**
* cmx Connector
*
* @package cmx
*/
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config.core.php';
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CONNECTORS_PATH . 'index.php';
$corePath = $modx->getOption('cmx.core_path', null, $modx->getOption('core_path') . 'components/cmx/');
require_once $corePath . 'model/cmx/cmx.class.php';
$modx->cmx = new cmx($modx);
// FirePHP
require_once $corePath . 'library/FirePHPCore/fb.php';
// $firephp = FirePHP::getInstance(true);
FB::setEnabled(false);
// CM Create Send Handler
if (!$modx->loadClass('CMHandler', $corePath . 'model/cmx/', true, true)) {
$modx->log(modX::LOG_LEVEL_ERROR, '[CMx] Could not load CMHandler class.');
return '';
}
$modx->lexicon->load('cmx:default');
/* handle request */
$path = $modx->getOption('processorsPath', $modx->cmx->config, $corePath . 'processors/');
$modx->request->handleRequest(array('processors_path' => $path, 'location' => ''));
示例9: define
* along with INQ Calculators. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Main Controller
*
* @copyright Copyright 2010-2011
* @author Edward Rudd <urkle at outoforder.cc>
*/
define('APP_ROOT', dirname(__FILE__) . '/..');
define('WEB_ROOT', dirname(__FILE__));
$config = (include APP_ROOT . "/config.php");
// Set debugging if enabled
define('DEBUG', !empty($config->debug));
// Load up the class auto loader
require_once APP_ROOT . "/classes/Init.php";
FB::setEnabled(DEBUG);
Head::setDebug(DEBUG);
Template::addTemplatePath(APP_ROOT . '/templates');
Database::setDSN($config->db->dsn, $config->db->user, $config->db->password);
if ($config->memcache) {
$memcache = new Memcached();
$memcache->addServer($config->memcache->host, $config->memcache->port);
RO_Base::setMemcache($memcache, $config->memcache->expire);
Head::setMemecache($memcache);
}
if (empty($_GET['PATH_INFO'])) {
try {
if ($config->cachehome) {
header("Pragma: public");
header("Expires: " . gmdate('D, d M Y H:i:s', time() + $config->cachehome) . ' GMT');
} elseif (DEBUG) {
示例10: foreach
* Application settings — constants are defined, debug mode set, session checked
*******************************************************************************/
// Define site-wide constants
foreach ($_CONSTANTS as $key => $value) {
define($key, $value);
}
// Handles debugging. If TRUE, displays all errors and enables FirePHP logging
if (ACTIVATE_DEBUG_MODE === TRUE) {
ini_set("display_errors", 1);
ERROR_REPORTING(E_ALL);
FB::setEnabled(TRUE);
FB::warn("FirePHP logging is enabled! Sensitive data may be exposed.");
} else {
ini_set("display_errors", 0);
error_reporting(0);
FB::setEnabled(FALSE);
}
// Creates the database tables if set to true
if (BUILD_DATABASE === TRUE) {
DB_Actions::build_database();
}
// Check for a valid session
AdminUtilities::check_session();
/*******************************************************************************
* Break apart the URL and determine what data needs to be loaded
*******************************************************************************/
// URL Parsing - Read the URL and break it apart for processing
$url_array = Utilities::read_url();
// Load the menu
$menu = new Menu($url_array);
// Load the page attributes from the menu array
示例11: getDebug
private function getDebug()
{
if (file_exists('../ext/FirePHPCore/FirePHP.class.php')) {
require '../ext/FirePHPCore/FirePHP.class.php';
FB::setEnabled(self::$debug['debug']);
self::$db->getDebug();
FB::log($_SERVER, 'SERVER');
}
}
示例12: run
/**
* Sets the initial variables, checks if we need to process the css
* and then sends whichever file to the browser.
*
* @return void
* @author Anthony Short
**/
public static function run($get, $config = array(), $path = array())
{
static $run;
# This function can only be run once
if ($run === TRUE) {
return;
}
# If we want to debug (turn on errors and FirePHP)
if ($config['debug']) {
# Set the error reporting level.
error_reporting(E_ALL & ~E_STRICT);
# Set error handler
set_error_handler(array('CSScaffold', 'exception_handler'));
# Set exception handler
set_exception_handler(array('CSScaffold', 'exception_handler'));
# Turn on FirePHP
FB::setEnabled(true);
} else {
# Turn off errors
error_reporting(0);
FB::setEnabled(false);
}
# The default options
$default_config = array('debug' => false, 'in_production' => false, 'force_recache' => false, 'show_header' => true, 'auto_include_mixins' => true, 'override_import' => false, 'absolute_urls' => false, 'use_css_constants' => false, 'minify_css' => true, 'constants' => array(), 'disabled_plugins' => array());
# Merge them with our set options
$config = array_merge($default_config, $config);
# The default paths
$default_paths = array('document_root' => $_SERVER['DOCUMENT_ROOT'], 'css' => '../', 'system' => 'system', 'cache' => 'cache');
# Merge them with our set options
$path = array_merge($default_paths, $path);
# Set the options and paths in the config
self::config_set('core', $config);
# Set the paths in the config
self::config_set('core.path.docroot', fix_path($path['document_root']));
self::config_set('core.path.system', fix_path($path['system']));
self::config_set('core.path.cache', fix_path($path['cache']));
self::config_set('core.path.css', fix_path($path['css']));
self::config_set('core.url.css', str_replace(self::config('core.path.docroot'), '/', self::config('core.path.css')));
self::config_set('core.url.system', str_replace(self::config('core.path.docroot'), '/', SYSPATH));
# Load the include paths
self::include_paths(TRUE);
# Change into the system directory
chdir(SYSPATH);
# Set the output
if (isset($get['output'])) {
self::config_set('core.output', $get['output']);
}
# Parse the $_GET['request'] and set it in the config
self::config_set('core.request', self::parse_request($get['request']));
# Get the modified time of the CSS file
self::config_set('core.request.mod_time', filemtime(self::config('core.request.path')));
# Tell CSScaffold where to cache and tell if we want to recache
self::cache_set(self::config('core.path.cache'));
# Set it back to false if it's locked
if ($config['in_production'] and file_exists(self::$cached_file)) {
$recache = false;
} elseif ($config['force_recache'] or isset($get['recache']) or self::config('core.cache.mod_time') <= self::config('core.request.mod_time')) {
$recache = true;
self::cache_clear();
}
# Load the modules
self::load_modules($config['disabled_plugins']);
# Work in the same directory as the requested CSS file
chdir(dirname(self::config('core.request.path')));
# Create a new CSS object
CSS::load(self::config('core.request.path'));
# Parse it
if ($recache) {
self::parse_css();
}
# Log to Firebug
FB::group('CSScaffold Settings');
FB::log(self::config('core'));
FB::groupEnd();
# Output it
self::output(CSS::$css);
# Setup is complete, prevent it from being run again
$run = TRUE;
}
示例13: mb_internal_encoding
}
} else {
mb_internal_encoding('utf-8');
function p_strlen($str)
{
return mb_strlen($str);
}
function p_stripos($haystack, $needle, $offset = NULL)
{
return mb_stripos($haystack, $needle, $offset);
}
function p_strripos($haystack, $needle, $offset = NULL)
{
return mb_strripos($haystack, $needle, $offset);
}
function p_substr($str, $start, $length = NULL)
{
return mb_substr($str, $start, $length);
}
}
function array_fullsqlesc(&$item1, $key)
{
$item1 = '\'' . mysql_escape_string($item1) . '\'';
}
DataEngine::init();
if (CHECK_LOGIN) {
require_once INCLUDE_PATH . '/login.php';
}
/// ### Mode debug, root admin & dev ONLY ###
FB::setEnabled(IN_DEV && Members::CheckPerms(AXX_ROOTADMIN));
FB::info(DataEngine::$browser->getBrowser(), 'Browser');