You are here

function hook_verify_update_archive in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/update/update.api.php \hook_verify_update_archive()
  2. 7 modules/update/update.api.php \hook_verify_update_archive()
  3. 10 core/modules/update/update.api.php \hook_verify_update_archive()

Verify an archive after it has been downloaded and extracted.

Parameters

string $project: The short name of the project that has been downloaded.

string $archive_file: The filename of the unextracted archive.

string $directory: The directory that the archive was extracted into.

Return value

If there are any problems, return an array of error messages. If there are no problems, return an empty array.

See also

update_manager_archive_verify()

Related topics

1 function implements hook_verify_update_archive()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

update_verify_update_archive in core/modules/update/update.module
Implements hook_verify_update_archive().
2 invocations of hook_verify_update_archive()
UpdateManagerInstall::submitForm in core/modules/update/src/Form/UpdateManagerInstall.php
Form submission handler.
update_manager_archive_verify in core/modules/update/update.manager.inc
Verifies an archive after it has been downloaded and extracted.

File

core/modules/update/update.api.php, line 124
Hooks provided by the Update Manager module.

Code

function hook_verify_update_archive($project, $archive_file, $directory) {
  $errors = [];
  if (!file_exists($directory)) {
    $errors[] = t('The %directory does not exist.', [
      '%directory' => $directory,
    ]);
  }

  // Add other checks on the archive integrity here.
  return $errors;
}