コード例 #1
0
 /**
  * Entry point for CLI script
  *
  * @return  void
  *
  * @since   3.0
  */
 public function doExecute()
 {
     // Import the dependencies
     jimport('joomla.filesystem.file');
     jimport('joomla.filesystem.folder');
     // We need the update script
     JLoader::register('JoomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php');
     // Instantiate the class
     $class = new JoomlaInstallerScript();
     // Run the delete method
     $class->deleteUnexistingFiles();
 }
コード例 #2
0
 /**
  * Fixes database problems
  *
  * @return  void
  */
 public function fix()
 {
     if (!($changeSet = $this->getItems())) {
         return false;
     }
     $changeSet->fix();
     $this->fixSchemaVersion($changeSet);
     $this->fixUpdateVersion();
     $installer = new JoomlaInstallerScript();
     $installer->deleteUnexistingFiles();
     $this->fixDefaultTextFilters();
 }
コード例 #3
0
ファイル: database.php プロジェクト: SysBind/joomla-cms
 /**
  * Fixes database problems.
  *
  * @return  void
  */
 public function fix()
 {
     if (!($changeSet = $this->getItems())) {
         return false;
     }
     $changeSet->fix();
     $this->fixSchemaVersion($changeSet);
     $this->fixUpdateVersion();
     $installer = new JoomlaInstallerScript();
     $installer->deleteUnexistingFiles();
     $this->fixDefaultTextFilters();
     // Finally, make sure the database is converted to utf8mb4 if supported by the server
     $this->convertTablesToUtf8mb4();
 }
コード例 #4
0
ファイル: database.php プロジェクト: adjaika/J3Base
 /**
  * Fixes database problems.
  *
  * @return  void
  */
 public function fix()
 {
     if (!($changeSet = $this->getItems())) {
         return false;
     }
     $changeSet->fix();
     $this->fixSchemaVersion($changeSet);
     $this->fixUpdateVersion();
     $installer = new JoomlaInstallerScript();
     $installer->deleteUnexistingFiles();
     $this->fixDefaultTextFilters();
     /*
      * Finally, if the schema updates succeeded, make sure the database is
      * converted to utf8mb4 or, if not suported by the server, compatible to it.
      */
     $statusArray = $changeSet->getStatus();
     if (count($statusArray['error']) == 0) {
         $installer->convertTablesToUtf8mb4(false);
     }
 }
コード例 #5
0
 /**
  * Run part of the Joomla! finalisation script, namely the part that cleans up unused files/folders
  *
  * @param   string  $siteRoot     The root to the Joomla! site
  * @param   string  $restorePath  The base path to restore.php
  *
  * @return  void
  *
  * @since   3.5.1
  */
 function finalizeRestore($siteRoot, $restorePath)
 {
     if (!defined('JPATH_ROOT')) {
         define('JPATH_ROOT', $siteRoot);
     }
     $filePath = JPATH_ROOT . '/administrator/components/com_admin/script.php';
     if (file_exists($filePath)) {
         require_once $filePath;
     }
     // Make sure Joomla!'s code can figure out which files exist and need be removed
     clearstatcache();
     // Remove obsolete files - prevents errors occuring in some system plugins
     if (class_exists('JoomlaInstallerScript')) {
         $script = new JoomlaInstallerScript();
         $script->deleteUnexistingFiles();
     }
     // Clear OPcache
     if (function_exists('opcache_reset')) {
         opcache_reset();
     } elseif (function_exists('apc_clear_cache')) {
         @apc_clear_cache();
     }
 }