protected function FeaturesGenerationArchive::generatePackage in Features 8.4
Same name and namespace in other branches
- 8.3 src/Plugin/FeaturesGeneration/FeaturesGenerationArchive.php \Drupal\features\Plugin\FeaturesGeneration\FeaturesGenerationArchive::generatePackage()
Writes a package or profile's files to an archive.
Parameters
array &$return: The return value, passed by reference.
\Drupal\features\Package $package: The package or profile.
\Drupal\Core\Archiver\ArchiveTar $archiver: The archiver.
1 call to FeaturesGenerationArchive::generatePackage()
- FeaturesGenerationArchive::generate in src/
Plugin/ FeaturesGeneration/ FeaturesGenerationArchive.php - Performs package generation.
File
- src/
Plugin/ FeaturesGeneration/ FeaturesGenerationArchive.php, line 201
Class
- FeaturesGenerationArchive
- Class for generating a compressed archive of packages.
Namespace
Drupal\features\Plugin\FeaturesGenerationCode
protected function generatePackage(array &$return, Package $package, ArchiveTar $archiver) {
$success = TRUE;
foreach ($package
->getFiles() as $file) {
try {
$this
->generateFile($package
->getDirectory(), $file, $archiver);
} catch (\Exception $exception) {
$this
->failure($return, $package, $exception);
$success = FALSE;
break;
}
}
if ($success) {
$this
->success($return, $package);
}
}