function ArchiverManager::getExtensions
Same name in other branches
- 9 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()
- 11.x 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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.