本文整理汇总了PHP中XenForo_Application::enablePhpErrorHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Application::enablePhpErrorHandler方法的具体用法?PHP XenForo_Application::enablePhpErrorHandler怎么用?PHP XenForo_Application::enablePhpErrorHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Application
的用法示例。
在下文中一共展示了XenForo_Application::enablePhpErrorHandler方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _renderTemplate
protected function _renderTemplate($template, array $params = array())
{
extract($params);
$compiler = new XenForo_Template_Compiler($template);
XenForo_Application::disablePhpErrorHandler();
@eval($compiler->compile());
XenForo_Application::enablePhpErrorHandler();
return htmlspecialchars_decode($__output, ENT_QUOTES);
}
示例2: prepareMailContents
/**
* Prepares the subject, plain text body, and HTML body.
*
* @param string|null $emailTitle Title of email to send. If not specified, uses value from consructor.
* @param array|null $params Params to pass to email template. If not specified, uses value from constructor.
*
* @return array|false False if the template can't be found; otherwise array with subject, bodyText, and bodyHtml keys
*/
public function prepareMailContents($emailTitle = null, array $params = null)
{
if ($emailTitle === null) {
$emailTitle = $this->_emailTitle;
}
if ($params === null) {
$params = $this->_params;
}
$__template = $this->_loadEmailTemplate($emailTitle);
if (!$__template) {
return false;
}
$__defaultLanguage = XenForo_Template_Helper_Core::getDefaultLanguage();
$__languages = XenForo_Application::get('languages');
if (isset($__languages[$this->_languageId])) {
XenForo_Template_Helper_Core::setDefaultLanguage($__languages[$this->_languageId]);
}
$xenOptions = XenForo_Application::get('options')->getOptions();
extract($params);
$__oldErrors = error_reporting(E_ALL & ~E_NOTICE);
XenForo_Application::disablePhpErrorHandler();
// these variables come from the $__template
$__subject = $__bodyText = $__bodyHtml = '';
eval($__template);
XenForo_Application::enablePhpErrorHandler();
error_reporting($__oldErrors);
XenForo_Template_Helper_Core::setDefaultLanguage($__defaultLanguage);
return array('subject' => $__subject, 'bodyText' => $__bodyText, 'bodyHtml' => $__bodyHtml);
}
示例3: prepareMailContents
/**
* Prepares the subject, plain text body, and HTML body.
*
* @param string|null $emailTitle Title of email to send. If not specified, uses value from consructor.
* @param array|null $params Params to pass to email template. If not specified, uses value from constructor.
*
* @return array|false False if the template can't be found; otherwise array with subject, bodyText, and bodyHtml keys
*/
public function prepareMailContents($emailTitle = null, array $params = null)
{
if ($emailTitle === null) {
$emailTitle = $this->_emailTitle;
}
if ($params === null) {
$params = $this->_params;
}
$__template = $this->_loadEmailTemplate($emailTitle);
if (!$__template) {
return false;
}
$__defaultLanguage = XenForo_Template_Helper_Core::getDefaultLanguage();
$__languages = XenForo_Application::get('languages');
if (isset($__languages[$this->_languageId])) {
XenForo_Template_Helper_Core::setDefaultLanguage($__languages[$this->_languageId]);
}
$xenOptions = XenForo_Application::get('options')->getOptions();
extract($params);
$emailLanguage = XenForo_Template_Helper_Core::getDefaultLanguage();
$emailIsRtl = isset($emailLanguage['text_direction']) && $emailLanguage['text_direction'] == 'RTL';
$__oldErrors = error_reporting(E_ALL & ~E_NOTICE);
XenForo_Application::disablePhpErrorHandler();
// these variables come from the $__template
$__subject = $__bodyText = $__bodyHtml = '';
eval($__template);
XenForo_Application::enablePhpErrorHandler();
error_reporting($__oldErrors);
XenForo_Template_Helper_Core::setDefaultLanguage($__defaultLanguage);
if ($emailIsRtl) {
$__bodyHtml = preg_replace_callback('/<rtlcss>(.*)<\\/rtlcss>/sU', array($this, '_replaceRtlCss'), $__bodyHtml);
} else {
$__bodyHtml = preg_replace('/<rtlcss>(.*)<\\/rtlcss>/sU', '\\1', $__bodyHtml);
}
return array('subject' => $__subject, 'bodyText' => $__bodyText, 'bodyHtml' => $__bodyHtml);
}