public function update() { if (!$this->toFile->hasWriteAccess() || !$this->fromFile->hasReadAccess()) { return; } $newContent = $this->getUpdatedTrackerFileContent(); if ($newContent !== $this->getCurrentTrackerFileContent()) { $this->toFile->save($newContent); } }
public function update() { if (!$this->toFile->hasWriteAccess() || !$this->fromFile->hasReadAccess()) { return; } $trackingCode = new PiwikJsManipulator($this->fromFile->getContent(), $this->trackerFiles); $newContent = $trackingCode->manipulateContent(); if ($newContent !== $this->toFile->getContent()) { $this->toFile->save($newContent); } }