function archiver_get_extensions

Same name in other branches
  1. 8.9.x core/includes/common.inc \archiver_get_extensions()

Returns a string of supported archive extensions.

Return value

A space-separated string of extensions suitable for use by the file validation system.

3 calls to archiver_get_extensions()
UpdateTestUploadCase::testUploadModule in modules/update/update.test
Tests upload and extraction of a module.
update_manager_install_form in modules/update/update.manager.inc
Form constructor for the install form of the Update Manager module.
update_manager_install_form_submit in modules/update/update.manager.inc
Form submission handler for update_manager_install_form().

File

includes/common.inc, line 8548

Code

function archiver_get_extensions() {
    $valid_extensions = array();
    foreach (archiver_get_info() as $archive) {
        foreach ($archive['extensions'] as $extension) {
            foreach (explode('.', $extension) as $part) {
                if (!in_array($part, $valid_extensions)) {
                    $valid_extensions[] = $part;
                }
            }
        }
    }
    return implode(' ', $valid_extensions);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.