PHP5 compat
This commit is contained in:
parent
48861c5505
commit
d887078a3d
@ -594,7 +594,7 @@ class HTTP_Request {
|
|||||||
*/
|
*/
|
||||||
function sendRequest($saveBody = true)
|
function sendRequest($saveBody = true)
|
||||||
{
|
{
|
||||||
if (!is_a($this->_url, 'Net_URL')) {
|
if (!($this->_url instanceof Net_URL)) {
|
||||||
return PEAR::raiseError('No URL given.');
|
return PEAR::raiseError('No URL given.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -885,7 +885,7 @@ class HTTP_Request {
|
|||||||
*/
|
*/
|
||||||
function attach(&$listener)
|
function attach(&$listener)
|
||||||
{
|
{
|
||||||
if (!is_a($listener, 'HTTP_Request_Listener')) {
|
if (!($listener instanceof HTTP_Request_Listener)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->_listeners[$listener->getId()] =& $listener;
|
$this->_listeners[$listener->getId()] =& $listener;
|
||||||
@ -902,7 +902,7 @@ class HTTP_Request {
|
|||||||
*/
|
*/
|
||||||
function detach(&$listener)
|
function detach(&$listener)
|
||||||
{
|
{
|
||||||
if (!is_a($listener, 'HTTP_Request_Listener') ||
|
if (!($listener instanceof HTTP_Request_Listener) ||
|
||||||
!isset($this->_listeners[$listener->getId()])) {
|
!isset($this->_listeners[$listener->getId()])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ class PEAR
|
|||||||
*/
|
*/
|
||||||
static function isError($data, $code = null)
|
static function isError($data, $code = null)
|
||||||
{
|
{
|
||||||
if (is_a($data, 'PEAR_Error')) {
|
if (($data instanceof PEAR_Error)) {
|
||||||
if (is_null($code)) {
|
if (is_null($code)) {
|
||||||
return true;
|
return true;
|
||||||
} elseif (is_string($code)) {
|
} elseif (is_string($code)) {
|
||||||
@ -311,7 +311,7 @@ class PEAR
|
|||||||
|
|
||||||
function setErrorHandling($mode = null, $options = null)
|
function setErrorHandling($mode = null, $options = null)
|
||||||
{
|
{
|
||||||
if (isset($this) && is_a($this, 'PEAR')) {
|
if (isset($this) && ($this instanceof PEAR)) {
|
||||||
$setmode = &$this->_default_error_mode;
|
$setmode = &$this->_default_error_mode;
|
||||||
$setoptions = &$this->_default_error_options;
|
$setoptions = &$this->_default_error_options;
|
||||||
} else {
|
} else {
|
||||||
@ -563,7 +563,7 @@ class PEAR
|
|||||||
$code = null,
|
$code = null,
|
||||||
$userinfo = null)
|
$userinfo = null)
|
||||||
{
|
{
|
||||||
if (isset($this) && is_a($this, 'PEAR')) {
|
if (isset($this) && ($this instanceof PEAR)) {
|
||||||
return $this->raiseError($message, $code, null, null, $userinfo);
|
return $this->raiseError($message, $code, null, null, $userinfo);
|
||||||
} else {
|
} else {
|
||||||
return PEAR::raiseError($message, $code, null, null, $userinfo);
|
return PEAR::raiseError($message, $code, null, null, $userinfo);
|
||||||
@ -659,7 +659,7 @@ class PEAR
|
|||||||
function pushErrorHandling($mode, $options = null)
|
function pushErrorHandling($mode, $options = null)
|
||||||
{
|
{
|
||||||
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
||||||
if (isset($this) && is_a($this, 'PEAR')) {
|
if (isset($this) && ($this instanceof PEAR)) {
|
||||||
$def_mode = &$this->_default_error_mode;
|
$def_mode = &$this->_default_error_mode;
|
||||||
$def_options = &$this->_default_error_options;
|
$def_options = &$this->_default_error_options;
|
||||||
} else {
|
} else {
|
||||||
@ -668,7 +668,7 @@ class PEAR
|
|||||||
}
|
}
|
||||||
$stack[] = array($def_mode, $def_options);
|
$stack[] = array($def_mode, $def_options);
|
||||||
|
|
||||||
if (isset($this) && is_a($this, 'PEAR')) {
|
if (isset($this) && ($this instanceof PEAR)) {
|
||||||
$this->setErrorHandling($mode, $options);
|
$this->setErrorHandling($mode, $options);
|
||||||
} else {
|
} else {
|
||||||
PEAR::setErrorHandling($mode, $options);
|
PEAR::setErrorHandling($mode, $options);
|
||||||
@ -693,7 +693,7 @@ class PEAR
|
|||||||
array_pop($stack);
|
array_pop($stack);
|
||||||
list($mode, $options) = $stack[sizeof($stack) - 1];
|
list($mode, $options) = $stack[sizeof($stack) - 1];
|
||||||
array_pop($stack);
|
array_pop($stack);
|
||||||
if (isset($this) && is_a($this, 'PEAR')) {
|
if (isset($this) && ($this instanceof PEAR)) {
|
||||||
$this->setErrorHandling($mode, $options);
|
$this->setErrorHandling($mode, $options);
|
||||||
} else {
|
} else {
|
||||||
PEAR::setErrorHandling($mode, $options);
|
PEAR::setErrorHandling($mode, $options);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user