Paul,
No I cannot get it to work. I thought maybe it was something to do with passing an object, but I can’t get an array to work either. I am currently suspecting a PHP bug but there is still the chance I am being really stupid!
Here is my test. If it works there should be an element [two] => bananas at after—-3——
Code in core.session.php
echo '-------------------1--------------------';
$myarray['one']='apples';
print_r($myarray);
echo '-------------------2--------------------';
$edata = $EXT->call_extension('sessions_end', $myarray);
echo '-------------------3--------------------';
print_r($myarray);
Code in core.extensions.php
echo '------------------a------------------';
$args['two']='oranges';
print_r($args);
echo '------------------b------------------';
$this->last_call = call_user_func_array(array(&$this->OBJ, $method), $args);
echo '------------------c------------------';
print_r($args);
my extension
function member_data(&$data) {
global $DB;
$data['two']= "bananas";
echo 'x';print_r($data);echo 'x';
return false;
And this is what I get:
-------------------1--------------------Array
(
[one] => apples
)
-------------------2--------------------------------------a------------------Array
(
[0] => Array
(
[one] => apples
)
[three] => oranges
)
------------------b------------------xArray
(
[one] => apples
[two] => bananas
)
x------------------c------------------Array
(
[0] => Array
(
[one] => apples
)
[three] => oranges
)
-------------------3--------------------Array
(
[one] => apples
)
I did wonder if it was the change to the code in core.extensions to be able to pass arrays properly
$args=array_slice(func_get_args(), 1);
//$extra_args = array_slice(func_get_args(), 2);
//$args = is_array($args) ? array_merge($args, $extra_args) : array_merge(array($args), $extra_args);
so I changed it back and that messed up the array and didn’s solve the problem.:
-------------------1--------------------Array
(
[one] => apples
)
-------------------2--------------------------------------a------------------Array
(
[one] => apples
[two] => oranges
)
------------------b------------------xbpplesx------------------c------------------Array
(
[one] => apples
[two] => oranges
)
-------------------3--------------------Array
(
[one] => apples
)
I am running PHP 4.3.8.
For the moment will go back to my hack to get it working but if you have any ideas to try will be happy to give it a go.
Phoebe.