* * 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:----RcjFORvwGHi/rJY/U5FH8EXZIzDD0ATAmkKB7nZUNKCLOTCAGAMxdiGNnhHBuB/C+rjupFsIGL4VY2+MW6Y1wp95a7ztbhez67P/QsChuQmGLGTaB14qQZNMCe+l9rrhqqC30l0B4rd9VhJBvKlyoPdRlu7jYSml/en+H26MwzvbAoxXKhI8lpjjNGCYr0dkPuNmoCSoMRmt/UHO0l2LWOuQCiwZYaXEZKp/rCe3QtSp7fOOFFT+RhJHJ30cfA5CVVhz1xpjBxITTJwBklrnEHfxVxFqNaZ5Xnw0f8exwTYAd8qNA3F1DwcvN1nHigDyUtxSS00pSN6SiaMGCcHegqHH9Yk8Znbj3B+/m5eXPEEbS/RmTDeDYaPry9SXx45fRmgen4GFK2BaH9WT9xK+vsRtwhsjE+0/dODXptaXePqwSHcBupHVq0QtPZHRwGXKvuYs4ZFT8dPiYjRRptYQ6uaWSCZzAZVhsqk5Ok/p8r5WA6Q33GMqt9zeI/TaSzJ1rTMyEaGL5a8jFsdUgRbD/q9/7sFLRm/UBu4dhilVr1S5mDhZqKTTItzMNyNmI60z/o6m4/vwo2ur/cSPepup0mZQnfKmaoupog1Mx5RCHDrK6eRMRseQT77Ul8Ur5OOzHkNnywbybajsccSsj/9TycRo3zc1WupbYRvoZVSkouQ=----ATTACHMENT:----MTY5MTc3MTIwOTM4NTc0MyA3OTc5MzA3NzE3NTUxMTY1IDUzOTM4NDgzODIxODM3Njg=