Esempio n. 1
0
 /**
  * Run cron
  *
  * @param  bool $noshutdownfunc Set to true to run directly rather than to run in shutdown function
  *
  * @return bool
  */
 public function run($noshutdownfunc = false)
 {
     require_once DIR . '/includes/functions_cron.php';
     $options = vB::getDatastore()->get_value('options');
     if (!$noshutdownfunc and empty($options['crontab'])) {
         vB_Shutdown::instance()->add('exec_cron');
     } else {
         $cronid = NULL;
         if (!empty($options['crontab']) and php_sapi_name() == 'cli') {
             $cronid = intval($_SERVER['argv'][1]);
             // if its a negative number or 0 set it to NULL so it just grabs the next task
             if ($cronid < 1) {
                 $cronid = NULL;
             }
         }
         exec_cron($cronid);
     }
     return true;
 }
Esempio n. 2
0
if (!(strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false and strpos(SAPI_NAME, 'cgi') !== false)) {
    header('Content-Length: ' . $filesize);
    header('Connection: Close');
}
if (!$vbulletin->options['crontab']) {
    echo $filedata;
    flush();
}
($hook = vBulletinHook::fetch_hook('cron_start')) ? eval($hook) : false;
if (!defined('NOSHUTDOWNFUNC') and !$vbulletin->options['crontab']) {
    vB_Shutdown::add('exec_cron');
} else {
    $cronid = NULL;
    if ($vbulletin->options['crontab'] and SAPI_NAME == 'cli') {
        $cronid = intval($_SERVER['argv'][1]);
        // if its a negative number or 0 set it to NULL so it just grabs the next task
        if ($cronid < 1) {
            $cronid = NULL;
        }
    }
    exec_cron($cronid);
    if (defined('NOSHUTDOWNFUNC')) {
        $db->close();
    }
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:56, Sat Oct 11th 2008
|| # CVS: $RCSfile$ - $Revision: 26399 $
|| ####################################################################
\*======================================================================*/