/** * Writes a package or profile's files to an archive. * * @param array &$return * The return value, passed by reference. * @param \Drupal\features\Package $package * The package or profile. * @param ArchiveTar $archiver * The archiver. */ 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); } }
/** * Writes a package or profile's files to the file system. * * @param array &$return * The return value, passed by reference. * @param \Drupal\features\Package $package * The package or profile. */ protected function generatePackage(array &$return, Package $package) { if (!$package->getFiles()) { $this->failure($return, $package, NULL, t('No configuration was selected to be exported.')); return; } $success = TRUE; foreach ($package->getFiles() as $file) { try { $this->generateFile($package->getDirectory(), $file); } catch (\Exception $exception) { $this->failure($return, $package, $exception); $success = FALSE; break; } } if ($success) { $this->success($return, $package); } }