phpBB

Code Changes

File: cron.php

  Unmodified   Added   Modified   Removed
Line 21Line 21
$auth->acl($user->data);

$cron_type = request_var('cron_type', '');

$auth->acl($user->data);

$cron_type = request_var('cron_type', '');

$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;

 

// Output transparent gif
header('Cache-Control: no-cache');


// Output transparent gif
header('Cache-Control: no-cache');

Line 30Line 29

echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');



echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');


// test without flush ;)
// flush();

// Flush here to prevent browser from showing the page as loading while running cron.
flush();





//

 
if (!isset($config['cron_lock']))
{
set_config('cron_lock', '0', true);

if (!isset($config['cron_lock']))
{
set_config('cron_lock', '0', true);

Line 77Line 75
		if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
{
break;

		if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
{
break;

		}

// A user reported using the mail() function while using shutdown does not work. We do not want to risk that.
if ($use_shutdown_function && !$config['smtp_delivery'])
{
$use_shutdown_function = false;

 
		}

include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$queue = new queue();


		}

include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$queue = new queue();


		if ($use_shutdown_function)
{
register_shutdown_function(array(&$queue, 'process'));
}
else
{

 
			$queue->process();

			$queue->process();

		}

 

break;



break;


Line 106Line 91
			break;
}


			break;
}


		if ($use_shutdown_function)
{
register_shutdown_function(array(&$cache, 'tidy'));
}
else
{

 
			$cache->tidy();

			$cache->tidy();

		}

 

break;



break;


Line 138Line 116
			break;
}


			break;
}


		if ($use_shutdown_function)
{
register_shutdown_function(array(&$search, 'tidy'));
}
else
{

 
			$search->tidy();

			$search->tidy();

		}

 

break;



break;


Line 158Line 129

include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);



include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);


		if ($use_shutdown_function)
{
register_shutdown_function('tidy_warnings');
}
else
{

 
			tidy_warnings();

			tidy_warnings();

		}

 

break;



break;


Line 178Line 142

include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);



include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);


		if ($use_shutdown_function)
{
register_shutdown_function('tidy_database');
}
else
{

 
			tidy_database();

			tidy_database();

		}

 

break;



break;


Line 196Line 153
			break;
}


			break;
}


		if ($use_shutdown_function)
{
register_shutdown_function(array(&$user, 'session_gc'));
}
else
{

 
			$user->session_gc();

			$user->session_gc();

		}

 

break;



break;


Line 229Line 179
			include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);

if ($row['prune_days'])

			include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);

if ($row['prune_days'])

			{
if ($use_shutdown_function)
{
register_shutdown_function('auto_prune', $row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
}
else

 
				{
auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);

				{
auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);

				}

 
			}

if ($row['prune_viewed'])

			}

if ($row['prune_viewed'])

			{
if ($use_shutdown_function)
{
register_shutdown_function('auto_prune', $row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
}
else

 
				{
auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);

				{
auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);

				}

 
			}
}


			}
}


Line 257Line 193
}

// Unloading cache and closing db after having done the dirty work.

}

// Unloading cache and closing db after having done the dirty work.

if ($use_shutdown_function)
{
register_shutdown_function('unlock_cron');
register_shutdown_function('garbage_collection');
}
else
{

 
	unlock_cron();
garbage_collection();

	unlock_cron();
garbage_collection();

}

 

exit;



exit;