install_files.inc.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Install the Chamilo files
  5. * Notice : This script has to be included by install/index.php
  6. *
  7. * The script creates two files:
  8. * - configuration.php, the file that contains very important info for Chamilo
  9. * such as the database names.
  10. * - .htaccess file (in the courses directory) that is optional but improves
  11. * security
  12. *
  13. * @package chamilo.install
  14. */
  15. if (defined('SYSTEM_INSTALLATION')) {
  16. // Write the system config file
  17. write_system_config_file(api_get_path(CONFIGURATION_PATH) . 'configuration.php');
  18. // Write a distribution file with the config as a backup for the admin
  19. //write_system_config_file(api_get_path(CONFIGURATION_PATH) . 'configuration.dist.php');
  20. // Write a .htaccess file in the course repository
  21. //write_courses_htaccess_file($urlAppendPath);
  22. // Copy distribution files with renaming for being the actual system configuration files.
  23. copy(
  24. api_get_path(CONFIGURATION_PATH) . 'add_course.conf.dist.php',
  25. api_get_path(CONFIGURATION_PATH) . 'add_course.conf.php'
  26. );
  27. copy(
  28. api_get_path(CONFIGURATION_PATH) . 'course_info.conf.dist.php',
  29. api_get_path(CONFIGURATION_PATH) . 'course_info.conf.php'
  30. );
  31. copy(
  32. api_get_path(CONFIGURATION_PATH) . 'mail.conf.dist.php',
  33. api_get_path(CONFIGURATION_PATH) . 'mail.conf.php'
  34. );
  35. copy(
  36. api_get_path(CONFIGURATION_PATH) . 'profile.conf.dist.php',
  37. api_get_path(CONFIGURATION_PATH) . 'profile.conf.php'
  38. );
  39. copy(
  40. api_get_path(CONFIGURATION_PATH) . 'events.conf.dist.php',
  41. api_get_path(CONFIGURATION_PATH) . 'events.conf.php'
  42. );
  43. copy(
  44. api_get_path(CONFIGURATION_PATH) . 'auth.conf.dist.php',
  45. api_get_path(CONFIGURATION_PATH) . 'auth.conf.php'
  46. );
  47. copy(
  48. api_get_path(CONFIGURATION_PATH) . 'portfolio.conf.dist.php',
  49. api_get_path(CONFIGURATION_PATH) . 'portfolio.conf.php'
  50. );
  51. } else {
  52. echo 'You are not allowed here !' . __FILE__;
  53. }