Exemple #1
0
 public function unwatch(TrackedObject $tracked)
 {
     if ($tracked->getResource()->isExists()) {
         return;
     }
     @inotify_rm_watch($this->inotify, $tracked->getID());
     unset($this->inotifyMap[$tracked->getID()]);
     return parent::unwatch($tracked);
 }
Exemple #2
0
 /**
  * Create new TrackedObject
  *
  * @param   ResourceInterface   $resource
  * @return  TrackedObject
  */
 public function createTrackedObject(ResourceInterface $resource)
 {
     $tracked = new TrackedObject();
     $tracked->setResource($resource);
     $tracked->setChecksum($resource->getChecksum());
     if (is_null($tracked->getID())) {
         $tracked->setID(PathUtil::createPathID($resource->getResource()));
     }
     return $tracked;
 }
Exemple #3
0
 public function unwatch(TrackedObject $tracked)
 {
     $this->log('Unwatch tracked object', array('path' => realpath($tracked->getResource()), LogLevel::DEBUG));
 }
Exemple #4
0
 function its_checkPath_should_track_on_filesystem_delete_event(AdapterInterface $adapter, FileResource $resource, TrackedObject $tracked)
 {
     $tracked->getResource()->shouldBeCalled()->willReturn($resource);
     $tracked->getChecksum()->shouldBeCalled()->willReturn('checksum');
     $resource->isExists()->shouldBeCalled()->willReturn(false);
     $resource->getChecksum()->willReturn('new_checksum')->shouldBeCalled();
     $resource->getResource()->willReturn($this->testFile);
     $adapter->unwatch($tracked)->shouldBeCalled();
     $this->checkPath($this->testFile);
     $this->getChangeSet()->shouldHaveCount(1);
 }