protected function FeaturesGenerationArchive::success in Features 8.4
Same name and namespace in other branches
- 8.3 src/Plugin/FeaturesGeneration/FeaturesGenerationArchive.php \Drupal\features\Plugin\FeaturesGeneration\FeaturesGenerationArchive::success()
Registers a successful package or profile archive operation.
Parameters
array &$return: The return value, passed by reference.
\Drupal\features\Package $package: The package or profile.
1 call to FeaturesGenerationArchive::success()
- FeaturesGenerationArchive::generatePackage in src/
Plugin/ FeaturesGeneration/ FeaturesGenerationArchive.php - Writes a package or profile's files to an archive.
File
- src/
Plugin/ FeaturesGeneration/ FeaturesGenerationArchive.php, line 226
Class
- FeaturesGenerationArchive
- Class for generating a compressed archive of packages.
Namespace
Drupal\features\Plugin\FeaturesGenerationCode
protected function success(array &$return, Package $package) {
$type = $package
->getType() == 'module' ? $this
->t('Package') : $this
->t('Profile');
$return[] = [
'success' => TRUE,
// Archive writing doesn't merit a message, and if done through the UI
// would appear on the subsequent page load.
'display' => FALSE,
'message' => '@type @package written to archive.',
'variables' => [
'@type' => $type,
'@package' => $package
->getName(),
],
];
}