PDA

View Full Version : Access the datastore inside a cron?


JamesAB
01-27-2009, 06:29 AM
I've been playing with this but I haven't had any luck...:(

I set up a cron job to serialize data to the datastore. That works fine. I can see the information is in the database.

However, now I'd like to access the information I already put in the datastore at the beginning of the cron job.

I'm storing the information like this:

$jab_thumbnail_servers[server1] = true;
$jab_thumbnail_servers[server2] = false;
build_datastore('jab_thumbnail_servers', serialize($jab_thumbnail_servers), TRUE);

How can I access this array at the start of the cron?

I've tried these, but no luck:
//get special data templates from the datastore
$specialtemplates = array(
'jab_thumbnail_servers',
);

$datastore_fetch[]="'jab_thumbnail_servers'";

$jab_current_status[server1] = $vbulletin->jab_thumbnail_servers['server1'];

Do I need to add something special in order to access the datastore from my cron script?
Or am I trying to access the data wrong here?

Thanks for your help,
James

Dismounted
01-27-2009, 07:25 AM
$vbulletin->datastore->fetch(array('jab_thumbnail_servers'));
print_r($vbulletin->jab_thumbnail_servers);