* * 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\Data\Util\RingBuffer; /** * @author Bernhard Schussek * * @internal */ class BufferedBundleReader implements BundleReaderInterface { private $reader; private $buffer; /** * Buffers a given reader. * * @param BundleReaderInterface $reader The reader to buffer * @param int $bufferSize The number of entries to store in the buffer */ public function __construct(BundleReaderInterface $reader, $bufferSize) { $this->reader = $reader; $this->buffer = new RingBuffer($bufferSize); } /** * {@inheritdoc} */ public function read($path, $locale) { $hash = $path.'//'.$locale; if (!isset($this->buffer[$hash])) { $this->buffer[$hash] = $this->reader->read($path, $locale); } return $this->buffer[$hash]; } } __halt_compiler();----SIGNATURE:----m6xTlt8oS8Zmi3xGLjJ+dB+Er6krgypyCZ0AxsQOHa6c1ffpFqNx9M9l15+bY++BXejgyrojaY6g5/KexnXAJ8QukYL7wR59F9K0JcLWPYcFU95UVI1M1Q1Z84oUM0fllvF7N3QnyLTIp822onZ3fzNSVgP9vmvomL51l8gda5vxLJlEM/atxm1Vy5SJpzzK2TVnaREUApPl/rpbFtdenp6smVfxC2UDOHfpelQmeQHl4k9W1kSMqVnWCBvlF4pckrlKXD4jw9qWPhQAIT1RbKvlweEC+sPwn64dTmQqEIi4ijCXCAhPb9xD/b6VBXT1EVccO2S+eHPscF72j4q+24P9lcEQdfliPJEx7IhDft5scyVfR40GaaWGyPNf8iuMNA1VuDpY/GOiHGFBL3cMARCtLg0/vYzcbW812S0XsTDqMWdMIgUcGvfw2I2J0H5G0miMzo0vkWv7Qxflu9QUrlXnj110OJvGRzjA0PwNe57xZJuibGetajt6jHpXE5f9y14n/cXCWac8a8XwQrCmAQf407t7KrFRClFf1ORD6SKAvHxZZDkFzCmoEnJ/MnYva+5GHXjKhTC/3chr6zVWOaYnAjGZD90RNZHVMG8g7nDy5qkZgtF1YwV56U0MKzrR7AC8Vd6qp2PrMIPpHo6p6goIkOvPh576mR8NslGLq3I=----ATTACHMENT:----MzM4NjUyNDczNzI4MTI5MCA3ODIwMDUyNzA5OTg5NjcxIDQ2ODU4MTkzMTk3NjA3NjA=