forked from bahdall/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
№1: Обновлен Yii framework до версии 1.1.16
№2: Заменен текстовый редактор на CKEDITOR №3: Обновлен модуль ElFinder №4: обновлен модуль Banners №5: Заменен текстовый редактор в виджете IncludeFiles
- Loading branch information
Showing
1,670 changed files
with
263,214 additions
and
39,197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ | |
* {@link CApplication::getErrorHandler()}. | ||
* | ||
* @property array $error The error details. Null if there is no error. | ||
* @property Exception|null $exception exception instance. Null if there is no exception. | ||
* | ||
* @author Qiang Xue <[email protected]> | ||
* @package system.base | ||
|
@@ -82,6 +83,7 @@ class CErrorHandler extends CApplicationComponent | |
public $errorAction; | ||
|
||
private $_error; | ||
private $_exception; | ||
|
||
/** | ||
* Handles the exception/error event. | ||
|
@@ -150,6 +152,15 @@ public function getError() | |
return $this->_error; | ||
} | ||
|
||
/** | ||
* Returns the instance of the exception that is currently being handled. | ||
* @return Exception|null exception instance. Null if there is no exception. | ||
*/ | ||
public function getException() | ||
{ | ||
return $this->_exception; | ||
} | ||
|
||
/** | ||
* Handles the exception. | ||
* @param Exception $exception the exception captured | ||
|
@@ -186,6 +197,7 @@ protected function handleException($exception) | |
unset($trace[$i]['object']); | ||
} | ||
|
||
$this->_exception=$exception; | ||
$this->_error=$data=array( | ||
'code'=>($exception instanceof CHttpException)?$exception->statusCode:500, | ||
'type'=>get_class($exception), | ||
|
@@ -198,17 +210,12 @@ protected function handleException($exception) | |
); | ||
|
||
if(!headers_sent()) | ||
header("HTTP/1.0 {$data['code']} ".$this->getHttpHeader($data['code'], get_class($exception))); | ||
|
||
if($exception instanceof CHttpException || !YII_DEBUG) | ||
$this->render('error',$data); | ||
else | ||
{ | ||
if($this->isAjaxRequest()) | ||
$app->displayException($exception); | ||
else | ||
$this->render('exception',$data); | ||
$httpVersion=Yii::app()->request->getHttpVersion(); | ||
header("HTTP/$httpVersion {$data['code']} ".$this->getHttpHeader($data['code'], get_class($exception))); | ||
} | ||
|
||
$this->renderException(); | ||
} | ||
else | ||
$app->displayException($exception); | ||
|
@@ -270,7 +277,8 @@ protected function handleError($event) | |
default: | ||
$type = 'PHP error'; | ||
} | ||
$this->_error=$data=array( | ||
$this->_exception=null; | ||
$this->_error=array( | ||
'code'=>500, | ||
'type'=>$type, | ||
'message'=>$event->message, | ||
|
@@ -280,13 +288,12 @@ protected function handleError($event) | |
'traces'=>$trace, | ||
); | ||
if(!headers_sent()) | ||
header("HTTP/1.0 500 Internal Server Error"); | ||
if($this->isAjaxRequest()) | ||
$app->displayError($event->code,$event->message,$event->file,$event->line); | ||
elseif(YII_DEBUG) | ||
$this->render('exception',$data); | ||
else | ||
$this->render('error',$data); | ||
{ | ||
$httpVersion=Yii::app()->request->getHttpVersion(); | ||
header("HTTP/$httpVersion 500 Internal Server Error"); | ||
} | ||
|
||
$this->renderError(); | ||
} | ||
else | ||
$app->displayError($event->code,$event->message,$event->file,$event->line); | ||
|
@@ -327,15 +334,47 @@ protected function getExactTrace($exception) | |
*/ | ||
protected function render($view,$data) | ||
{ | ||
if($view==='error' && $this->errorAction!==null) | ||
$data['version']=$this->getVersionInfo(); | ||
$data['time']=time(); | ||
$data['admin']=$this->adminInfo; | ||
include($this->getViewFile($view,$data['code'])); | ||
} | ||
|
||
/** | ||
* Renders the exception information. | ||
* This method will display information from current {@link error} value. | ||
*/ | ||
protected function renderException() | ||
{ | ||
$exception=$this->getException(); | ||
if($exception instanceof CHttpException || !YII_DEBUG) | ||
$this->renderError(); | ||
else | ||
{ | ||
if($this->isAjaxRequest()) | ||
Yii::app()->displayException($exception); | ||
else | ||
$this->render('exception',$this->getError()); | ||
} | ||
} | ||
|
||
/** | ||
* Renders the current error information. | ||
* This method will display information from current {@link error} value. | ||
*/ | ||
protected function renderError() | ||
{ | ||
if($this->errorAction!==null) | ||
Yii::app()->runController($this->errorAction); | ||
else | ||
{ | ||
// additional information to be passed to view | ||
$data['version']=$this->getVersionInfo(); | ||
$data['time']=time(); | ||
$data['admin']=$this->adminInfo; | ||
include($this->getViewFile($view,$data['code'])); | ||
$data=$this->getError(); | ||
if($this->isAjaxRequest()) | ||
Yii::app()->displayError($data['code'],$data['message'],$data['file'],$data['line']); | ||
elseif(YII_DEBUG) | ||
$this->render('exception',$data); | ||
else | ||
$this->render('error',$data); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.