本文整理汇总了PHP中EE_Error::_format_error方法的典型用法代码示例。如果您正苦于以下问题:PHP EE_Error::_format_error方法的具体用法?PHP EE_Error::_format_error怎么用?PHP EE_Error::_format_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EE_Error
的用法示例。
在下文中一共展示了EE_Error::_format_error方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error_handler
/**
* error_handler
* @access public
* @param $code
* @param $message
* @param $file
* @param $line
* @return void
*/
public static function error_handler($code, $message, $file, $line)
{
$type = EE_Error::error_type($code);
$site = site_url();
switch ($site) {
case 'http://ee4.eventespresso.com/':
case 'http://ee4decaf.eventespresso.com/':
case 'http://ee4hf.eventespresso.com/':
case 'http://ee4a.eventespresso.com/':
case 'http://ee4ad.eventespresso.com/':
case 'http://ee4b.eventespresso.com/':
case 'http://ee4bd.eventespresso.com/':
case 'http://ee4d.eventespresso.com/':
case 'http://ee4dd.eventespresso.com/':
$to = 'developers@eventespresso.com';
break;
default:
$to = get_option('admin_email');
}
$subject = $type . ' ' . $message . ' in ' . EVENT_ESPRESSO_VERSION . ' on ' . site_url();
$msg = EE_Error::_format_error($type, $message, $file, $line);
if (function_exists('wp_mail')) {
add_filter('wp_mail_content_type', array('EE_Error', 'set_content_type'));
wp_mail($to, $subject, $msg);
}
echo '<div id="message" class="espresso-notices error"><p>';
echo $type . ': ' . $message . '<br />' . $file . ' line ' . $line;
echo '<br /></p></div>';
}
示例2: error_handler
/**
* error_handler
* @access public
* @param $code
* @param $message
* @param $file
* @param $line
* @return void
*/
public static function error_handler($code, $message, $file, $line)
{
if (!function_exists('wp_mail')) {
return;
}
$ver = espresso_version();
if (strpos($ver, 'dev') || strpos($ver, 'alpha') || strpos($ver, 'beta') || strpos($ver, 'hotfix')) {
$type = EE_Error::error_type($code);
$site = site_url();
switch ($site) {
case 'http://ee4.eventespresso.com/':
case 'http://ee4decaf.eventespresso.com/':
case 'http://ee4hf.eventespresso.com/':
case 'http://ee4a.eventespresso.com/':
case 'http://ee4ad.eventespresso.com/':
case 'http://ee4b.eventespresso.com/':
case 'http://ee4bd.eventespresso.com/':
case 'http://ee4d.eventespresso.com/':
case 'http://ee4dd.eventespresso.com/':
$to = 'developers@eventespresso.com';
break;
default:
$to = get_option('admin_email');
}
$subject = 'Error type ' . $type . ' occurred in ' . $ver . ' on ' . site_url();
$msg = EE_Error::_format_error($type, $message, $file, $line);
add_filter('wp_mail_content_type', array('EE_Error', 'set_content_type'));
wp_mail($to, $subject, $msg);
}
}