4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Intl\ResourceBundle\Reader
;
14 use Symfony\Component\Intl\Exception\InvalidArgumentException
;
15 use Symfony\Component\Intl\Exception\RuntimeException
;
18 * Reads .php resource bundles.
20 * @author Bernhard Schussek <bschussek@gmail.com>
22 class PhpBundleReader
extends AbstractBundleReader
implements BundleReaderInterface
27 public function read($path, $locale)
29 if ('en' !== $locale) {
30 throw new InvalidArgumentException('Only the locale "en" is supported.');
33 $fileName = $path . '/' . $locale . '.php';
35 if (!file_exists($fileName)) {
36 throw new RuntimeException(sprintf(
37 'The resource bundle "%s/%s.php" does not exist.',
43 if (!is_file($fileName)) {
44 throw new RuntimeException(sprintf(
45 'The resource bundle "%s/%s.php" is not a file.',
51 return include $fileName;
57 protected function getFileExtension()