upgrade_lib.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2007, various contributors
  6. For a full list of contributors, see "credits.txt".
  7. The full license can be read in "license.txt".
  8. This program is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU General Public License
  10. as published by the Free Software Foundation; either version 2
  11. of the License, or (at your option) any later version.
  12. See the GNU General Public License for more details.
  13. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  14. Mail: info@dokeos.com
  15. ==============================================================================
  16. */
  17. /**
  18. ==============================================================================
  19. * This file contains functions used by the new upgrade script.
  20. ==============================================================================
  21. */
  22. /*
  23. ==============================================================================
  24. CONSTANTS
  25. ==============================================================================
  26. */
  27. /*
  28. ==============================================================================
  29. FUNCTIONS
  30. ==============================================================================
  31. */
  32. /**
  33. * see
  34. * - update-db-1.6.x-1.8.0.inc.php
  35. * - update-db-scorm-1.6.x-1.8.0.inc.php
  36. * - migrate-db-1.6.x-1.8.0-post.sql
  37. * - migrate-db-1.6.x-1.8.0-pre.sql
  38. */
  39. function upgrade_16x_to_180($values)
  40. {
  41. /*
  42. PRE SECTION
  43. UPGRADES TO GENERAL DATABASES before course upgrades
  44. */
  45. //MAIN database section
  46. //Get the list of queries to upgrade the main database
  47. $main_query_list = get_sql_file_contents('migrate-db-1.6.x-1.8.0-pre.sql','main');
  48. if(count($main_query_list)>0)
  49. {
  50. $main_database = $values['database_main_db'];
  51. mysql_select_db($main_database);
  52. foreach($main_query_list as $this_query)
  53. {
  54. mysql_query($this_query);
  55. }
  56. }
  57. //STATS database section
  58. //Get the list of queries to upgrade the statistics database
  59. $statistics_query_list = get_sql_file_contents('migrate-db-1.6.x-1.8.0-pre.sql','stats');
  60. //USER database section
  61. //Get the list of queries to upgrade the user database
  62. $user_query_list = get_sql_file_contents('migrate-db-1.6.x-1.8.0-pre.sql','user');
  63. /*
  64. COURSE SECTION
  65. UPGRADES TO COURSE DATABASES
  66. */
  67. /*
  68. POST SECTION
  69. UPGRADES TO GENERAL DATABASES after course upgrades
  70. */
  71. }
  72. /**
  73. * Note - there is no 1.8.1,
  74. * 1.8.2 is the version that came after 1.8.0
  75. * see
  76. * - update-db-1.8.0-1.8.2.inc.php
  77. * - migrate-db-1.8.0-1.8.2-pre.sql
  78. */
  79. function upgrade_180_to_182($values)
  80. {
  81. }
  82. function upgrade_182_to_183($values)
  83. {
  84. //no database/file structure changes needed?
  85. }
  86. ?>