I have built a tool, where I need the functionality from a cron. I saw, that you use in your DB Backup tool the phpBB internal function and I tried to make it similar for my mod. So I did following:
Opened includes/functions.php, searched:
- Code: Select all
if ($cron_type)
{
$template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
and ADDED BEFORE:
- Code: Select all
else if ((time() + ($config['chart_server_time'] * 3600)) > ($config['chart_start_time'] + $config['chart_period']))
{
// run dm charts reset
$cron_type = 'dm_chart_reset';
}
Then I opened cron.php and searched:
- Code: Select all
}
// Unloading cache and closing db after having done the dirty work.
if ($use_shutdown_function)
and ADDED BEFORE:
- Code: Select all
// Run DM Charts reset
case 'dm_chart_reset' :
include($phpbb_root_path . 'includes/functions_dm_music_charts.' . $phpEx);
if ($use_shutdown_function)
{
register_shutdown_function('dm_chart_reset');
}
else
{
check_charts_reset();
}
break;
So all looks similar to your DB Backup. The only thing is now, that it seems not to start the function check_charts_reset() ....
Is there probably something else I need to take care of? I made it earlier with a "manual" call of a cronjob php file and an external provider, who starts the job. But I have the feeling, it's more easier with the phpBB internal feature ...
Thanks,
Felix

