本文整理汇总了PHP中FB::warn方法的典型用法代码示例。如果您正苦于以下问题:PHP FB::warn方法的具体用法?PHP FB::warn怎么用?PHP FB::warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FB
的用法示例。
在下文中一共展示了FB::warn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
public static function fire($value)
{
$dbgs = array_shift(debug_backtrace());
$msg = date('[ Y-m-d H:i:s ]' . "\n");
$msg .= 'file: ' . $dbgs['file'] . "\n";
$msg .= 'line: ' . $dbgs['line'] . "\n\n";
FB::warn($msg);
FB::error($value);
}
示例2: __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);
}
}
示例3: array
public function &get($key = null)
{
if (is_array($key)) {
$ret = array();
foreach ($key as $k => $v) {
$ret[$k] =& self::get($v);
}
return $ret;
}
$start = microtime(true);
$data = shm_get_var(self::$SHMhandle, self::getVarKey($key));
if (!is_null($data)) {
if (time() <= $data['expire']) {
return $data['data'];
} else {
@shm_remove_var(self::$SHMhandle, self::getVarKey($key));
}
}
FB::warn("Cache Miss {$key}: " . (microtime(true) - $start));
return null;
}
示例4: actionIndex
public function actionIndex()
{
// logging an INFO message
Yii::log('This is an info message.', CLogger::LEVEL_INFO);
// logging a WARNING message
Yii::log("You didn't setup a profile, are you really a person?", CLogger::LEVEL_WARNING);
// logging with a CATEGORY (categories are displayed as "labels" in FirePHP -- just an additional info text)
Yii::log('Profile successfully created', CLogger::LEVEL_INFO, 'application.user.profiles');
// tracing simple text
Yii::trace('Loading application.user.profiles.ninja', 'application.user.profiles');
// logging an ERROR
Yii::log('We have successfully determined that you are not a person', CLogger::LEVEL_ERROR, 'Any category/label will work');
// If you need to log an array, you can use FirePHP's core methods
FB::warn(array('a' => 'b', 'c' => 'd'), 'an.array.warning');
// Profiling
Yii::beginProfile('rendering');
for ($i = 0; $i < 30; $i++) {
$this->runProfilingSampleLoop();
}
$this->render('index');
Yii::endProfile('rendering');
}
示例5: msg
/**
* (non-PHPdoc)
* @see debugObject::msg()
*/
public function msg($msg, $level = DEBUG_LOG)
{
if (!empty($msg) && $this->_level & $level) {
if (DEBUG_INFO & $level) {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true));
FB::info($msg);
FB::groupEnd();
} else {
FB::info($msg);
}
} elseif (DEBUG_ERROR & $level || DEBUG_STRICT & $level) {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true, 'Color' => '#FF0000'));
FB::error($msg);
FB::groupEnd();
} else {
FB::error($msg);
}
} elseif (DEBUG_WARNING & $level) {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true, 'Color' => '#FF0000'));
FB::warn($msg);
FB::groupEnd();
} else {
FB::warn($msg);
}
} else {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true));
FB::log($msg);
FB::groupEnd();
} else {
FB::log($msg);
}
}
}
}
示例6: getQuizXML
/**
* Legge il quiz da file XML.
* Cerca il file in "$content_path/$itemid/$itemid.xml".
*
* @param int $itemid ID del contenuto di cui si vogliono i jumper.
* @param string $content_path Percorso dove cercare il file XML.
* @return array
*/
public function getQuizXML($path)
{
try {
$path .= '/quiz.xml';
$filepath = JPATH_BASE . "/" . $path;
if (!file_exists($filepath)) {
FB::warn("Il file QUIZ.XML non esiste, ma nessun problema, procedo senza di lui!");
return array();
}
$domande = array();
$risposte = array();
$xml = new DOMDocument();
$xml->load($path);
$quiz = $xml->getElementsByTagName('quiz');
$i = 0;
foreach ($quiz as $point) {
foreach ($point->childNodes as $node) {
$domande[$i]['id'] = $i;
if ('Time' == $node->nodeName) {
$domande[$i]['time'] = $node->nodeValue;
} elseif ('domanda' == $node->nodeName) {
$domande[$i]['domanda'] = $node->nodeValue;
} elseif ('corretta' == $node->nodeName) {
$corretta = $node->nodeValue;
} elseif ('risposta1' == $node->nodeName) {
$domande[$i]['risposte'][1]['r'] = $node->nodeValue;
$domande[$i]['risposte'][1]['c'] = 1 == $corretta ? r : w;
} elseif ('risposta2' == $node->nodeName) {
$domande[$i]['risposte'][2]['r'] = $node->nodeValue;
$domande[$i]['risposte'][2]['c'] = 2 == $corretta ? r : w;
} elseif ('risposta3' == $node->nodeName) {
$domande[$i]['risposte'][3]['r'] = $node->nodeValue;
$domande[$i]['risposte'][3]['c'] = 3 == $corretta ? r : w;
}
shuffle($domande[$i]['risposte']);
}
$i++;
}
unset($xml);
unset($quiz);
return $domande;
} catch (Exception $e) {
FB::error($e);
}
return 0;
}
示例7: __construct
function __construct()
{
ob_start();
// Display time it took to create the entire page in the footer
jimport('joomla.error.profiler');
$__kstarttime = JProfiler::getmicrotime();
$kunena_config = KunenaFactory::getConfig();
kimport('error');
KunenaError::initialize();
// First of all take a profiling information snapshot for JFirePHP
if (JDEBUG) {
require_once JPATH_COMPONENT . '/lib/kunena.profiler.php';
$__profiler = KProfiler::GetInstance();
$__profiler->mark('Start');
}
$func = JString::strtolower(JRequest::getCmd('func', JRequest::getCmd('view', '')));
$do = JRequest::getCmd('do', '');
$task = JRequest::getCmd('task', '');
$format = JRequest::getCmd('format', 'html');
JRequest::setVar('func', $func);
// Workaround for Joomla 1.7.3 login bug, see: https://github.com/joomla/joomla-platform/pull/740
if ($func == 'profile' && ($task == 'login' || $task == 'logout')) {
require_once KUNENA_PATH_FUNCS . '/profile.php';
$page = new CKunenaProfile(JFactory::getUser()->id, $task);
}
require_once KUNENA_PATH . '/router.php';
if ($func && !isset(KunenaRouter::$functions[$func])) {
// If func is not legal, raise joomla error
return JError::raiseError(404, 'Kunena function "' . $func . '" not found');
}
$kunena_app = JFactory::getApplication();
if (empty($_POST) && $format == 'html') {
$me = KunenaFactory::getUser();
$menu = JSite::getMenu();
$active = $menu->getActive();
// Joomla 1.6+ multi-language support
if (isset($active->language) && $active->language != '*') {
$language = JFactory::getDocument()->getLanguage();
if (strtolower($active->language) != strtolower($language)) {
$this->redirect(KunenaRoute::_(null, false));
}
}
// Legacy menu item and Itemid=0 support with redirect and notice
if (empty($active->query['view'])) {
$new = $menu->getItem(KunenaRoute::getItemID());
if ($new) {
if ($active) {
if ($active->route == $new->route) {
KunenaError::warning(JText::sprintf('COM_KUNENA_WARNING_MENU_CONFLICT', $active->route, $active->id, $new->id), 'menu');
$menu->setActive($new->id);
$active = $new;
} else {
KunenaError::warning(JText::sprintf('COM_KUNENA_WARNING_MENU_LEGACY', $active->route, $active->id, $new->route, $new->id), 'menu');
$this->redirect(KunenaRoute::_(null, false));
}
} else {
KunenaError::warning(JText::sprintf('COM_KUNENA_WARNING_MENU_NO_ITEM_REDIRECT', $new->route, $new->id));
$this->redirect(KunenaRoute::_(null, false));
}
} elseif (!$active) {
KunenaError::warning(JText::sprintf('COM_KUNENA_WARNING_MENU_NO_ITEM'));
}
}
if (!$func || $func == 'entrypage') {
// If we are currently in entry page, we need to show and highlight default menu item
if (!empty($active->query['defaultmenu'])) {
$defaultitem = $active->query['defaultmenu'];
if ($defaultitem > 0) {
$newitem = $menu->getItem($defaultitem);
if (!$newitem) {
KunenaError::warning(JText::sprintf('COM_KUNENA_WARNING_MENU_NOT_EXISTS'), 'menu');
} elseif (empty($newitem->component) || $newitem->component != 'com_kunena') {
KunenaError::warning(JText::sprintf('COM_KUNENA_WARNING_MENU_NOT_KUNENA'), 'menu');
} elseif ($active->route == $newitem->route) {
// Special case: we are using Entry Page instead of menu alias and we have identical menu alias
if ($active->id != $newitem->id) {
$defaultitem = !empty($newitem->query['defaultmenu']) ? $newitem->query['defaultmenu'] : $newitem->id;
$newitem2 = $menu->getItem($defaultitem);
if (empty($newitem2->component) || $newitem2->component != 'com_kunena') {
$defaultitem = $newitem->id;
}
if ($defaultitem) {
$menu->setActive($defaultitem);
$active = $menu->getActive();
}
}
} else {
$oldlocation = KunenaRoute::getCurrentMenu();
$menu->setActive($defaultitem);
$active = $menu->getActive();
$newlocation = KunenaRoute::getCurrentMenu();
if (!$oldlocation || $oldlocation->id != $newlocation->id) {
// Follow Default Menu Item if it's not in the same menu
$this->redirect(KunenaRoute::_($defaultitem, false));
}
}
if (is_object($active)) {
foreach ($active->query as $var => $value) {
if ($var == 'view') {
$var = 'func';
//.........这里部分代码省略.........
示例8: fireBugSqlDump
/**
* Zrzucenie SQL-a i jego parametrów do okna firebuga
*
* @param String $dumpName - nazwa wyświetlanej operacji
* @param String $sql - zapytanie SQL
* @param Array $params - parametry zapytania (dane)
* @param int $execTime
*/
public function fireBugSqlDump($dumpName, $sql = "", array $params = array(), $execTime = 0)
{
// Odczytanie klasy i metody, w której wyświetlony zostanie komunikat
$className = get_class($this);
$methodName = '';
$filePath = '';
$lineNumber = '';
$traceList = debug_backtrace();
$traceArr = array();
foreach ($traceList as $trace) {
if (!isset($trace['class']) || in_array($trace['class'], $this->sqlIgnoreClass)) {
continue;
}
if (count($traceArr) == 0) {
$className = $trace['class'];
$methodName = isset($trace['function']) ? $trace['function'] : '';
$filePath = isset($trace['file']) ? str_replace(APP_PATH, '', $trace['file']) : '';
$lineNumber = isset($trace['line']) ? $trace['line'] : -1;
}
if (isset($trace['object'])) {
unset($trace['object']);
}
$traceArr[] = $trace;
}
// Czas generowania SQL-a
$sqlTime = microtime(true);
$sqlTimeDiff = round($sqlTime - (isset($_SESSION['sql_last_time']) ? $_SESSION['sql_last_time'] : 0), 4);
$execTime = round($execTime, 4);
// Wyświetlenie komunikatu debug-a
if (empty($sql)) {
// Debugowanie dodatkowych informacji (utworzenie połączenia, otwarcie/zamknięcie transakcji)
if (DB_DEBUG) {
FB::info((object) array('OPERATION' => $dumpName, 'BACKTRACE' => $traceArr), "INFO ({$sqlTime} [+{$sqlTimeDiff}]) :: {$filePath}:{$lineNumber} :: {$className}->{$methodName}");
}
} else {
FB::warn((object) array('OPERATION' => $dumpName, 'SQL+PARAMS' => $this->_sqlFormat($this->_prepareFullQuery($sql, $params)), 'SQL' => "\n" . $sql . "\n", 'PARAMS' => $params, 'BACKTRACE' => $traceArr), "SQL ({$sqlTime} [+{$sqlTimeDiff}ms] {{$execTime}ms}) :: {$filePath}:{$lineNumber} :: {$className}->{$methodName}");
}
}
示例9: warn
/**
* Intefacet to FirePHP warn, just to make things easier
*
* @param $data
* @param $label
*/
public static function warn($data, $label)
{
FB::warn($data, $label);
}
示例10: __construct
public function __construct()
{
if (isset($_SESSION['carte_prefs']) && $_SESSION['carte_prefs'] != '') {
$this->load_prefs($_SESSION['carte_prefs']);
} else {
$this->load_prefs('1;1;1;1;0;600;1;1;1');
}
$this->parcours = '';
if (IS_IMG) {
// $this->inactif = $_SESSION['inactif'];
$this->IN = $_SESSION['IN'];
$this->OUT = $_SESSION['OUT'];
$this->loadfleet = isset($_SESSION['loadfleet']) ? $_SESSION['loadfleet'] : '';
$this->parcours = $_SESSION['parcours'];
} else {
if (isset($_POST['coorin'])) {
$this->IN = intval($_POST['coorin']);
} else {
$this->IN = 0;
}
if (isset($_POST['coorout'])) {
$this->OUT = intval($_POST['coorout']);
} else {
$this->OUT = 0;
}
if ($this->IN < 1 || $this->IN > 10000) {
$this->IN = '';
}
if ($this->OUT < 1 || $this->OUT > 10000) {
$this->OUT = '';
}
$this->loadfleet = (isset($_REQUEST['loadfleet']) and intval($_REQUEST['loadfleet']) > 0) ? intval($_REQUEST['loadfleet']) : 0;
$this->method = (isset($_REQUEST['method']) and intval($_REQUEST['method']) > 0) ? intval($_REQUEST['method']) : 2;
// $this->inactif = ( isset($_POST['inactif']) && $_POST['inactif'] > 0 ) ? true: false;
$this->nointrass = isset($_POST['nointrass']) && $_POST['nointrass'] > 0 ? true : false;
$this->update_session();
FB::warn($this->method, 'method');
}
// mise en variable, plus rapide que 36 call function
if (($this->empire = trim(DataEngine::config_key('config', 'MyEmpire'))) == '') {
$mysql_result = DataEngine::sql('Select g.`Grade` from
`SQL_PREFIX_Membres` as m, `SQL_PREFIX_Grade` as g WHERE
`Joueur`=\'' . sqlesc($_SESSION['_login']) . '\' AND (m.`Grade`=g.`GradeId`)');
$ligne = mysql_fetch_assoc($mysql_result);
$grade = $ligne['Grade'];
$this->empire = $ligne['Grade'];
}
$this->cxx_empires = Members::CheckPerms('CARTE_SHOWEMPIRE');
$this->lng = language::getinstance()->GetLngBlock('carte');
$this->itineraire = $this->IN != '' && $this->OUT != '' && $this->IN != $this->OUT;
}
示例11: foreach
include_once CMS_PATH . 'core/class.page.inc.php';
// FirePHP class for debugging (requires Firefox)
include_once CMS_PATH . 'debug/fb.php';
// Define site-wide constants
foreach ($_CONSTANTS as $key => $value) {
define($key, $value);
}
/*
* Handles debugging. If set to TRUE, displays all errors and enables logging
* through FirePHP.
*/
if (ACTIVATE_DEBUG_MODE === TRUE) {
ini_set("display_errors", 1);
ERROR_REPORTING(E_ALL);
FB::setEnabled(TRUE);
FB::warn("FirePHP logging enabled.");
} else {
ini_set("display_errors", 0);
error_reporting(0);
FB::setEnabled(FALSE);
}
// URL Parsing - Read the URL and break it apart for processing
$url_array = Utilities::readUrl();
if (!is_array($url_array) && file_exists($url_array)) {
require_once $url_array;
}
// Creates a database object
$dbo = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Creates the database tables if set to true
if (CREATE_DB === TRUE) {
AdminUtilities::buildDB($menuPages);
示例12: OnWarning
public function OnWarning($msg,$label=null)
{
\FB::warn($msg, $label);
}
示例13:
// Credits
echo '<div class="fb_credits"> ' . CKunenaLink::GetTeamCreditsLink($catid, _KUNENA_POWEREDBY) . ' ' . CKunenaLink::GetCreditsLink();
if ($fbConfig->enablerss) {
$document->addCustomTag('<link rel="alternate" type="application/rss+xml" title="' . _LISTCAT_RSS . '" href="' . JRoute::_(KUNENA_LIVEURLREL . '&func=fb_rss&no_html=1') . '" />');
echo CKunenaLink::GetRSSLink('<img class="rsslink" src="' . KUNENA_URLEMOTIONSPATH . 'rss.gif" border="0" alt="' . _LISTCAT_RSS . '" title="' . _LISTCAT_RSS . '" />');
}
echo '</div>';
// display footer
$KunenaTemplate->displayParsedTemplate('kunena-footer');
}
}
//else
if (is_object($kunenaProfile)) {
$kunenaProfile->close();
}
if (JDEBUG == 1) {
$__profiler->mark('Done');
$__queries = $__profiler->getQueryCount();
if (defined('JFIREPHP')) {
FB::log($__profiler->getBuffer(), 'Kunena Profiler');
if ($__queries > 50) {
FB::error($__queries, 'Kunena Queries');
} else {
if ($__queries > 35) {
FB::warn($__queries, 'Kunena Queries');
} else {
FB::log($__queries, 'Kunena Queries');
}
}
}
}
示例14: header
<?php
header("Content-type: text/html; charset=utf-8");
require_once 'fb.php';
FB::log('Log message');
FB::info('info message');
FB::warn('warn message');
FB::error('error message');
$var = array('abc');
fb($var, FirePHP::TRACE);
//End_php
示例15: session_start
<?php
session_start();
$_DEBUG = true;
//调试模式
include_once 'conn.php';
include_once 'library/basefunction.php';
include_once 'lang/envinit.php';
include_once 'templatefunction/Iron.article.php';
include_once 'templatefunction/Iron.column.php';
include_once 'templatefunction/Iron.label.php';
loadlibrary("library/third/FirePHPCore/fb.php");
FB::log('Log message');
FB::info('Info message');
FB::warn('Warn message');
FB::error('Error message');
readcache();
$siteconfig = getresult("SELECT * FROM I_siteconfig LIMIT 0 , 1");
//如果没有网站配置项
if (getresultNumrows($siteconfig) < 1) {
die("<script type='text/javascript'>window.location='error.html'</script>");
}
$templateid = getresultData($siteconfig, 0, "indextemplate");
$templateinfo = getresult("select * from I_template where id={$templateid} limit 0,1");
if (getresultNumrows($templateinfo) < 1) {
die("<script type='text/javascript'>window.location='error.html'</script>");
}
$templatepath = getresultData($templateinfo, 0, "path");
$templatefile = getroot() . "/templates/" . $templatepath;
//echo $templatefile;
if (!file_exists($templatefile)) {