本文整理匯總了PHP中EE_Error::error_type方法的典型用法代碼示例。如果您正苦於以下問題:PHP EE_Error::error_type方法的具體用法?PHP EE_Error::error_type怎麽用?PHP EE_Error::error_type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類EE_Error
的用法示例。
在下文中一共展示了EE_Error::error_type方法的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);
}
}