本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例5:
function __construct($error)
{
parent::__construct($error);
}
示例6:
/**
*
* @param
* @return
*
*/
function __construct($method, $messages) {
Configure::write('debug', 1);
parent::__construct($method, $messages);
}
示例7:
/**
* Overload constructor so we can test it properly
*/
function __construct($method, $messages, $test = false)
{
if (!$test) {
parent::__construct($method, $messages);
}
}