update-files-1.10.0-1.11.0.inc.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Symfony\Component\Filesystem\Filesystem;
  4. use Symfony\Component\Finder\Finder;
  5. /**
  6. * Chamilo LMS
  7. *
  8. * Updates the Chamilo files from version 1.10.0 to version 1.11.0
  9. * This script operates only in the case of an update, and only to change the
  10. * active version number (and other things that might need a change) in the
  11. * current configuration file.
  12. * @package chamilo.install
  13. */
  14. error_log("Starting ".basename(__FILE__));
  15. global $debug;
  16. if (defined('SYSTEM_INSTALLATION')) {
  17. // Changes for 1.11.x
  18. // Delete directories and files that are not necessary anymore
  19. // The main/exercice path was moved to main/exercise, so the code from 1.11
  20. // should just create the new directory, and we should delete the previous
  21. // one to avoid the web server to use the old
  22. $exercisePath = api_get_path(SYS_CODE_PATH).'exercice';
  23. if (is_dir($exercisePath)) {
  24. @rrmdir($exercisePath);
  25. }
  26. // Same with main/newscorm, renamed main/lp
  27. $lpPath = api_get_path(SYS_CODE_PATH).'newscorm';
  28. if (is_dir($lpPath)) {
  29. @rrmdir($lpPath);
  30. }
  31. $ticketPluginPath = api_get_path(SYS_PLUGIN_PATH).'ticket';
  32. if (is_dir($ticketPluginPath)) {
  33. @rrmdir($ticketPluginPath);
  34. }
  35. if ($debug) {
  36. error_log('Folders cleaned up');
  37. }
  38. } else {
  39. echo 'You are not allowed here !'.__FILE__;
  40. }