コード例 #1
0
ファイル: Local.php プロジェクト: nervo/Gaufrette
 /**
  * {@inheritDoc}
  */
 public function checksum($key)
 {
     return Checksum::fromFile($this->computePath($key));
 }
コード例 #2
0
ファイル: InMemory.php プロジェクト: ruudk/Gaufrette
 /**
  * {@inheritDoc}
  */
 public function write($key, $content)
 {
     $this->files[$key]['content'] = $content;
     $this->files[$key]['mtime'] = time();
     $this->files[$key]['checksum'] = Checksum::fromContent($content);
 }
コード例 #3
0
ファイル: InMemoryTest.php プロジェクト: ruudk/Gaufrette
 public function testChecksumIsUpdatedOnWrite()
 {
     $adapter = new InMemory(array('foobar' => array('content' => 'Some content', 'checksum' => 'abcd')));
     $adapter->write('foobar', 'Changed content');
     $this->assertEquals(Checksum::fromContent('Changed content'), $adapter->checksum('foobar'));
 }
コード例 #4
0
ファイル: Zip.php プロジェクト: nervo/Gaufrette
 /**
  * Returns the checksum of the file
  *
  * @param  string $key
  *
  * @return string
  */
 public function checksum($key)
 {
     return Checksum::fromContent($this->read($key));
 }