Source for file deletefiles.php

Documentation is available at deletefiles.php

  1. <?php
  2. /**
  3.  * @package    Joomla.Cli
  4.  *
  5.  * @copyright  Copyright (C) 2005 - 2013 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. ini_set('display_errors'1);
  32.  
  33. // Load Library language
  34. $lang JFactory::getLanguage();
  35.  
  36. // Try the files_joomla file in the current language (without allowing the loading of the file in the default language)
  37. $lang->load('files_joomla.sys'JPATH_SITEnullfalsefalse)
  38. // Fallback to the files_joomla file in the default language
  39. || $lang->load('files_joomla.sys'JPATH_SITEnulltrue);
  40.  
  41. /**
  42.  * A command line cron job to attempt to remove files that should have been deleted at update.
  43.  *
  44.  * @package  Joomla.CLI
  45.  * @since    3.0
  46.  */
  47. {
  48.     /**
  49.      * Entry point for CLI script
  50.      *
  51.      * @return  void 
  52.      *
  53.      * @since   3.0
  54.      */
  55.     public function doExecute()
  56.     {
  57.         // Import the dependencies
  58.         jimport('joomla.filesystem.file');
  59.         jimport('joomla.filesystem.folder');
  60.  
  61.         // We need the update script
  62.         JLoader::register('JoomlaInstallerScript'JPATH_ADMINISTRATOR '/components/com_admin/script.php');
  63.  
  64.         // Instantiate the class
  65.         $class new JoomlaInstallerScript;
  66.  
  67.         // Run the delete method
  68.         $class->deleteUnexistingFiles();
  69.     }
  70. }
  71.  
  72. // Instantiate the application object, passing the class name to JCli::getInstance
  73. // and use chaining to execute the application.
  74. JApplicationCli::getInstance('DeletefilesCli')->execute();

Documentation generated on Tue, 19 Nov 2013 15:01:24 +0100 by phpDocumentor 1.4.3