예제 #1
0
 /**
  * Write compressed file.
  *
  * @param string $key
  * @param string $content
  * @return bool
  */
 public function write($key, $content)
 {
     $compress = $this->_isCompressionAvailable();
     if ($compress) {
         $rawContent = gzcompress($content, $this->_compressRatio);
     } else {
         $rawContent = $content;
     }
     $fileHeaders = pack("ll", (int) $compress, strlen($rawContent));
     return parent::write($key, $fileHeaders . $rawContent);
 }
예제 #2
0
 /**
  * @dataProvider getNestedFilesDataProvider
  * @param string $pattern
  * @param array $expectedKeys
  */
 public function testSearchKeys($pattern, $expectedKeys)
 {
     $this->assertEquals($expectedKeys, $this->_adapter->searchKeys($pattern));
 }