test-compat.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use Symfony\Component\Intl\Intl;
  11. require_once __DIR__ . '/common.php';
  12. require_once __DIR__ . '/autoload.php';
  13. if (1 !== $GLOBALS['argc']) {
  14. bailout(<<<MESSAGE
  15. Usage: php test-compat.php
  16. Tests the compatibility of the current ICU version (bundled in ext/intl) with
  17. different versions of symfony/icu.
  18. For running this script, the intl extension must be loaded and all vendors
  19. must have been installed through composer:
  20. composer install --dev
  21. MESSAGE
  22. );
  23. }
  24. echo LINE;
  25. echo centered("ICU Compatibility Test") . "\n";
  26. echo LINE;
  27. echo "Your ICU version: " . Intl::getIcuVersion() . "\n";
  28. echo "Compatibility with symfony/icu:\n";
  29. $branches = array(
  30. '1.1.x',
  31. '1.2.x',
  32. );
  33. cd(__DIR__ . '/../../vendor/symfony/icu/Symfony/Component/Icu');
  34. foreach ($branches as $branch) {
  35. run('git checkout ' . $branch . ' 2>&1');
  36. exec('php ' . __DIR__ . '/util/test-compat-helper.php > /dev/null 2> /dev/null', $output, $status);
  37. echo "$branch: " . (0 === $status ? "YES" : "NO") . "\n";
  38. }
  39. echo "Done.\n";