You are here

public function ModifiedFiles::getModifiedFiles in Automatic Updates 8

Get list of modified files.

Parameters

array $extensions: The list of extensions, keyed by extension name with values an info array.

Return value

\Iterator The modified files.

Overrides ModifiedFilesInterface::getModifiedFiles

File

src/Services/ModifiedFiles.php, line 68

Class

ModifiedFiles
Modified files service.

Namespace

Drupal\automatic_updates\Services

Code

public function getModifiedFiles(array $extensions = []) {
  $modified_files = new \ArrayIterator();

  /** @var \GuzzleHttp\Promise\PromiseInterface[] $promises */
  $promises = $this
    ->getHashRequests($extensions);

  // Wait until all the requests are finished.
  (new EachPromise($promises, [
    'concurrency' => 4,
    'fulfilled' => function (array $resource) use ($modified_files) {
      $this
        ->processHashes($resource, $modified_files);
    },
    'rejected' => function (RequestException $exception) {
      $this
        ->processFailures($exception);
    },
  ]))
    ->promise()
    ->wait();
  return $modified_files;
}