replace deprecated call_user_method(_array) with call_user_func(_array)

This commit is contained in:
Ralf Becker 2010-07-20 16:47:11 +00:00
parent 4ad95007b5
commit 09719babaf
4 changed files with 14 additions and 7 deletions

View File

@ -120,6 +120,13 @@ function fix_depricated($file,$replace_file=false)
// fix call to not longer existing PDO method $result->fetchSingle()
$lines = str_replace('->fetchSingle(','->fetchColumn(',$lines);
// fix calls to deprecated call_user_method(_array)?(method,object[,args])
if (preg_match('/call_user_method(_array)?\(/',$lines,$matches))
{
$lines = preg_replace('/call_user_method\(([^,]+),([^,\)]+)([,)])/','call_user_func(array(\\2,\\1)\\3',$lines);
$lines = preg_replace('/call_user_method_array\(([^,]+),([^,\)]+)([,)])/','call_user_func_array(array(\\2,\\1)\\3',$lines);
}
if ($lines != $orig)
{
file_put_contents($file.'53',$lines);

View File

@ -858,7 +858,7 @@ class schema_proc
$debug_params = func_get_args();
array_shift($debug_params);
array_shift($debug_params);
call_user_method_array('debug_message',$this,$debug_params);
call_user_func_array(array($this,'debug_message'),$debug_params);
if ($retval < 2 && !$this->dict->debug)
{
echo '<p><b>'.$this->adodb->ErrorMsg()."</b></p>\n";

View File

@ -193,7 +193,7 @@
{
if (is_object($obj))
{
$code = "\$method_response = call_user_method($method,$obj,";
$code = "\$method_response = call_user_func(array($obj,$method),";
$this->debug("about to call object method '$class\-\>$method' with args");
}
else
@ -234,7 +234,7 @@
if (is_object($obj))
{
$this->debug("about to call object method '$obj\-\>$method'");
if(!$method_response = call_user_method($method,$obj))
if(!$method_response = call_user_func(array($obj,$method)))
{
$this->make_fault("Server","Method call failed for '$obj->method' with no params");
return $this->fault();
@ -257,7 +257,7 @@
if($request_data)
{
/* call method with parameters */
$code = "\$method_response = call_user_method(\$method,\$obj,";
$code = "\$method_response = call_user_func(array(\$obj,\$method),";
while(list($x,$y) = each($request_data))
{
$code .= "\$request_data[$x]" . ',';
@ -272,7 +272,7 @@
if(is_object($obj))
{
$this->debug("about to call object method '$obj\-\>$method'");
call_user_method($method,$obj);
call_user_func(array($obj,$method));
}
else
{

View File

@ -1346,7 +1346,7 @@ class XML
}
// Perform an axis action.
$contexts = call_user_method($method, &$this, $axis, $context);
$contexts = call_user_func(array( &$this,$method), $axis, $context);
// Check whether there are predicates.
if ( count($axis["predicate"]) > 0 )
@ -1411,7 +1411,7 @@ class XML
}
// Return the result of the function.
return call_user_method($method, &$this, $node, $arguments);
return call_user_func(array( &$this,$method), $node, $arguments);
}
/**