Piwik\Plugins\CustomPiwikJs\TrackerUpdater::update PHP Method

update() public method

public update ( )
    public function update()
    {
        if (!$this->toFile->hasWriteAccess() || !$this->fromFile->hasReadAccess()) {
            return;
        }
        $newContent = $this->getUpdatedTrackerFileContent();
        if ($newContent !== $this->getCurrentTrackerFileContent()) {
            $this->toFile->save($newContent);
        }
    }

Usage Example

Example #1
0
 public function updateTracker()
 {
     try {
         $trackerUpdater = new TrackerUpdater();
         $trackerUpdater->update();
     } catch (\Exception $e) {
         Log::error('There was an error while updating the javascript tracker: ' . $e->getMessage());
     }
 }
All Usage Examples Of Piwik\Plugins\CustomPiwikJs\TrackerUpdater::update