IcuData.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. namespace Symfony\Component\Icu;
  11. use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader;
  12. /**
  13. * @author Bernhard Schussek <bschussek@gmail.com>
  14. */
  15. class IcuData
  16. {
  17. /**
  18. * Returns the version of the bundled ICU data.
  19. *
  20. * @return string The version string.
  21. */
  22. public static function getVersion()
  23. {
  24. return trim(file_get_contents(__DIR__ . '/Resources/data/version.txt'));
  25. }
  26. /**
  27. * Returns whether the ICU data is stubbed.
  28. *
  29. * @return Boolean Returns true if the ICU data is stubbed, false if it is
  30. * loaded from ICU .res files.
  31. */
  32. public static function isStubbed()
  33. {
  34. return false;
  35. }
  36. /**
  37. * Returns the path to the directory where the resource bundles are stored.
  38. *
  39. * @return string The absolute path to the resource directory.
  40. */
  41. public static function getResourceDirectory()
  42. {
  43. return realpath(__DIR__ . '/Resources/data');
  44. }
  45. /**
  46. * Returns a reader for reading resource bundles in this component.
  47. *
  48. * @return \Symfony\Component\Intl\ResourceBundle\Reader\BundleReaderInterface
  49. */
  50. public static function getBundleReader()
  51. {
  52. return new BinaryBundleReader();
  53. }
  54. /**
  55. * This class must not be instantiated.
  56. */
  57. private function __construct() {}
  58. }