You are here

public function AcquiaPurgeStateStorageDisk::commit in Acquia Purge 7

Commit the state data to its persistent storage location.

Overrides AcquiaPurgeStateStorageInterface::commit

File

lib/state/AcquiaPurgeStateStorageDisk.php, line 47
Contains AcquiaPurgeStateStorageDisk.

Class

AcquiaPurgeStateStorageDisk
File backed state storage.

Code

public function commit() {
  if (!$this->commit) {
    return;
  }
  else {
    $this->commit = FALSE;
  }
  $raw_new = serialize($this->buffer);
  if ($raw_new !== $this->raw) {
    $this->raw = $raw_new;
    file_put_contents($this->uri, $this->raw);
  }
}