[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/cli/ -> garbagecron.php (source)

   1  <?php
   2  /**
   3   * @package        Joomla.Cli
   4   *
   5   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   6   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   7   */
   8  
   9  // Make sure we're being called from the command line, not a web interface
  10  if (array_key_exists('REQUEST_METHOD', $_SERVER)) die();
  11  
  12  // Initialize Joomla framework
  13  define('_JEXEC', 1);
  14  define('DS', DIRECTORY_SEPARATOR);
  15  
  16  // Load system defines
  17  if (file_exists(dirname(dirname(__FILE__)) . '/defines.php'))
  18  {
  19      require_once dirname(dirname(__FILE__)) . '/defines.php';
  20  }
  21  
  22  if (!defined('_JDEFINES'))
  23  {
  24      define('JPATH_BASE', dirname(dirname(__FILE__)));
  25      require_once  JPATH_BASE . '/includes/defines.php';
  26  }
  27  
  28  // Get the framework.
  29  require_once JPATH_LIBRARIES . '/import.php';
  30  
  31  // Bootstrap the CMS libraries.
  32  require_once JPATH_LIBRARIES . '/cms.php';
  33  
  34  // Force library to be in JError legacy mode
  35  JError::$legacy = true;
  36  
  37  /**
  38   * Cron job to trash expired cache data
  39   *
  40   * @package  Joomla.CLI
  41   * @since    2.5
  42   */
  43  class GarbageCron extends JApplicationCli
  44  {
  45      /**
  46       * Entry point for the script
  47       *
  48       * @return  void
  49       *
  50       * @since   2.5
  51       */
  52  	public function execute()
  53      {
  54          $cache = JFactory::getCache();
  55          $cache->gc();
  56      }
  57  }
  58  
  59  JApplicationCli::getInstance('GarbageCron')->execute();


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1