/** * 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); }
/** * @dataProvider getNestedFilesDataProvider * @param string $pattern * @param array $expectedKeys */ public function testSearchKeys($pattern, $expectedKeys) { $this->assertEquals($expectedKeys, $this->_adapter->searchKeys($pattern)); }