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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. // The ticket plugin has been moved to core in 1.11
  32. $ticketPluginPath = api_get_path(SYS_PLUGIN_PATH).'ticket';
  33. if (is_dir($ticketPluginPath)) {
  34. @rrmdir($ticketPluginPath);
  35. }
  36. // The Skype plugin has been moved to core in 1.11
  37. $skypePluginPath = api_get_path(SYS_PLUGIN_PATH).'skype';
  38. if (is_dir($skypePluginPath)) {
  39. @rrmdir($skypePluginPath);
  40. }
  41. if ($debug) {
  42. error_log('Folders cleaned up');
  43. }
  44. } else {
  45. echo 'You are not allowed here !'.__FILE__;
  46. }