Version.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Doctrine\Common;
  3. /**
  4. * Class to store and retrieve the version of Doctrine.
  5. *
  6. * @link www.doctrine-project.org
  7. * @since 2.0
  8. * @author Benjamin Eberlei <kontakt@beberlei.de>
  9. * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
  10. * @author Jonathan Wage <jonwage@gmail.com>
  11. * @author Roman Borschel <roman@code-factory.org>
  12. *
  13. * @deprecated The Version class is deprecated, please refrain from checking the version of doctrine/common.
  14. */
  15. class Version
  16. {
  17. /**
  18. * Current Doctrine Version.
  19. */
  20. const VERSION = '2.10.0';
  21. /**
  22. * Compares a Doctrine version with the current one.
  23. *
  24. * @param string $version Doctrine version to compare.
  25. *
  26. * @return int -1 if older, 0 if it is the same, 1 if version passed as argument is newer.
  27. */
  28. public static function compare($version)
  29. {
  30. $currentVersion = str_replace(' ', '', strtolower(self::VERSION));
  31. $version = str_replace(' ', '', $version);
  32. return version_compare($version, $currentVersion);
  33. }
  34. }