本文整理汇总了PHP中Debug::is_debug_mode_enabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::is_debug_mode_enabled方法的具体用法?PHP Debug::is_debug_mode_enabled怎么用?PHP Debug::is_debug_mode_enabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::is_debug_mode_enabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: raw_display
private function raw_display()
{
if (Debug::is_debug_mode_enabled()) {
Debug::fatal($this->exception);
} else {
die(ErrorHandler::FATAL_MESSAGE);
}
}
示例2: get_advises
public static function get_advises(HTMLForm $html_form)
{
$lang = LangLoader::get('admin-server-common');
$server_configuration = new ServerConfiguration();
$maintenance_config = MaintenanceConfig::load();
$general_config = GeneralConfig::load();
$server_environment_config = ServerEnvironmentConfig::load();
$security_config = SecurityConfig::load();
$url_rewriting_available = false;
try {
$url_rewriting_available = $server_configuration->has_url_rewriting();
} catch (UnsupportedOperationException $ex) {
}
$fieldset = new FormFieldsetHTML('advises', $lang['advises']);
$fieldset->add_field(new FormFieldFree('modules_management', '', MessageHelper::display($lang['advises.modules_management'], MessageHelper::SUCCESS)->render()));
if ($maintenance_config->is_under_maintenance()) {
$fieldset->add_field(new FormFieldFree('check_modules_authorizations', '', MessageHelper::display($lang['advises.check_modules_authorizations'], MessageHelper::SUCCESS)->render()));
}
if (!strstr($general_config->get_site_url(), 'localhost') && !strstr($general_config->get_site_url(), '127.0.0.1') && !$maintenance_config->is_under_maintenance() && Debug::is_debug_mode_enabled()) {
$fieldset->add_field(new FormFieldFree('disable_debug_mode', '', MessageHelper::display($lang['advises.disable_debug_mode'], MessageHelper::WARNING)->render()));
}
if ($url_rewriting_available && !$server_environment_config->is_url_rewriting_enabled()) {
$fieldset->add_field(new FormFieldFree('enable_url_rewriting', '', MessageHelper::display($lang['advises.enable_url_rewriting'], MessageHelper::NOTICE)->render()));
}
if (function_exists('ob_gzhandler') && @extension_loaded('zlib') && !$server_environment_config->is_output_gziping_enabled()) {
$fieldset->add_field(new FormFieldFree('enable_output_gz', '', MessageHelper::display($lang['advises.enable_output_gz'], MessageHelper::NOTICE)->render()));
}
if (DataStoreFactory::is_apc_available() && !DataStoreFactory::is_apc_enabled()) {
$fieldset->add_field(new FormFieldFree('enable_apcu_cache', '', MessageHelper::display($lang['advises.enable_apcu_cache'], MessageHelper::NOTICE)->render()));
}
$fieldset->add_field(new FormFieldFree('save_database', '', MessageHelper::display($lang['advises.save_database'], MessageHelper::SUCCESS)->render()));
if (!DatabaseConfig::load()->is_database_tables_optimization_enabled()) {
$fieldset->add_field(new FormFieldFree('optimize_database_tables', '', MessageHelper::display($lang['advises.optimize_database_tables'], MessageHelper::SUCCESS)->render()));
}
if ($security_config->get_internal_password_min_length() == 6 && $security_config->get_internal_password_strength() == SecurityConfig::PASSWORD_STRENGTH_WEAK && !$security_config->are_login_and_email_forbidden_in_password()) {
$fieldset->add_field(new FormFieldFree('password_security', '', MessageHelper::display($lang['advises.password_security'], MessageHelper::NOTICE)->render()));
}
if (ServerConfiguration::get_phpversion() < '5.6') {
$fieldset->add_field(new FormFieldFree('upgrade_php_version', '', MessageHelper::display($lang['advises.upgrade_php_version'], MessageHelper::NOTICE)->render()));
}
if (count($fieldset->get_fields())) {
$html_form->add_fieldset($fieldset);
}
}
示例3: display
private function display()
{
if ($this->fatal) {
AppContext::get_response()->clean_output();
if (Debug::is_debug_mode_enabled()) {
Debug::fatal($this->exception);
} else {
Environment::init_output_bufferization();
echo self::FATAL_MESSAGE;
Environment::destroy();
exit;
}
} elseif (Debug::is_debug_mode_enabled()) {
$this->display_debug();
}
}
示例4: prepare_controller
private function prepare_controller()
{
$title = LangLoader::get_message('error', 'status-messages-common');
if ($this->exception !== null && Debug::is_debug_mode_enabled()) {
$message = TextHelper::htmlspecialchars($this->exception->getMessage()) . '<br /><br /><i>' . $this->exception->getFile() . ':' . $this->exception->getLine() . '</i><div class="spacer"></div>' . Debug::get_stacktrace_as_string(0, $this->exception);
$title .= ' ' . $this->exception->getCode();
} else {
$message = TextHelper::htmlspecialchars(LangLoader::get_message('process.error', 'status-messages-common'));
}
$controller = new UserErrorController($title, $message, UserErrorController::FATAL);
return $controller;
}
示例5: handle_dispatch_exception
private static function handle_dispatch_exception($exception)
{
if (Debug::is_debug_mode_enabled()) {
self::show_error($exception);
} else {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
示例6: build_form
private function build_form()
{
$form = new HTMLForm(__CLASS__);
$fieldset = new FormFieldsetHTML('advanced-config', $this->lang['advanced-config']);
$form->add_fieldset($fieldset);
$fieldset->add_field(new FormFieldUrlEditor('site_url', $this->lang['advanced-config.site_url'], $this->general_config->get_site_url(), array('description' => $this->lang['advanced-config.site_url-explain'], 'required' => true)));
$fieldset->add_field(new FormFieldTextEditor('site_path', $this->lang['advanced-config.site_path'], $this->general_config->get_site_path(), array('description' => $this->lang['advanced-config.site_path-explain'])));
$fieldset->add_field(new FormFieldTimezone('site_timezone', $this->lang['advanced-config.site_timezone'], $this->general_config->get_site_timezone(), array('description' => $this->lang['advanced-config.site_timezone-explain'])));
$url_rewriting_fieldset = new FormFieldsetHTML('url_rewriting', $this->lang['advanced-config.url-rewriting']);
$form->add_fieldset($url_rewriting_fieldset);
$url_rewriting_fieldset->set_description($this->lang['advanced-config.url-rewriting.explain']);
$server_configuration = new ServerConfiguration();
try {
if ($server_configuration->has_url_rewriting()) {
$url_rewriting_fieldset->add_field(new FormFieldCheckbox('url_rewriting_enabled', $this->lang['advanced-config.url-rewriting'], $this->server_environment_config->is_url_rewriting_enabled(), array('description' => '<span class="text-strong color-available">' . $this->lang['advanced-config.config.available'] . '</span>')));
} else {
$url_rewriting_fieldset->add_field(new FormFieldCheckbox('url_rewriting_enabled', $this->lang['advanced-config.url-rewriting'], FormFieldCheckbox::UNCHECKED, array('disabled' => true, 'description' => '<span class="text-strong color-notavailable">' . $this->lang['advanced-config.config.not-available'] . '</span>')));
}
} catch (UnsupportedOperationException $ex) {
$url_rewriting_fieldset->add_field(new FormFieldCheckbox('url_rewriting_enabled', $this->lang['advanced-config.url-rewriting'], $this->server_environment_config->is_url_rewriting_enabled(), array('description' => '<span class="text-strong color-unknown">' . $this->lang['advanced-config.config.unknown'] . '</span>')));
}
$htaccess_manual_content_fieldset = new FormFieldsetHTML('htaccess_manual_content', $this->lang['advanced-config.htaccess-manual-content']);
$form->add_fieldset($htaccess_manual_content_fieldset);
$htaccess_manual_content_fieldset->add_field(new FormFieldMultiLineTextEditor('htaccess_manual_content', $this->lang['advanced-config.htaccess-manual-content'], $this->server_environment_config->get_htaccess_manual_content(), array('rows' => 7, 'description' => $this->lang['advanced-config.htaccess-manual-content.explain'])));
$robots_file = new File(PATH_TO_ROOT . '/robots.txt');
$robots_content = $robots_file->exists() ? $robots_file->read() : '';
$robots_content_fieldset = new FormFieldsetHTML('robots_content', $this->lang['advanced-config.robots-content']);
$form->add_fieldset($robots_content_fieldset);
$robots_content_fieldset->add_field(new FormFieldMultiLineTextEditor('robots_content', $this->lang['advanced-config.robots-content'], $robots_content, array('rows' => 7, 'description' => $this->lang['advanced-config.robots-content.explain'])));
$sessions_config_fieldset = new FormFieldsetHTML('sessions_config', $this->lang['advanced-config.sessions-config']);
$form->add_fieldset($sessions_config_fieldset);
$sessions_config_fieldset->add_field(new FormFieldTextEditor('cookie_name', $this->lang['advanced-config.cookie-name'], $this->sessions_config->get_cookie_name(), array('required' => true), array(new FormFieldConstraintRegex('`^[A-Za-z0-9]+$`i', '', $this->lang['advanced-config.cookie-name.style-wrong']))));
$sessions_config_fieldset->add_field(new FormFieldNumberEditor('session_duration', $this->lang['advanced-config.cookie-duration'], $this->sessions_config->get_session_duration(), array('description' => $this->lang['advanced-config.cookie-duration.explain'], 'required' => true), array(new FormFieldConstraintRegex('`^[0-9]+$`i', '', $this->lang['advanced-config.integer-required']))));
$sessions_config_fieldset->add_field(new FormFieldNumberEditor('active_session_duration', $this->lang['advanced-config.active-session-duration'], $this->sessions_config->get_active_session_duration(), array('description' => $this->lang['advanced-config.active-session-duration.explain'], 'required' => true), array(new FormFieldConstraintRegex('`^[0-9]+$`i', '', $this->lang['advanced-config.integer-required']))));
$miscellaneous_fieldset = new FormFieldsetHTML('miscellaneous', $this->lang['advanced-config.miscellaneous']);
$form->add_fieldset($miscellaneous_fieldset);
if (function_exists('ob_gzhandler') && @extension_loaded('zlib')) {
$miscellaneous_fieldset->add_field(new FormFieldCheckbox('output_gziping_enabled', $this->lang['advanced-config.output-gziping-enabled'], $this->server_environment_config->is_output_gziping_enabled(), array('description' => '<span class="text-strong color-available">' . $this->lang['advanced-config.config.available'] . '</span>')));
} else {
$miscellaneous_fieldset->add_field(new FormFieldCheckbox('output_gziping_enabled', $this->lang['advanced-config.output-gziping-enabled'], FormFieldCheckbox::UNCHECKED, array('description' => '<span class="text-strong color-notavailable">' . $this->lang['advanced-config.config.not-available'] . '</span>', 'disabled' => true)));
}
$miscellaneous_fieldset->add_field(new FormFieldCheckbox('debug_mode_enabled', $this->lang['advanced-config.debug-mode'], Debug::is_debug_mode_enabled(), array('description' => $this->lang['advanced-config.debug-mode.explain'], 'events' => array('change' => '
if (HTMLForms.getField("debug_mode_enabled").getValue()) {
HTMLForms.getField("debug_mode_type").enable();
HTMLForms.getField("display_database_query_enabled").enable();
} else {
HTMLForms.getField("debug_mode_type").disable();
HTMLForms.getField("display_database_query_enabled").disable();
}'))));
$miscellaneous_fieldset->add_field(new FormFieldSimpleSelectChoice('debug_mode_type', $this->lang['advanced-config.debug-mode.type'], Debug::is_strict_mode_enabled(), array(new FormFieldSelectChoiceOption($this->lang['advanced-config.debug-mode.type.normal'], '0'), new FormFieldSelectChoiceOption($this->lang['advanced-config.debug-mode.type.strict'], '1')), array('hidden' => !Debug::is_debug_mode_enabled())));
$miscellaneous_fieldset->add_field(new FormFieldCheckbox('display_database_query_enabled', $this->lang['advanced-config.debug-display-database-query-enabled'], Debug::is_display_database_query_enabled(), array('hidden' => !Debug::is_debug_mode_enabled())));
$this->submit_button = new FormButtonDefaultSubmit();
$form->add_button($this->submit_button);
$form->add_button(new FormButtonReset());
$this->form = $form;
}