Memcached PHP Sessions

Roberto Spadim roberto at spadim.com.br
Fri Feb 2 03:42:17 UTC 2007


Hello i was thinking about the problem of storing one array and reading it
for example in PHP language:

in memory cache we have it now:
$variable=array('value1','value2');


i will run one script and another at same time

$mem->set('variable',array('value3','value2'));
// another:
$mem->set('variable',array('value1','value4'));

since i need only change array index 0 on first and index 1 on second i 
shouldn't change all array because i will get the last changed, could we 
implement some features ONLY for ARRAY (or coletions (associative 
array)), for example
$mem->set('variable[0]','value1');
$mem->set('variable[1]','value2');

with it we could get array back with
->fetch('variable')
or better:
->fetch('variable[index that i want]');

this could be very good since variable[0] only exists if variable key exists
what you think? since every language have array variable type we could 
implement a better array implementation for reading and writing arrays
some functions should be created for example to set array we must change 
code to don't allow set with "[" "]" without the key before it have been 
setted
and when we read we should look first variable and after check for array 
index if it exists

it could be very good for veeeeeery big arrays and we just need to 
change some keys and read all keys (or just one)

thanks



More information about the memcached mailing list