Esempio n. 1
0
 public function testGetFileSize()
 {
     $filePath = $this->_getFixturesPath() . 'filesize.txt';
     $this->_deleteFiles[] = $filePath;
     $this->_adapter->write($filePath, '1234');
     $this->assertFileExists($filePath);
     $this->assertEquals(4, $this->_adapter->getFileSize($filePath));
 }
Esempio n. 2
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);
 }