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


PHP ErrorHandler::__construct方法代码示例

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


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

示例1: AppController

 function __construct($method, $messages)
 {
     $this->controller = new AppController();
     $params = Router::getParams();
     $viewPath = $this->controller->viewPath;
     if (Configure::read('App.theme')) {
         $viewPath = 'errors';
         if ($this->controller->view == 'Theme') {
             $viewPath = 'themed' . DS . Configure::read('App.theme') . DS . 'errors';
         }
     }
     if (Configure::read('debug') == 0) {
         $method = 'error404';
     }
     $checkView = VIEWS . $viewPath . DS . Inflector::underscore($method) . '.ctp';
     if (file_exists($checkView)) {
         $this->controller->_set(Router::getPaths());
         $this->controller->viewPath = $viewPath;
         $this->controller->theme = $appConfigurations['theme'];
         $this->controller->pageTitle = __('Error', true);
         $this->controller->set('message', $messages[0]['url']);
         $this->controller->set('appConfigurations', $appConfigurations);
         $this->controller->render($method);
         e($this->controller->output);
     } else {
         parent::__construct($method, $messages);
     }
 }
开发者ID:nicoeche,项目名称:Finalus,代码行数:28,代码来源:app_error.php

示例2:

 /**
  * Class constructor.
  *
  * @param string $method Method producing the error
  * @param array $messages Error messages
  */
 function __construct($method, $messages)
 {
     $this->_requested = !SL::getInstance()->main;
     // Make a more user-friendly "No Database Connection"
     if ($method === 'missingTable') {
         $db = @ConnectionManager::getDataSource('default');
         if (!$db->isConnected()) {
             $method = 'dbConnectionError';
         }
     }
     parent::__construct($method, $messages);
 }
开发者ID:sandulungu,项目名称:StarLight,代码行数:18,代码来源:app_error.php

示例3: AppController

 /**
  * 
  */
 function __construct($method, $messages)
 {
     $params = Router::getParams();
     if (($method == 'missingController' || $method == 'missingAction') && file_exists(VIEWS . DS . 'static' . DS . $params['controller'] . ".ctp")) {
         $this->controller =& new AppController();
         $this->controller->_set(Router::getPaths());
         $this->controller->params = $params;
         $this->controller->constructClasses();
         $this->controller->beforeFilter();
         $this->controller->viewPath = 'static';
         $this->controller->render($params['controller']);
         e($this->controller->output);
         exit;
     }
     parent::__construct($method, $messages);
     exit;
 }
开发者ID:yamaguchitarou,项目名称:bakesale,代码行数:20,代码来源:app_error.php

示例4:

 function __construct($method, $messages)
 {
     //Configure::write('debug', 1);
     //      $message = 'Site '.env('SERVER_NAME').' has generated an error message'."<BR>";
     //              $message .= "Error Type: $method<BR>";
     //               foreach ($messages[0] as $key => $value) {
     //                   $message .= str_pad($key, 10).": $value<BR>";
     //               }
     //               $message .= 'URL  : '.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."<BR>";
     //               $message .= 'User Agent  : '.$_SERVER['HTTP_USER_AGENT']."<BR>";
     //               $message .= 'Referrer  : '.env('HTTP_REFERER')."<BR>";
     //               $message .= 'Remote add: '.env('REMOTE_ADDR')."<BR>";
     //
     //       App::import('Vendor', 'PHPMailer', array('file' => 'mailer.class.php'));
     //  		 $mailer = new PHPMailer();
     //  		 $mailer->From = 'error@localhost';
     //  		 $mailer->AddAddress(DEVELOPER_EMAIL, DEVELOPER_EMAIL);
     //  		 $mailer->Subject = "Error in Bpong application!";
     //  		 $mailer->Body    = $message;
     //           $mailer->Send();
     parent::__construct($method, $messages);
 }
开发者ID:sgh1986915,项目名称:cakephp2-bpong,代码行数:22,代码来源:AppError.php

示例5:

 function __construct($error)
 {
     parent::__construct($error);
 }
开发者ID:PumpkinSeed,项目名称:beadando,代码行数:4,代码来源:model.php

示例6:

	/**
	 * 
	 * @param 
	 * @return 
	 * 
	*/
	function __construct($method, $messages) {
		Configure::write('debug', 1);
		parent::__construct($method, $messages);
	}
开发者ID:robksawyer,项目名称:FIND---GET---MAKE,代码行数:10,代码来源:app_error.php

示例7:

 /**
  * Overload constructor so we can test it properly
  */
 function __construct($method, $messages, $test = false)
 {
     if (!$test) {
         parent::__construct($method, $messages);
     }
 }
开发者ID:simaostephanie,项目名称:CakePHP-Seo-Plugin,代码行数:9,代码来源:seo_app_error.php


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