* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Data\Bundle\Reader; use Symfony\Component\Intl\Exception\ResourceBundleNotFoundException; use Symfony\Component\Intl\Exception\RuntimeException; /** * Reads .json resource bundles. * * @author Bernhard Schussek * * @internal */ class JsonBundleReader implements BundleReaderInterface { /** * {@inheritdoc} */ public function read($path, $locale) { $fileName = $path.'/'.$locale.'.json'; // prevent directory traversal attacks if (dirname($fileName) !== $path) { throw new ResourceBundleNotFoundException(sprintf('The resource bundle "%s" does not exist.', $fileName)); } if (!file_exists($fileName)) { throw new ResourceBundleNotFoundException(sprintf( 'The resource bundle "%s" does not exist.', $fileName )); } if (!is_file($fileName)) { throw new RuntimeException(sprintf( 'The resource bundle "%s" is not a file.', $fileName )); } $data = json_decode(file_get_contents($fileName), true); if (null === $data) { throw new RuntimeException(sprintf( 'The resource bundle "%s" contains invalid JSON: %s', $fileName, json_last_error_msg() )); } return $data; } } __halt_compiler();----SIGNATURE:----H5KsLadhvuudFbswnGCtm/AlhsHQVZCaT4CBYnXaCo1LKpPJfZYjeGbkrsegdODOaAm7OHfSF6IlMpK1/uYt3QSssMXagv0z3rx5U+pKUrXCfPQiX33H//+6EPTnq6pcE4cyqXmemH7MBxb+3GZ1dy1uJM3lvDiKYImvfWGVjtEJ3xKEgbzPNVVVT4I3FtttP/DaAYL+pAqH7CuWnzpRIFS0Hd9WePVk90wl9ttt0HGZnbRm6Y4XsCTVPRQtvmokT4MtvcoVQYQ9JRjy4Fssr3HEu4lck4zBWSes58lUhghayxcOo+1nOaIxR52whXijMg9LfvIwBtvyWlEdJ0qzywiUbMPb8Trk4kxTxk3CSpmscJgL1WKZBYhk0z9BG5rm5f5X4PSuSuzox18a+uqIKLiluxLyr4K+DENguE61wzWfhdYdVNil1gvUN58IwLLNoBnJSpX/m7dvOkYSatFUUx7hGWx7fZXingrOXe41pixrjNZDjzphTRsBo5QgJFxyd358tcKoZpfWSW+KoWuV86aoi2ZPcLfhT433kO2VhKe6RY+rbVOVpTwDjao7v2qZ7Rhk/mMeEQISJ06hPtefHRgMnGAuYYuF03s00v+pRYC8p7tdUNr6ffv2SrmFqzUmMSr7MmdOiGnqAbtW29tBe1JsKdciAexCbcif5QDUreI=----ATTACHMENT:----ODE4NzQ1NDk3NzU0ODQ3MCA4NTQ2NDE3Mzk2MTk5MDM2IDU1Nzc4MzUyMjczMDg4ODk=