[ Index ]

PHP Cross Reference of MyBB 1.8.37

title

Body

[close]

/ -> task.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.8
   4   * Copyright 2014 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://www.mybb.com
   7   * License: http://www.mybb.com/about/license
   8   *
   9   */
  10  
  11  ignore_user_abort(true);
  12  @set_time_limit(0);
  13  
  14  define("IN_MYBB", 1);
  15  define("NO_ONLINE", 1);
  16  define("IN_TASK", 1);
  17  define('THIS_SCRIPT', 'task.php');
  18  
  19  require_once dirname(__FILE__)."/inc/init.php";
  20  
  21  // Load language
  22  $lang->set_language($mybb->settings['bblanguage']);
  23  $lang->load("global");
  24  $lang->load("messages");
  25  
  26  if(function_exists('mb_internal_encoding') && !empty($lang->settings['charset']))
  27  {
  28      @mb_internal_encoding($lang->settings['charset']);
  29  }
  30  
  31  require_once  MYBB_ROOT."inc/functions_task.php";
  32  
  33  // Are tasks set to run via cron instead & are we accessing this file via the CLI?
  34  // php task.php [tid]
  35  if(PHP_SAPI == "cli")
  36  {
  37      // Passing a specific task ID
  38      if($_SERVER['argc'] == 2)
  39      {
  40          $query = $db->simple_select("tasks", "tid", "tid='".(int)$_SERVER['argv'][1]."'");
  41          $tid = $db->fetch_field($query, "tid");
  42      }
  43  
  44      if($tid)
  45      {
  46          run_task($tid);
  47      }
  48      else
  49      {
  50          run_task();
  51      }
  52  }
  53  // Otherwise false GIF image, only supports running next available task
  54  else
  55  {
  56      // Send our fake gif image (clear 1x1 transparent image)
  57      header("Content-type: image/gif");
  58      header("Expires: Sat, 1 Jan 2000 01:00:00 GMT");
  59      header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
  60      header("Cache-Control: no-cache, must-revalidate");
  61      header("Pragma: no-cache");
  62      echo base64_decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==");
  63  
  64      // If the use shutdown functionality is turned off, run any shutdown related items now.
  65      if($mybb->use_shutdown == true)
  66      {
  67          add_shutdown("run_task");
  68      }
  69      else
  70      {
  71          run_task();
  72      }
  73  }


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref