本文整理汇总了PHP中wp_debug_backtrace_summary函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_debug_backtrace_summary函数的具体用法?PHP wp_debug_backtrace_summary怎么用?PHP wp_debug_backtrace_summary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_debug_backtrace_summary函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: error_handler
function error_handler($type, $message, $file, $line)
{
$_key = md5($file . ':' . $line . ':' . $message);
switch ($type) {
case E_WARNING:
case E_USER_WARNING:
$this->warnings[$_key] = array($file . ':' . $line, $message, wp_debug_backtrace_summary(__CLASS__));
break;
case E_NOTICE:
case E_USER_NOTICE:
$this->notices[$_key] = array($file . ':' . $line, $message, wp_debug_backtrace_summary(__CLASS__));
break;
case E_STRICT:
// TODO
break;
case E_DEPRECATED:
case E_USER_DEPRECATED:
// TODO
break;
case 0:
// TODO
break;
}
if (null != $this->real_error_handler) {
return call_user_func($this->real_error_handler, $type, $message, $file, $line);
} else {
return false;
}
}
开发者ID:ppphoang,项目名称:ctynhua,代码行数:29,代码来源:class-debug-bar-php.php
示例2: start
public function start($false, $args, $url)
{
$log = array('url' => $url, 'method' => !empty($args['method']) ? $args['method'] : '', 'start' => microtime(true), 'backtrace' => wp_debug_backtrace_summary(__CLASS__));
if (isset($_GET['dbrr_full'])) {
$log['args'] = $args;
}
$this->log[] = $log;
return $false;
}
开发者ID:butuzov,项目名称:wp-debug-bar-remote-requests,代码行数:9,代码来源:debug-bar-remote-requests.php
示例3: log_error
static function log_error($message = '', $data = null)
{
$function = self::get_print_function();
$error = array('message' => $message, 'data' => $data, 'backtrace' => function_exists('wp_debug_backtrace_summary') ? wp_debug_backtrace_summary(null, 3) : '');
if (!in_array($error, self::$errors)) {
self::$errors[] = $error;
}
if (class_exists("GFLogging")) {
GFLogging::include_logger();
GFLogging::log_message('gravityview', $function($message, true) . $function($data, true), KLogger::ERROR);
}
}
开发者ID:roarmoser,项目名称:gv1,代码行数:12,代码来源:class-logging.php
示例4: log
/**
* Log
* Writes to PHP error logs if DEBUG is enabled.
*
* @param string $subject short title
* @param array $data data
* @return null
*/
public static function log($subject = '', $data = array())
{
if (self::DEBUG) {
error_log('+++' . $subject . ' +++++++++++++++++++++');
if (!empty($data)) {
error_log(print_r($data, true));
error_log('backtrace: ' . print_r(wp_debug_backtrace_summary(null, 0, false), true));
error_log('--------------------- ' . $subject . ' END ---------------------');
}
}
if (self::$record_logs) {
if (function_exists('wp_get_current_user')) {
self::record_log($subject, $data);
} else {
self::$recorded_logs[$subject] = $data;
}
}
}
开发者ID:danielbachhuber,项目名称:marcgratch.com,代码行数:26,代码来源:Logs.php
示例5: edited_term_taxonomy_action
/**
* Used to suspend cache invalidation, if a term is being edited
*/
public function edited_term_taxonomy_action($tt_id, $taxonomy)
{
global $wpdb, $_wp_suspend_cache_invalidation;
$this->was_suspended = $_wp_suspend_cache_invalidation;
// If cache is already disabled, then we don't need to do so again
if ($this->was_suspended) {
return;
}
$objects = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->term_relationships} WHERE term_taxonomy_id = %d", $tt_id));
//no action needed if there is less that $limimt number of objects to purge
if (intval($objects) < $this->limit) {
return;
}
// Make sure we're in `wp_update_term` - the only place we want this to happen
$backtrace = wp_debug_backtrace_summary(null, null, false);
if (!in_array('wp_update_term', $backtrace)) {
return;
}
wp_suspend_cache_invalidation(true);
//schedule WP Cron event for purging the cache
wp_schedule_single_event(time(), 'wpcom_vip_clean_tax_relations_cache', array($tt_id, $taxonomy));
}
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:25,代码来源:vip-clean-term-cache.php
示例6: get_caller
/**
* Retrieve the name of the function that called wpdb.
*
* Searches up the list of functions until it reaches
* the one that would most logically had called this method.
*
* @since 2.5.0
*
* @return string|array The name of the calling function
*/
public function get_caller()
{
return wp_debug_backtrace_summary(__CLASS__);
}
开发者ID:renanvicente,项目名称:codedeploytest,代码行数:14,代码来源:wp-db.php
示例7: log_http_request_result
function log_http_request_result($response, $context, $transport, $args, $url)
{
if ('response' != $context) {
return;
}
if (!isset($this->total_time)) {
$this->total_time = 0;
}
// We don't have an easy way to match exact requests initiated with those completed since $args can be changed before it gets to us here
if (isset($this->current_request['url']) && $url == $this->current_request['url']) {
$time_elapsed = microtime(true) - $this->current_request['start'];
} else {
$time_elapsed = -1;
// hm, some other request got in the way
}
// clear the values
$this->current_request = array();
if (!$response || is_wp_error($response)) {
$message = is_wp_error($response) ? $response->get_error_message() : 'Something clearly went very wrong...';
$status = 'fail';
} else {
$message = $response['response']['message'];
$status = $response['response']['code'];
}
$this->requests[$url][] = array('message' => $message, 'status' => $status, 'time' => $time_elapsed, 'backtrace' => wp_debug_backtrace_summary());
if (-1 < $time_elapsed) {
$this->total_time += $time_elapsed;
}
// Prevent debug notice if no request counts exist yet
if (empty($this->status_counts['Total Requests'])) {
$this->status_counts['Total Requests'] = 0;
}
$this->status_counts['Total Requests']++;
switch (substr($status, 0, 1)) {
case 1:
$this->status_counts['Informational (1xx)']++;
case 2:
$this->status_counts['Success (2xx)']++;
break;
case 3:
$this->status_counts['Multiple Choices (3xx)']++;
break;
case 4:
$this->status_counts['Client Error (4xx)']++;
break;
case 5:
$this->status_counts['Server Error (5xx)']++;
break;
default:
$this->status_counts['Unknown']++;
break;
}
}
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:53,代码来源:vip-debug-bar-panels.php
示例8: _nullify_current_user
function _nullify_current_user() {
// Prevents fatal errors in ::tearDown()'s and other uses of restore_current_blog()
$function_stack = wp_debug_backtrace_summary( null, 0, false );
if ( in_array( 'restore_current_blog', $function_stack ) ) {
return;
}
$GLOBALS['current_user'] = null;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:8,代码来源:capabilities.php
示例9: wp_trim_words
function wp_trim_words($text = '', $num_words = 110, $more = '', $original_text = '')
{
if ('characters' != _x('words', 'word count: words or characters?')) {
return $text;
}
// If the caller is wp_dashboard_recent_drafts()
if (false !== $this->conf['patch_dashboard_recent_drafts'] && 10 === $num_words && is_admin() && strpos(wp_debug_backtrace_summary(), 'wp_dashboard_recent_drafts')) {
$num_words = $this->conf['dashboard_recent_drafts_mblength'];
}
$text = $original_text;
$text = wp_strip_all_tags($text);
$text = trim(preg_replace("/[\n\r\t ]+/", ' ', $text), ' ');
if (mb_strlen($text, $this->blog_encoding) > $num_words) {
$text = mb_substr($text, 0, $num_words, $this->blog_encoding) . $more;
}
return $text;
}
开发者ID:Vinnica,项目名称:theboxerboston.com,代码行数:17,代码来源:class.php
示例10: PrintDebugTrace
static function PrintDebugTrace($tag = "")
{
if (!empty($_GET['debug'])) {
wpfb_loadclass('Output');
$ms = self::GetMemStats();
echo "<!-- [{$tag}] (MEM: " . WPFB_Output::FormatFilesize($ms['used']) . " / {$ms['limit']}) BACKTRACE:\n";
echo esc_html(print_r(wp_debug_backtrace_summary(), true));
echo "\nEND -->";
self::UpdateMemBar();
}
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:11,代码来源:Sync.php
示例11: get_caller
/**
* Get the name of the function that called wpdb()
*
* @return string the name of the calling function
*/
public function get_caller()
{
if (function_exists('wp_debug_backtrace_summary')) {
return wp_debug_backtrace_summary(__CLASS__);
}
// requires PHP 4.3+
if (!is_callable('debug_backtrace')) {
return '';
}
$bt = debug_backtrace(false);
$caller = '';
foreach ((array) $bt as $trace) {
if (isset($trace['class']) && is_a($this, $trace['class'])) {
continue;
} elseif (!isset($trace['function'])) {
continue;
} elseif (strtolower($trace['function']) === 'call_user_func_array') {
continue;
} elseif (strtolower($trace['function']) === 'apply_filters') {
continue;
} elseif (strtolower($trace['function']) === 'do_action') {
continue;
}
if (isset($trace['class'])) {
$caller = $trace['class'] . '::' . $trace['function'];
} else {
$caller = $trace['function'];
}
break;
}
return $caller;
}
开发者ID:stuttter,项目名称:ludicrousdb,代码行数:37,代码来源:class-ludicrousdb.php
示例12: _vip_contrib_add_upload_cap
/**
* Helper function for vip_contrib_add_upload_cap() to change the user roles
*
* @link http://vip.wordpress.com/documentation/allow-contributors-to-upload-images/ Allow Contributors to Upload Images
* @see vip_contrib_add_upload_cap()
*/
function _vip_contrib_add_upload_cap()
{
if (!is_admin() && !defined('XMLRPC_REQUEST')) {
return;
}
if (function_exists('wpcom_vip_add_role_caps')) {
wpcom_vip_add_role_caps('contributor', array('upload_files'));
} else {
// Temp debug to track down broken themes
if (function_exists('send_vip_team_irc_alert')) {
send_vip_team_irc_alert('[vip-helper fatal] ' . site_url() . ' add_role_cap no exist for _vip_contrib_add_upload_cap: ' . wp_debug_backtrace_summary());
}
}
}
开发者ID:GiantRobX,项目名称:wordpress-vip-plugins,代码行数:20,代码来源:vip-helper-wpcom.php
示例13: test_print_log
public function test_print_log($message = '', $data = null)
{
$error = array('message' => $message, 'data' => $data, 'backtrace' => function_exists('wp_debug_backtrace_summary') ? wp_debug_backtrace_summary(null, 3) : '');
fwrite(STDERR, print_r($error, true));
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:5,代码来源:bootstrap.php
示例14: init
/**
* @since 2.5.2
*/
public function init()
{
/**
* Fires before Simple History does it's init stuff
*
* @since 2.0
*
* @param SimpleHistory $SimpleHistory This class.
*/
do_action("simple_history/before_init", $this);
$this->setup_variables();
// Actions and filters, ordered by order specified in codex: http://codex.wordpress.org/Plugin_API/Action_Reference
add_action('after_setup_theme', array($this, 'load_plugin_textdomain'));
add_action('after_setup_theme', array($this, 'add_default_settings_tabs'));
// Plugins and dropins are loaded using the "after_setup_theme" filter so
// themes can use filters to modify the loading of them.
// The drawback with this is that for example logouts done when plugins like
// iThemes Security is installed is not logged, because those plugins fire wp_logout()
// using filter "plugins_loaded", i.e. before simple history has loaded its filters.
add_action('after_setup_theme', array($this, 'load_loggers'));
add_action('after_setup_theme', array($this, 'load_dropins'));
// Run before loading of loggers and before menu items are added
add_action('after_setup_theme', array($this, 'check_for_upgrade'), 5);
add_action('after_setup_theme', array($this, 'setup_cron'));
// Filters and actions not called during regular boot
add_filter("gettext", array($this, 'filter_gettext'), 20, 3);
add_filter("gettext_with_context", array($this, 'filter_gettext_with_context'), 20, 4);
add_filter('gettext', array($this, "filter_gettext_storeLatestTranslations"), 10, 3);
add_action('admin_bar_menu', array($this, 'add_admin_bar_network_menu_item'), 40);
add_action('admin_bar_menu', array($this, 'add_admin_bar_menu_item'), 40);
/**
* Filter that is used to log things, without the need to check that simple history is available
* i.e. you can have simple history acivated and log things and then you can disable the plugin
* and no errors will occur
*
* Usage:
* apply_filters("simple_history_log", "This is the log message");
* apply_filters("simple_history_log", "This is the log message with some extra data/info", ["extraThing1" => $variableWIihThing]);
* apply_filters("simple_history_log", "This is the log message with severity debug", null, "debug");
* apply_filters("simple_history_log", "This is the log message with severity debug and with some extra info/data logged", ["userData" => $userData, "shoppingCartDebugData" => $shopDebugData], "debug",);
*
* @since 2.13
*/
add_filter('simple_history_log', array($this, "on_filter_simple_history_log"), 10, 3);
if (is_admin()) {
$this->add_admin_actions();
}
/**
* Fires after Simple History has done it's init stuff
*
* @since 2.0
*
* @param SimpleHistory $SimpleHistory This class.
*/
do_action("simple_history/after_init", $this);
// Add some extra info to each logged context when SIMPLE_HISTORY_LOG_DEBUG is set and true
if (defined("SIMPLE_HISTORY_LOG_DEBUG") && SIMPLE_HISTORY_LOG_DEBUG) {
add_filter("simple_history/log_argument/context", function ($context, $level, $message, $logger) {
$sh = SimpleHistory::get_instance();
$context["_debug_get"] = $sh->json_encode($_GET);
$context["_debug_post"] = $sh->json_encode($_POST);
$context["_debug_server"] = $sh->json_encode($_SERVER);
$context["_debug_files"] = $sh->json_encode($_FILES);
$context["_debug_php_sapi_name"] = php_sapi_name();
global $argv;
$context["_debug_argv"] = $sh->json_encode($argv);
$consts = get_defined_constants(true);
$consts = $consts["user"];
$context["_debug_user_constants"] = $sh->json_encode($consts);
$postdata = file_get_contents("php://input");
$context["_debug_http_raw_post_data"] = $sh->json_encode($postdata);
$context["_debug_wp_debug_backtrace_summary"] = wp_debug_backtrace_summary();
$context["_debug_is_admin"] = json_encode(is_admin());
$context["_debug_is_doing_cron"] = json_encode(defined('DOING_CRON') && DOING_CRON);
return $context;
}, 10, 4);
}
}
开发者ID:bonny,项目名称:wordpress-simple-history,代码行数:81,代码来源:SimpleHistory.php
示例15: esc_html_e
/**
* Wrapper around esc_html__
* @param string $string
* @return
*/
public static function esc_html_e($string)
{
if (self::DEBUG) {
error_log('backtrace: ' . print_r(wp_debug_backtrace_summary(null, 0, false), true));
_deprecated_function(__CLASS__ . '::' . __FUNCTION__, '9.0', '__');
}
return esc_html_e($string, self::TEXT_DOMAIN);
}
开发者ID:danielbachhuber,项目名称:marcgratch.com,代码行数:13,代码来源:Sprout_Invoices.class.php
示例16: deprecated_argument_run
function deprecated_argument_run($function, $message, $version)
{
$backtrace = debug_backtrace(false);
if ($function === 'define()') {
$this->deprecated_functions[] = array($message, '');
return;
}
$bt = 4;
if (!isset($backtrace[4]['file']) && 'call_user_func_array' == $backtrace[5]['function']) {
$bt = 6;
}
$file = $backtrace[$bt]['file'];
$line = $backtrace[$bt]['line'];
$this->deprecated_functions[$file . ':' . $line] = array($message, wp_debug_backtrace_summary(null, $bt));
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:15,代码来源:class-debug-bar-deprecated.php
示例17: wpbt
function wpbt()
{
error_log('backtrace: ' . print_r(wp_debug_backtrace_summary(null, 0, false), true));
}
开发者ID:danielbachhuber,项目名称:marcgratch.com,代码行数:4,代码来源:utility.php
示例18: is_unscheduling
/**
* Determine if current request is a call to `wp_unschedule_event()`
*/
private function is_unscheduling()
{
return false !== array_search('wp_unschedule_event', wp_debug_backtrace_summary(__CLASS__, null, false));
}
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:7,代码来源:class-cron-options-cpt.php
示例19: backtrace
public function backtrace()
{
$version = get_bloginfo('version');
if ($version >= 3.4) {
$debug = '<h3>' . __('Backtrace Summary', 'debug-this') . '</h3>';
$debug .= print_r(explode(', ', wp_debug_backtrace_summary()), true);
}
$debug .= '<h3>' . __('debug_backtrace()', 'debug-this') . '</h3>';
$debug .= htmlentities(print_r(debug_backtrace(), true));
return $debug;
}
开发者ID:Kilbourne,项目名称:restart,代码行数:11,代码来源:extensions.php
注:本文中的wp_debug_backtrace_summary函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论