travis_installer.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Travis CI CLI installer script. It's designed for core automatic tests only.
  4. *
  5. * @access private
  6. * @package Elgg
  7. * @subpackage Test
  8. */
  9. $enabled = getenv('TRAVIS') != '';//are we on Travis?
  10. if (!$enabled) {
  11. echo "This script should be run only in Travis CI test environment.\n";
  12. exit(1);
  13. }
  14. if (PHP_SAPI !== 'cli') {
  15. echo "You must use the command line to run this script.\n";
  16. exit(2);
  17. }
  18. $elggRoot = dirname(dirname(__DIR__));
  19. require_once "$elggRoot/vendor/autoload.php";
  20. $installer = new ElggInstaller();
  21. // none of the following may be empty
  22. $params = array(
  23. // database parameters
  24. 'dbuser' => 'root',
  25. 'dbpassword' => 'password',
  26. 'dbname' => 'elgg',
  27. 'dbprefix' => 't_i_elgg_',
  28. // site settings
  29. 'sitename' => 'Elgg Travis Site',
  30. 'siteemail' => 'no_reply@travis.elgg.org',
  31. 'wwwroot' => 'http://localhost:8888/',
  32. 'dataroot' => getenv('HOME') . '/elgg_data/',
  33. // admin account
  34. 'displayname' => 'Administrator',
  35. 'email' => 'admin@travis.elgg.org',
  36. 'username' => 'admin',
  37. 'password' => 'fancypassword',
  38. );
  39. // install and create the .htaccess file
  40. $installer->batchInstall($params, TRUE);
  41. // at this point installation has completed (otherwise an exception halted execution).
  42. echo "Elgg CLI install successful. wwwroot: " . elgg_get_config('wwwroot') . "\n";