/** * Runs this cron task. * * @return null */ public function run() { if (!class_exists('queue')) { include $this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext; } $queue = new \queue(); $queue->process(); }
*/ switch ($cron_type) { case 'queue': 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(); if ($use_shutdown_function) { register_shutdown_function(array(&$queue, 'process')); } else { $queue->process(); } break; case 'tidy_cache': if (time() - $config['cache_gc'] <= $config['cache_last_gc'] || !method_exists($cache, 'tidy')) { break; } if ($use_shutdown_function) { register_shutdown_function(array(&$cache, 'tidy')); } else { $cache->tidy(); } break; case 'tidy_search': // Select the search method $search_type = basename($config['search_type']);
function script_close($save = true) { global $_CORE_CONFIG, $site_file_root, $_CLASS; if (!empty($_CLASS['core_user'])) { // phpbb 2.1.2 only remove. if (file_exists($site_file_root . 'cache/queue.php')) { require_once $site_file_root . 'includes/forums/functions_messenger.php'; $queue = new queue(); $queue->process(); } if ($save) { //if ($_CLASS['core_user']->is_admin && $_CORE_CONFIG['server']['error_options']) if ($_CORE_CONFIG['server']['error_options']) { if (!empty($_CLASS['core_db']->query_list)) { $_CLASS['core_user']->session_data_set('query_list', $_CLASS['core_db']->query_list); $_CLASS['core_user']->session_data_set('query_details', $_CLASS['core_db']->query_details); } if (isset($_CLASS['core_error_handler']) && !empty($_CLASS['core_error_handler']->error_array)) { $_CLASS['core_user']->session_data_set('debug', $_CLASS['core_error_handler']->error_array); } } $_CLASS['core_user']->save(); } } if (!empty($_CLASS['core_cache'])) { $_CLASS['core_cache']->save(); } if (!empty($_CLASS['core_db'])) { $_CLASS['core_db']->disconnect(); } if (!empty($_CLASS['core_error_handler'])) { $_CLASS['core_error_handler']->stop(); } die; }