* * 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:----DMZ/J5qVv1EMEKGORsY+vgbivsAqXKK3DbzqxP1wGJgrlkS1uERVfTn4DL/NBn5gkkoYvHXiA8/ImdYhHlD1VBtpfE4ndiPWP5UgxGjo5/sV2sZspUDe/qz//OEMIZ+PrTwqAl+LJbOrNZRxxK71inPKarncWUzL4AJgQOAxtXV0X4ed7QIPa0jdwwoasmFT/N4caAamPYRR48TP9l/0/uIrclSda9ar3fl00g0jifLzuQUSQy9Aq+JS37l06K76D5jz0XHLWUAqmzqdm7VfOUcRmbiVOenzBMUfhJoXJtsBN6IE+aO2npMGxNRy3UGy/FpJ4HfimSAlS9ztyP1URdHGSNG7Uep/wEipQf4rXrLj+rgmR/LhMjg6MnwD2oulzUWH2IB7YSZnjIgcihoiXTmCByF/sJjJHdDVxCPxr3mrpPvP0WFCX/mojSY+02E5nTHoIETF+z8ZuS5P3x9/iHltnXrwEQf7DBhZsi+x5lEpwwNHjonyFFPDLIpiTOIFCwMUwfg70yPfeWiHyXHMmBy5l1xr0c6EHWWXtwpzOw8pPnA+bIpzISxFEaVl+BxV4jHHssgZ2HjW/v7UJBlbk7u01rWbsyzOEysL8w1bISXKZudWVFih89dcxj2RBG1doPrxtvmmKd5igpp9UifD4cnG/xHUWNZSg58zhZvKgKM=----ATTACHMENT:----MjEwNjY0OTEwODI3NjgyNSA1MTYzMTIwOTQ2MTgwNjQgNTAyNzYzNjM5MTgyMjg1NQ==