hook_verify_update_archive

function hook_verify_update_archive

hook_verify_update_archive($project, $archive_file, $directory)

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

File

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

Code

function hook_verify_update_archive($project, $archive_file, $directory) {
  $errors = array();
  if (!file_exists($directory)) {
    $errors[] = t('The %directory does not exist.', array('%directory' => $directory));
  }
  // Add other checks on the archive integrity here.
  return $errors;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!update!update.api.php/function/hook_verify_update_archive/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部