This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via fc99017693171d54f28990a9e34e57c0f1e30e0e (commit)
from 30bfa601db7e5336cebe06697ea09088627a0955 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fc99017693171d54f28990a9e34e57c0f1e30e0e
Author: Ivan1986 <iva...@li...>
Date: Fri Apr 9 12:56:13 2010 +0400
Из JsHttp удалена обработка фатальных ошибок, так как они сами корректно
обрабатываются без этих извращений
diff --git a/lib/JsHttpRequest.php b/lib/JsHttpRequest.php
index 063cb8c..bbbd22a 100644
--- a/lib/JsHttpRequest.php
+++ b/lib/JsHttpRequest.php
@@ -25,12 +25,6 @@ class JsHttpRequest
var $ID = null;
var $RESULT = null;
- // Internal; uniq value.
- private $_uniqHash;
- // Magic number for display_error checking.
- private $_magic = 14623;
- // Previous display_errors value.
- private $_prevDisplayErrors = null;
// Internal: response content-type depending on loader type.
private $_contentTypes = array(
"script" => "text/javascript",
@@ -86,14 +80,6 @@ class JsHttpRequest
// to free some memory. This memory may be used on memory_limit error.
$this->_emergBuffer = str_repeat('a', 1024 * 200);
- // Intercept fatal errors via display_errors (seems it is the only way).
- $this->_uniqHash = md5('JsHttpRequest' . microtime() . getmypid());
- $this->_prevDisplayErrors = ini_get('display_errors');
- ini_set('display_errors', $this->_magic); //
- ini_set('error_prepend_string', $this->_uniqHash . ini_get('error_prepend_string'));
- ini_set('error_append_string', ini_get('error_append_string') . $this->_uniqHash);
- if (function_exists('xdebug_disable')) xdebug_disable(); // else Fatal errors are not catched
-
// Start OB handling early.
ob_start(array(&$this, "_obHandler"));
$JsHttpRequest_Active = true;
@@ -246,42 +232,8 @@ class JsHttpRequest
unset($this->_emergBuffer); // free a piece of memory for memory_limit error
unset($GLOBALS['JsHttpRequest_Active']);
- // Check for error & fetch a resulting data.
- $wasFatalError = false;
- if (preg_match_all("/{$this->_uniqHash}(.*?){$this->_uniqHash}/sx", $text, $m)) {
- // Display_errors:
- // 1. disabled manually after the library initialization, or
- // 2. was initially disabled and is not changed
- $needRemoveErrorMessages = !ini_get('display_errors') || (!$this->_prevDisplayErrors && ini_get('display_errors') == $this->_magic);
- foreach ($m[0] as $error) {
- if (preg_match('/\bFatal error(<.*?>)?:/i', $error)) {
- $wasFatalError = true;
- }
- if ($needRemoveErrorMessages) {
- $text = str_replace($error, '', $text); // strip the whole error message
- } else {
- $text = str_replace($this->_uniqHash, '', $text);
- }
- }
- }
- if ($wasFatalError) {
- // On fatal errors - force "null" result. This is needed, because $_RESULT
- // may not be fully completed at the moment of the error.
- $this->RESULT = null;
- } else {
- // Read the result from globals if not set directly.
- if (!isset($this->RESULT)) {
- global $_RESULT;
- $this->RESULT = $_RESULT;
- }
- // Avoid manual NULLs in the result (very important!).
- if ($this->RESULT === null) {
- $this->RESULT = false;
- }
- }
-
// Note that 500 error is generated when a PHP error occurred.
- $status = $this->RESULT === null? 500 : 200;
+ $status = 200;
$result = array(
'id' => $this->ID,
'js' => $this->RESULT, // null always means a fatal error...
-----------------------------------------------------------------------
Summary of changes:
lib/JsHttpRequest.php | 50 +------------------------------------------------
1 files changed, 1 insertions(+), 49 deletions(-)
hooks/post-receive
--
quickfw
|