7.x system.api.php hook_archiver_info()

Declare archivers to the system.

An archiver is a class that is able to package and unpackage one or more files into a single possibly compressed file. Common examples of such files are zip files and tar.gz files. All archiver classes must implement ArchiverInterface.

Each entry should be keyed on a unique value, and specify three additional keys:

  • class: The name of the PHP class for this archiver.
  • extensions: An array of file extensions that this archiver supports.
  • weight: This optional key specifies the weight of this archiver. When mapping file extensions to archivers, the first archiver by weight found that supports the requested extension will be used.

See also


Related topics

2 functions implement hook_archiver_info()

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

system_archiver_info in modules/system/system.module
Implements hook_archiver_info().
update_test_archiver_info in modules/update/tests/update_test.module
Implements hook_archiver_info().
1 invocation of hook_archiver_info()
archiver_get_info in includes/common.inc
Retrieves a list of all available archivers.


modules/system/system.api.php, line 4088
Hooks provided by Drupal core and the System module.


function hook_archiver_info() {
  return array(
    'tar' => array(
      'class' => 'ArchiverTar',
      'extensions' => array(


hamidrezanateghi’s picture

Where exactly we might want to use that? There is a function in system.module that implements this hook and creates an archiver 'tar'. Where exactly is it in the system? How can I see that? How can I use that?