aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/icu/Symfony/Component/Icu/IcuData.php
blob: 478a2f0e9a5be1443fa1a3ae5324320eeb51de64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Icu;

use Symfony\Component\Intl\ResourceBundle\Reader\PhpBundleReader;

/**
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class IcuData
{
    /**
     * Returns the version of the bundled ICU data.
     *
     * @return string The version string.
     */
    public static function getVersion()
    {
        return trim(file_get_contents(__DIR__ . '/Resources/data/version.txt'));
    }

    /**
     * Returns whether the ICU data is stubbed.
     *
     * @return Boolean Returns true if the ICU data is stubbed, false if it is
     *         loaded from ICU .res files.
     */
    public static function isStubbed()
    {
        return true;
    }

    /**
     * Returns the path to the directory where the resource bundles are stored.
     *
     * @return string The absolute path to the resource directory.
     */
    public static function getResourceDirectory()
    {
        return realpath(__DIR__ . '/Resources/data');
    }

    /**
     * Returns a reader for reading resource bundles in this component.
     *
     * @return \Symfony\Component\Intl\ResourceBundle\Reader\BundleReaderInterface
     */
    public static function getBundleReader()
    {
        return new PhpBundleReader();
    }

    /**
     * This class must not be instantiated.
     */
    private function __construct() {}
}