archiver_get_extensions()
Returns a string of supported archive extensions.
A space-separated string of extensions suitable for use by the file validation system.
function archiver_get_extensions() { $valid_extensions = array(); foreach (\Drupal::service('plugin.manager.archiver')->getDefinitions() 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); }
© 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/core!includes!common.inc/function/archiver_get_extensions/8.1.x