You are here

protected function InPlaceUpdate::getDeletions in Automatic Updates 8

Get an iterator of files to delete.

Return value

\ArrayIterator Iterator of files to delete.

2 calls to InPlaceUpdate::getDeletions()
InPlaceUpdate::backup in src/Services/InPlaceUpdate.php
Backup before an update.
InPlaceUpdate::processUpdate in src/Services/InPlaceUpdate.php
Process update.

File

src/Services/InPlaceUpdate.php, line 608

Class

InPlaceUpdate
Class to apply in-place updates.

Namespace

Drupal\automatic_updates\Services

Code

protected function getDeletions() {
  $deletions = [];
  if (!file_exists($this
    ->getTempDirectory() . self::DELETION_MANIFEST)) {
    return new \ArrayIterator($deletions);
  }
  $handle = fopen($this
    ->getTempDirectory() . self::DELETION_MANIFEST, 'r');
  if ($handle) {
    while (($deletion = fgets($handle)) !== FALSE) {
      if ($result = trim($deletion)) {
        $deletions[] = $result;
      }
    }
    fclose($handle);
  }
  return new \ArrayIterator($deletions);
}