PHP5 compat

This commit is contained in:
Garvin Hicking 2012-10-18 11:19:44 +02:00
parent 48861c5505
commit d887078a3d
2 changed files with 9 additions and 9 deletions

View File

@ -594,7 +594,7 @@ class HTTP_Request {
*/
function sendRequest($saveBody = true)
{
if (!is_a($this->_url, 'Net_URL')) {
if (!($this->_url instanceof Net_URL)) {
return PEAR::raiseError('No URL given.');
}
@ -885,7 +885,7 @@ class HTTP_Request {
*/
function attach(&$listener)
{
if (!is_a($listener, 'HTTP_Request_Listener')) {
if (!($listener instanceof HTTP_Request_Listener)) {
return false;
}
$this->_listeners[$listener->getId()] =& $listener;
@ -902,7 +902,7 @@ class HTTP_Request {
*/
function detach(&$listener)
{
if (!is_a($listener, 'HTTP_Request_Listener') ||
if (!($listener instanceof HTTP_Request_Listener) ||
!isset($this->_listeners[$listener->getId()])) {
return false;
}

View File

@ -255,7 +255,7 @@ class PEAR
*/
static function isError($data, $code = null)
{
if (is_a($data, 'PEAR_Error')) {
if (($data instanceof PEAR_Error)) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
@ -311,7 +311,7 @@ class PEAR
function setErrorHandling($mode = null, $options = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
$setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options;
} else {
@ -563,7 +563,7 @@ class PEAR
$code = null,
$userinfo = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
return $this->raiseError($message, $code, null, null, $userinfo);
} else {
return PEAR::raiseError($message, $code, null, null, $userinfo);
@ -659,7 +659,7 @@ class PEAR
function pushErrorHandling($mode, $options = null)
{
$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_options = &$this->_default_error_options;
} else {
@ -668,7 +668,7 @@ class PEAR
}
$stack[] = array($def_mode, $def_options);
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
@ -693,7 +693,7 @@ class PEAR
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);