hook_archiver_info

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 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

hook_archiver_info_alter()

Related topics

Code

modules/system/system.api.php, line 3760

<?php
function hook_archiver_info() {
  return array(
    'tar' => array(
      'class' => 'ArchiverTar', 
      'extensions' => array('tar', 'tar.gz', 'tar.bz2'),
    ),
  );
}
?>