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


PHP CRM_Core_Error::handleUnhandledException方法代码示例

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


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

示例1: invoke

 /**
  * This is the main front-controller that integrates with the CMS. Any
  * page-request that is sent to the CMS and intended for CiviCRM should
  * be processed by invoke().
  *
  * @param array $args
  *   The parts of the URL which identify the intended CiviCRM page
  *   (e.g. array('civicrm', 'event', 'register')).
  * @return string
  *   HTML. For non-HTML content, invoke() may call print() and exit().
  *
  */
 public static function invoke($args)
 {
     try {
         return self::_invoke($args);
     } catch (Exception $e) {
         CRM_Core_Error::handleUnhandledException($e);
     }
 }
开发者ID:rameshrr99,项目名称:civicrm-core,代码行数:20,代码来源:Invoke.php

示例2: _invoke

 protected static function _invoke($args)
 {
     if ($args[0] !== 'civicrm') {
         return;
     }
     // CRM-15901: Turn off PHP errors display for all ajax calls
     if (CRM_Utils_Array::value(1, $args) == 'ajax' || CRM_Utils_Array::value('snippet', $_REQUEST)) {
         ini_set('display_errors', 0);
     }
     if (!defined('CIVICRM_SYMFONY_PATH')) {
         try {
             // Traditional Civi invocation path
             self::hackMenuRebuild($args);
             // may exit
             self::init($args);
             self::hackStandalone($args);
             $item = self::getItem($args);
             return self::runItem($item);
         } catch (CRM_Core_EXCEPTION $e) {
             $params = $e->getErrorData();
             $message = $e->getMessage();
             if (isset($params['legacy_status_bounce'])) {
                 //@todo remove this- see comments on
                 //https://github.com/eileenmcnaughton/civicrm-core/commit/ae686b09e2c987091612bb25ba0a58e520a203e7
                 CRM_Core_Error::statusBounce($params['message']);
             } else {
                 $session = CRM_Core_Session::singleton();
                 $session->setStatus($message, CRM_Utils_Array::value('message_title', $params), CRM_Utils_Array::value('message_type', $params, 'error'));
                 // @todo remove this code - legacy redirect path is an interim measure for moving redirects out of BAO
                 // to somewhere slightly more acceptable. they should not be part of the exception class & should
                 // be managed @ the form level - if you find a form that is triggering this piece of code
                 // you should log a ticket for it to be removed with details about the form you were on.
                 if (!empty($params['legacy_redirect_path'])) {
                     if (CRM_Utils_System::isDevelopment()) {
                         // here we could set a message telling devs to log it per above
                     }
                     CRM_Utils_System::redirect($params['legacy_redirect_path'], $params['legacy_redirect_query']);
                 }
             }
         } catch (Exception $e) {
             // Recall: CRM_Core_Config is initialized before calling CRM_Core_Invoke
             $config = CRM_Core_Config::singleton();
             return CRM_Core_Error::handleUnhandledException($e);
             /*
                     if ($config->backtrace) {
                       return CRM_Core_Error::formatHtmlException($e);
                     } else {
                      // TODO
                     }*/
         }
     } else {
         // Symfony-based invocation path
         require_once CIVICRM_SYMFONY_PATH . '/app/bootstrap.php.cache';
         require_once CIVICRM_SYMFONY_PATH . '/app/AppKernel.php';
         $kernel = new AppKernel('dev', true);
         $kernel->loadClassCache();
         $response = $kernel->handle(Symfony\Component\HttpFoundation\Request::createFromGlobals());
         // $response->send();
         return $response->getContent();
     }
 }
开发者ID:TheCraftyCanvas,项目名称:aegir-platforms,代码行数:61,代码来源:Invoke.php


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