public function ArchiverManager::getExtensions in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Archiver/ArchiverManager.php \Drupal\Core\Archiver\ArchiverManager::getExtensions()
- 10 core/lib/Drupal/Core/Archiver/ArchiverManager.php \Drupal\Core\Archiver\ArchiverManager::getExtensions()
Returns a string of supported archive extensions.
Return value
string A space-separated string of extensions suitable for use by the file validation system.
File
- core/
lib/ Drupal/ Core/ Archiver/ ArchiverManager.php, line 86
Class
- ArchiverManager
- Provides an Archiver plugin manager.
Namespace
Drupal\Core\ArchiverCode
public function getExtensions() {
$valid_extensions = [];
foreach ($this
->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);
}