![]() |
Cron Job Insight Required
Hi All,
I am having some trouble with a cron job not receiving vbulletin global variables. The cron job runs fine if activated manually from the ACP, but it fails to work as a standalone scheduled task. The file content looks like this <?php error_reporting(E_ALL & ~E_NOTICE); if (!is_object($vbulletin->db)) {exit;} if ($vbulletin->options['mysettingname'] == 1){ ... do something... } ... ?> Any call to "$vbulletin->options['mysettingname']" or to "vbphrase['myphrasename']" fails to work and even the function "construct_phrase(...)" fails to work and I ressorted to get the values directly from the "setting" and "phrase" tables in the database. Is there any type of memory limitation in vbulletin for a hack/mod amount of settings/phrases used that might prevent global variables to be passed? Any hint or insight is appreciated. :) I read the recommendations by Lynne and Marco, but to no avail. |
$vbulletin->options should be available in cron jobs, what exactly makes you think they aren't ?
|
Their content happen to be empty when the cron job runs alone. When run manually, they are not empty. :confused:
|
Is the settinggroup in which these settings are stored loaded?
|
Settinggroup loaded with the product file. From a manual run of the cron job, the values of the different settings are available. But on its own as a scheduled job, those values do not seem to be available. Is there any special "include" instruction that must be specified at the very beginning of a cron file?
To have the cron file working as a standalone scheduled job, I have replaced (in the cron file) for example all occurrences of: $cron_mysetting_varname = $vbulletin->options['mysetting_varname'] (resp. $cron_myphrase = $vbphrase['myphrase']) with: $get_setting = $vbulletin->db->query_read("SELECT * FROM `". TABLE_PREFIX ."setting` WHERE `varname` = 'mysetting_varname'"); $fetchsetting = $vbulletin->db->fetch_array($get_setting); $cron_mysetting_varname = $fetchsetting['value']; (resp. $get_phrase = $vbulletin->db->query_read("SELECT * FROM `". TABLE_PREFIX ."phrase` WHERE `varname` = 'myphrase'"); $fetchphrase = $vbulletin->db->fetch_array($get_phrase); $cron_myphrase = $fetchphrase['text']; ) |
All times are GMT. The time now is 05:55 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|