git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
58c58d4
)
remove last global variable from the codebase
author
gggeek
<giunta.gaetano@gmail.com>
Sat, 23 May 2015 19:41:11 +0000
(20:41 +0100)
committer
gggeek
<giunta.gaetano@gmail.com>
Sat, 23 May 2015 19:41:11 +0000
(20:41 +0100)
src/Server.php
patch
|
blob
|
history
diff --git
a/src/Server.php
b/src/Server.php
index
8a2f511
..
fdcd620
100644
(file)
--- a/
src/Server.php
+++ b/
src/Server.php
@@
-75,7
+75,7
@@
class Server
protected static $_xmlrpc_debuginfo = '';
protected static $_xmlrpcs_occurred_errors = '';
protected static $_xmlrpc_debuginfo = '';
protected static $_xmlrpcs_occurred_errors = '';
- p
ublic
static $_xmlrpcs_prev_ehandler = '';
+ p
rotected
static $_xmlrpcs_prev_ehandler = '';
/**
* @param array $dispatchMap the dispatch map with definition of exposed services
/**
* @param array $dispatchMap the dispatch map with definition of exposed services
@@
-615,7
+615,7
@@
class Server
// If debug level is 3, we should catch all errors generated during
// processing of user function, and log them as part of response
if ($this->debug > 2) {
// If debug level is 3, we should catch all errors generated during
// processing of user function, and log them as part of response
if ($this->debug > 2) {
-
$GLOBALS['_xmlrpcs_prev_ehandler']
= set_error_handler(array('\PhpXmlRpc\Server', '_xmlrpcs_errorHandler'));
+
self::$_xmlrpcs_prev_ehandler
= set_error_handler(array('\PhpXmlRpc\Server', '_xmlrpcs_errorHandler'));
}
try {
// Allow mixed-convention servers
}
try {
// Allow mixed-convention servers
@@
-683,8
+683,8
@@
class Server
if ($this->debug > 2) {
// note: restore the error handler we found before calling the
// user func, even if it has been changed inside the func itself
if ($this->debug > 2) {
// note: restore the error handler we found before calling the
// user func, even if it has been changed inside the func itself
- if (
$GLOBALS['_xmlrpcs_prev_ehandler']
) {
- set_error_handler(
$GLOBALS['_xmlrpcs_prev_ehandler']
);
+ if (
self::$_xmlrpcs_prev_ehandler
) {
+ set_error_handler(
self::$_xmlrpcs_prev_ehandler
);
} else {
restore_error_handler();
}
} else {
restore_error_handler();
}
@@
-1005,7
+1005,7
@@
class Server
}
// Try to avoid as much as possible disruption to the previous error handling
// mechanism in place
}
// Try to avoid as much as possible disruption to the previous error handling
// mechanism in place
- if (
$GLOBALS['_xmlrpcs_prev_ehandler']
== '') {
+ if (
self::$_xmlrpcs_prev_ehandler
== '') {
// The previous error handler was the default: all we should do is log error
// to the default error log (if level high enough)
if (ini_get('log_errors') && (intval(ini_get('error_reporting')) & $errCode)) {
// The previous error handler was the default: all we should do is log error
// to the default error log (if level high enough)
if (ini_get('log_errors') && (intval(ini_get('error_reporting')) & $errCode)) {
@@
-1013,12
+1013,13
@@
class Server
}
} else {
// Pass control on to previous error handler, trying to avoid loops...
}
} else {
// Pass control on to previous error handler, trying to avoid loops...
- if (
$GLOBALS['_xmlrpcs_prev_ehandler']
!= array('\PhpXmlRpc\Server', '_xmlrpcs_errorHandler')) {
- if (is_array(
$GLOBALS['_xmlrpcs_prev_ehandler']
)) {
+ if (
self::$_xmlrpcs_prev_ehandler
!= array('\PhpXmlRpc\Server', '_xmlrpcs_errorHandler')) {
+ if (is_array(
self::$_xmlrpcs_prev_ehandler
)) {
// the following works both with static class methods and plain object methods as error handler
// the following works both with static class methods and plain object methods as error handler
- call_user_func_array(
$GLOBALS['_xmlrpcs_prev_ehandler']
, array($errCode, $errString, $filename, $lineNo, $context));
+ call_user_func_array(
self::$_xmlrpcs_prev_ehandler
, array($errCode, $errString, $filename, $lineNo, $context));
} else {
} else {
- $GLOBALS['_xmlrpcs_prev_ehandler']($errCode, $errString, $filename, $lineNo, $context);
+ $method = self::$_xmlrpcs_prev_ehandler;
+ $method($errCode, $errString, $filename, $lineNo, $context);
}
}
}
}
}
}