[ Index ]

PHP Cross Reference of Joomla 3.3.0

title

Body

[close]

/cli/ -> update_cron.php (source)

   1  <?php
   2  /**
   3   * @package    Joomla.Cli
   4   *
   5   * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   7   */
   8  
   9  /**
  10   * This is a CRON script which should be called from the command-line, not the
  11   * web. For example something like:
  12   * /usr/bin/php /path/to/site/cli/update_cron.php
  13   */
  14  
  15  // Set flag that this is a parent file.
  16  const _JEXEC = 1;
  17  
  18  error_reporting(E_ALL | E_NOTICE);
  19  ini_set('display_errors', 1);
  20  
  21  // Load system defines
  22  if (file_exists(dirname(__DIR__) . '/defines.php'))
  23  {
  24      require_once dirname(__DIR__) . '/defines.php';
  25  }
  26  
  27  if (!defined('_JDEFINES'))
  28  {
  29      define('JPATH_BASE', dirname(__DIR__));
  30      require_once  JPATH_BASE . '/includes/defines.php';
  31  }
  32  
  33  require_once JPATH_LIBRARIES . '/import.legacy.php';
  34  require_once JPATH_LIBRARIES . '/cms.php';
  35  
  36  // Load the configuration
  37  require_once JPATH_CONFIGURATION . '/configuration.php';
  38  
  39  /**
  40   * This script will fetch the update information for all extensions and store
  41   * them in the database, speeding up your administrator.
  42   *
  43   * @package  Joomla.Cli
  44   * @since    2.5
  45   */
  46  class Updatecron extends JApplicationCli
  47  {
  48      /**
  49       * Entry point for the script
  50       *
  51       * @return  void
  52       *
  53       * @since   2.5
  54       */
  55  	public function doExecute()
  56      {
  57          // Get the update cache time
  58          $component = JComponentHelper::getComponent('com_installer');
  59  
  60          $params = $component->params;
  61          $cache_timeout = $params->get('cachetimeout', 6, 'int');
  62          $cache_timeout = 3600 * $cache_timeout;
  63  
  64          // Find all updates
  65          $this->out('Fetching updates...');
  66          $updater = JUpdater::getInstance();
  67          $updater->findUpdates(0, $cache_timeout);
  68          $this->out('Finished fetching updates');
  69      }
  70  }
  71  
  72  JApplicationCli::getInstance('Updatecron')->execute();


Generated: Fri May 2 13:54:24 2014 Cross-referenced by PHPXref 0.7.1