Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function checksum($key)
 {
     return Checksum::fromFile($this->computePath($key));
 }
Пример #2
0
 /**
  * {@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
 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
 /**
  * Returns the checksum of the file
  *
  * @param  string $key
  *
  * @return string
  */
 public function checksum($key)
 {
     return Checksum::fromContent($this->read($key));
 }