version.php 823 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Elgg version number.
  4. * This file defines the current version of the core Elgg code being used.
  5. * This is compared against the values stored in the database to determine
  6. * whether upgrades should be performed.
  7. *
  8. * @package Elgg
  9. * @subpackage Core
  10. */
  11. // YYYYMMDD = Elgg Date
  12. // XX = Interim incrementer
  13. $version = 2015041400;
  14. $composerJson = file_get_contents(dirname(__FILE__) . "/composer.json");
  15. if ($composerJson === false) {
  16. throw new Exception("Unable to read composer.json file!");
  17. }
  18. $composer = json_decode($composerJson);
  19. if ($composer === null) {
  20. throw new Exception("JSON parse error while reading composer.json!");
  21. }
  22. // Human-friendly version name
  23. if (!isset($composer->version)) {
  24. throw new Exception("Version field must be set in composer.json!");
  25. }
  26. $release = $composer->version;