]>
Commit | Line | Data |
---|---|---|
4f5b44bd NL |
1 | <?php |
2 | ||
3 | /* | |
4 | * This file is part of the Symfony package. | |
5 | * | |
6 | * (c) Fabien Potencier <fabien@symfony.com> | |
7 | * | |
8 | * For the full copyright and license information, please view the LICENSE | |
9 | * file that was distributed with this source code. | |
10 | */ | |
11 | ||
12 | namespace Symfony\Component\Icu; | |
13 | ||
14 | use Symfony\Component\Intl\ResourceBundle\Reader\PhpBundleReader; | |
15 | ||
16 | /** | |
17 | * @author Bernhard Schussek <bschussek@gmail.com> | |
18 | */ | |
19 | class IcuData | |
20 | { | |
21 | /** | |
22 | * Returns the version of the bundled ICU data. | |
23 | * | |
24 | * @return string The version string. | |
25 | */ | |
26 | public static function getVersion() | |
27 | { | |
28 | return trim(file_get_contents(__DIR__ . '/Resources/data/version.txt')); | |
29 | } | |
30 | ||
31 | /** | |
32 | * Returns whether the ICU data is stubbed. | |
33 | * | |
34 | * @return Boolean Returns true if the ICU data is stubbed, false if it is | |
35 | * loaded from ICU .res files. | |
36 | */ | |
37 | public static function isStubbed() | |
38 | { | |
39 | return true; | |
40 | } | |
41 | ||
42 | /** | |
43 | * Returns the path to the directory where the resource bundles are stored. | |
44 | * | |
45 | * @return string The absolute path to the resource directory. | |
46 | */ | |
47 | public static function getResourceDirectory() | |
48 | { | |
49 | return realpath(__DIR__ . '/Resources/data'); | |
50 | } | |
51 | ||
52 | /** | |
53 | * Returns a reader for reading resource bundles in this component. | |
54 | * | |
55 | * @return \Symfony\Component\Intl\ResourceBundle\Reader\BundleReaderInterface | |
56 | */ | |
57 | public static function getBundleReader() | |
58 | { | |
59 | return new PhpBundleReader(); | |
60 | } | |
61 | ||
62 | /** | |
63 | * This class must not be instantiated. | |
64 | */ | |
65 | private function __construct() {} | |
66 | } |