update_manager_archive_extract

Versions
mediamosa-21
update_manager_archive_extract($file, $directory)

Unpack a downloaded archive file.

throws Exception on failure.

Parameters

string $project The short name of the project to download.

string $file The filename of the archive you wish to extract.

string $directory The directory you wish to extract the archive into.

Return value

Archiver The Archiver object used to extract the archive.

Related topics

▾ 2 functions call update_manager_archive_extract()

update_manager_batch_project_get in modules/update/update.manager.inc
Batch operation: download, unpack, and verify a project.
update_manager_install_form_submit in modules/update/update.manager.inc
Handle form submission when installing new projects via the update manager.

Code

modules/update/update.manager.inc, line 659

<?php
function update_manager_archive_extract($file, $directory) {
  $archiver = archiver_get_archiver($file);
  if (!$archiver) {
    throw new Exception(t('Cannot extract %file, not a valid archive.', array ('%file' => $file)));
  }
  $archiver->extract($directory);
  return $archiver;
}
?>