Skip to content
Snippets Groups Projects
Commit 33fa7ae7 authored by Prasad's avatar Prasad
Browse files

Fixed syntax (assigning references) used in PEAR for PHP 7 compat.

parent 6eed2e5c
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ $GLOBALS['_PEAR_error_handler_stack'] = array();
* destructor, use error_log(), syslog() or something similar.
*
* IMPORTANT! To use the emulated destructors you need to create the
* objects by reference: $obj =& new PEAR_child;
* objects by reference: $obj = new PEAR_child;
*
* @category pear
* @package PEAR
......@@ -180,7 +180,7 @@ class PEAR
$destructor = "_$classname";
if (method_exists($this, $destructor)) {
global $_PEAR_destructor_object_list;
$_PEAR_destructor_object_list[] = &$this;
$_PEAR_destructor_object_list[] = $this;
if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
register_shutdown_function("_PEAR_call_destructors");
$GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
......@@ -218,7 +218,7 @@ class PEAR
/**
* If you have a class that's mostly/entirely static, and you need static
* properties, you can use this method to simulate them. Eg. in your method(s)
* do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
* do this: $myVar = PEAR::getStaticProperty('myclass', 'myVar');
* You MUST use a reference, or they will not persist!
*
* @access public
......@@ -323,11 +323,11 @@ class PEAR
function setErrorHandling($mode = null, $options = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
$setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options;
$setmode = $this->_default_error_mode;
$setoptions = $this->_default_error_options;
} else {
$setmode = &$GLOBALS['_PEAR_default_error_mode'];
$setoptions = &$GLOBALS['_PEAR_default_error_options'];
$setmode = $GLOBALS['_PEAR_default_error_mode'];
$setoptions = $GLOBALS['_PEAR_default_error_options'];
}
switch ($mode) {
......@@ -554,10 +554,10 @@ class PEAR
$ec = 'PEAR_Error';
}
if ($skipmsg) {
$a = &new $ec($code, $mode, $options, $userinfo);
$a = new $ec($code, $mode, $options, $userinfo);
return $a;
} else {
$a = &new $ec($message, $code, $mode, $options, $userinfo);
$a = new $ec($message, $code, $mode, $options, $userinfo);
return $a;
}
}
......@@ -577,10 +577,10 @@ class PEAR
$userinfo = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
$a = &$this->raiseError($message, $code, null, null, $userinfo);
$a = $this->raiseError($message, $code, null, null, $userinfo);
return $a;
} else {
$a = &PEAR::raiseError($message, $code, null, null, $userinfo);
$a = PEAR::raiseError($message, $code, null, null, $userinfo);
return $a;
}
}
......@@ -588,9 +588,9 @@ class PEAR
// }}}
function staticPushErrorHandling($mode, $options = null)
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
$def_options = &$GLOBALS['_PEAR_default_error_options'];
$stack = $GLOBALS['_PEAR_error_handler_stack'];
$def_mode = $GLOBALS['_PEAR_default_error_mode'];
$def_options = $GLOBALS['_PEAR_default_error_options'];
$stack[] = array($def_mode, $def_options);
switch ($mode) {
case PEAR_ERROR_EXCEPTION:
......@@ -623,9 +623,9 @@ class PEAR
function staticPopErrorHandling()
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
$setmode = &$GLOBALS['_PEAR_default_error_mode'];
$setoptions = &$GLOBALS['_PEAR_default_error_options'];
$stack = $GLOBALS['_PEAR_error_handler_stack'];
$setmode = $GLOBALS['_PEAR_default_error_mode'];
$setoptions = $GLOBALS['_PEAR_default_error_options'];
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
......@@ -673,13 +673,13 @@ class PEAR
*/
function pushErrorHandling($mode, $options = null)
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
$stack = $GLOBALS['_PEAR_error_handler_stack'];
if (isset($this) && is_a($this, 'PEAR')) {
$def_mode = &$this->_default_error_mode;
$def_options = &$this->_default_error_options;
$def_mode = $this->_default_error_mode;
$def_options = $this->_default_error_options;
} else {
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
$def_options = &$GLOBALS['_PEAR_default_error_options'];
$def_mode = $GLOBALS['_PEAR_default_error_mode'];
$def_options = $GLOBALS['_PEAR_default_error_options'];
}
$stack[] = array($def_mode, $def_options);
......@@ -704,7 +704,7 @@ class PEAR
*/
function popErrorHandling()
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
$stack = $GLOBALS['_PEAR_error_handler_stack'];
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment