当前位置: 首页>>代码示例>>PHP>>正文


PHP ExceptionHandler::SetExceptionHandler方法代码示例

本文整理汇总了PHP中ExceptionHandler::SetExceptionHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP ExceptionHandler::SetExceptionHandler方法的具体用法?PHP ExceptionHandler::SetExceptionHandler怎么用?PHP ExceptionHandler::SetExceptionHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExceptionHandler的用法示例。


在下文中一共展示了ExceptionHandler::SetExceptionHandler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 protected function __construct($titleKey = '', $pageDepth = 0)
 {
     $this->SetSecurityHeaders();
     $this->path = str_repeat('../', $pageDepth);
     $this->server = ServiceLocator::GetServer();
     $resources = Resources::GetInstance();
     ExceptionHandler::SetExceptionHandler(new WebExceptionHandler(array($this, 'RedirectToError')));
     $this->smarty = new SmartyPage($resources, $this->path);
     $userSession = ServiceLocator::GetServer()->GetUserSession();
     $this->smarty->assign('Charset', $resources->Charset);
     $this->smarty->assign('CurrentLanguage', $resources->CurrentLanguage);
     $this->smarty->assign('HtmlLang', $resources->HtmlLang);
     $this->smarty->assign('HtmlTextDirection', $resources->TextDirection);
     $appTitle = Configuration::Instance()->GetKey(ConfigKeys::APP_TITLE);
     $pageTile = $resources->GetString($titleKey);
     $this->smarty->assign('Title', (empty($appTitle) ? 'Booked' : $appTitle) . (empty($pageTile) ? '' : ' - ' . $pageTile));
     $this->smarty->assign('CalendarJSFile', $resources->CalendarLanguageFile);
     $this->smarty->assign('LoggedIn', $userSession->IsLoggedIn());
     $this->smarty->assign('Version', Configuration::VERSION);
     $this->smarty->assign('Path', $this->path);
     $this->smarty->assign('ScriptUrl', Configuration::Instance()->GetScriptUrl());
     $this->smarty->assign('UserName', !is_null($userSession) ? $userSession->FirstName : '');
     $this->smarty->assign('DisplayWelcome', $this->DisplayWelcome());
     $this->smarty->assign('UserId', $userSession->UserId);
     $this->smarty->assign('CanViewAdmin', $userSession->IsAdmin);
     $this->smarty->assign('CanViewGroupAdmin', $userSession->IsGroupAdmin);
     $this->smarty->assign('CanViewResourceAdmin', $userSession->IsResourceAdmin);
     $this->smarty->assign('CanViewScheduleAdmin', $userSession->IsScheduleAdmin);
     $this->smarty->assign('CanViewResponsibilities', !$userSession->IsAdmin && ($userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin));
     $allowAllUsersToReports = Configuration::Instance()->GetSectionKey(ConfigSection::REPORTS, ConfigKeys::REPORTS_ALLOW_ALL, new BooleanConverter());
     $this->smarty->assign('CanViewReports', $allowAllUsersToReports || $userSession->IsAdmin || $userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin);
     $timeout = Configuration::Instance()->GetKey(ConfigKeys::INACTIVITY_TIMEOUT);
     if (!empty($timeout)) {
         $this->smarty->assign('SessionTimeoutSeconds', max($timeout, 1) * 60);
     }
     $this->smarty->assign('ShouldLogout', $this->GetShouldAutoLogout());
     $this->smarty->assign('CssExtensionFile', Configuration::Instance()->GetKey(ConfigKeys::CSS_EXTENSION_FILE));
     $this->smarty->assign('UseLocalJquery', Configuration::Instance()->GetKey(ConfigKeys::USE_LOCAL_JQUERY, new BooleanConverter()));
     $this->smarty->assign('EnableConfigurationPage', Configuration::Instance()->GetSectionKey(ConfigSection::PAGES, ConfigKeys::PAGES_ENABLE_CONFIGURATION, new BooleanConverter()));
     $this->smarty->assign('ShowParticipation', !Configuration::Instance()->GetSectionKey(ConfigSection::RESERVATION, ConfigKeys::RESERVATION_PREVENT_PARTICIPATION, new BooleanConverter()));
     $this->smarty->assign('LogoUrl', 'booked.png');
     if (file_exists($this->path . 'img/custom-logo.png')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.png');
     }
     if (file_exists($this->path . 'img/custom-logo.gif')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.gif');
     }
     if (file_exists($this->path . 'img/custom-logo.jpg')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.jpg');
     }
     $this->smarty->assign('CssUrl', 'null-style.css');
     if (file_exists($this->path . 'css/custom-style.css')) {
         $this->smarty->assign('CssUrl', 'custom-style.css');
     }
     $logoUrl = Configuration::Instance()->GetKey(ConfigKeys::HOME_URL);
     if (empty($logoUrl)) {
         $logoUrl = $this->path . Pages::UrlFromId($userSession->HomepageId);
     }
     $this->smarty->assign('HomeUrl', $logoUrl);
 }
开发者ID:ViraSoftware,项目名称:booked,代码行数:60,代码来源:Page.php


注:本文中的ExceptionHandler::SetExceptionHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。