本文整理汇总了PHP中rex::isDebugMode方法的典型用法代码示例。如果您正苦于以下问题:PHP rex::isDebugMode方法的具体用法?PHP rex::isDebugMode怎么用?PHP rex::isDebugMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex
的用法示例。
在下文中一共展示了rex::isDebugMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rex_fragment
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content[] = $fragment->parse('core/form/form.php');
$elements = '';
$formElements = [];
$n = [];
$n['label'] = '<label for="rex-id-lang">' . rex_i18n::msg('backend_language') . '</label>';
$n['field'] = $sel_lang->get();
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$elements .= $fragment->parse('core/form/form.php');
$formElements = [];
$n = [];
$n['label'] = '<label for="rex-id-debug">' . rex_i18n::msg('debug_mode') . '</label>';
$n['field'] = '<input type="checkbox" id="rex-id-debug" name="settings[debug]" value="1" ' . (rex::isDebugMode() ? 'checked="checked" ' : '') . '/>';
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$elements .= $fragment->parse('core/form/checkbox.php');
foreach (rex_system_setting::getAll() as $setting) {
$field = $setting->getField();
if (!$field instanceof rex_form_element) {
throw new rex_exception(get_class($setting) . '::getField() must return a rex_form_element!');
}
$field->setAttribute('name', 'settings[' . $setting->getKey() . ']');
$elements .= $field->get();
}
$content[] = $elements;
$fragment = new rex_fragment();
$fragment->setVar('content', $content, false);
示例2: handleError
/**
* Handles a error message.
*
* @param int $errno The error code to handle
* @param string $errstr The error message
* @param string $errfile The file in which the error occured
* @param int $errline The line of the file in which the error occured
*
* @throws ErrorException
*/
public static function handleError($errno, $errstr, $errfile, $errline)
{
if (in_array($errno, [E_USER_ERROR, E_ERROR, E_COMPILE_ERROR, E_RECOVERABLE_ERROR, E_PARSE])) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
} elseif ((error_reporting() & $errno) == $errno) {
if (ini_get('display_errors') && (rex::isSetup() || rex::isDebugMode() || ($user = rex_backend_login::createUser()) && $user->isAdmin())) {
echo '<div><b>' . self::getErrorType($errno) . "</b>: {$errstr} in <b>{$errfile}</b> on line <b>{$errline}</b></div>";
}
rex_logger::logError($errno, $errstr, $errfile, $errline);
}
}