[ Index ]

PHP Cross Reference of Joomla 3.3.0

title

Body

[close]

/cli/ -> deletefiles.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  // We are a valid entry point.
  10  const _JEXEC = 1;
  11  
  12  // Load system defines
  13  if (file_exists(dirname(__DIR__) . '/defines.php'))
  14  {
  15      require_once dirname(__DIR__) . '/defines.php';
  16  }
  17  
  18  if (!defined('_JDEFINES'))
  19  {
  20      define('JPATH_BASE', dirname(__DIR__));
  21      require_once  JPATH_BASE . '/includes/defines.php';
  22  }
  23  
  24  // Get the framework.
  25  require_once JPATH_LIBRARIES . '/import.legacy.php';
  26  
  27  // Bootstrap the CMS libraries.
  28  require_once JPATH_LIBRARIES . '/cms.php';
  29  
  30  // Configure error reporting to maximum for CLI output.
  31  error_reporting(E_ALL);
  32  ini_set('display_errors', 1);
  33  
  34  // Load Library language
  35  $lang = JFactory::getLanguage();
  36  
  37  // Try the files_joomla file in the current language (without allowing the loading of the file in the default language)
  38  $lang->load('files_joomla.sys', JPATH_SITE, null, false, false)
  39  // Fallback to the files_joomla file in the default language
  40  || $lang->load('files_joomla.sys', JPATH_SITE, null, true);
  41  
  42  /**
  43   * A command line cron job to attempt to remove files that should have been deleted at update.
  44   *
  45   * @package  Joomla.Cli
  46   * @since    3.0
  47   */
  48  class DeletefilesCli extends JApplicationCli
  49  {
  50      /**
  51       * Entry point for CLI script
  52       *
  53       * @return  void
  54       *
  55       * @since   3.0
  56       */
  57  	public function doExecute()
  58      {
  59          // Import the dependencies
  60          jimport('joomla.filesystem.file');
  61          jimport('joomla.filesystem.folder');
  62  
  63          // We need the update script
  64          JLoader::register('JoomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php');
  65  
  66          // Instantiate the class
  67          $class = new JoomlaInstallerScript;
  68  
  69          // Run the delete method
  70          $class->deleteUnexistingFiles();
  71      }
  72  }
  73  
  74  // Instantiate the application object, passing the class name to JCli::getInstance
  75  // and use chaining to execute the application.
  76  JApplicationCli::getInstance('DeletefilesCli')->execute();


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