示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getExportInfo(Package $package, FeaturesBundleInterface $bundle = NULL)
 {
     $full_name = isset($bundle) ? $bundle->getFullName($package->getMachineName()) : $package->getMachineName();
     $path = '';
     // Adjust export directory to be in profile.
     if (isset($bundle) && $bundle->isProfile()) {
         $path .= 'profiles/' . $bundle->getProfileName();
     }
     // If this is not the profile package, nest the directory.
     if (!isset($bundle) || !$bundle->isProfilePackage($package->getMachineName())) {
         $path .= empty($path) ? 'modules' : '/modules';
         $export_settings = $this->getExportSettings();
         if (!empty($export_settings['folder'])) {
             $path .= '/' . $export_settings['folder'];
         }
     }
     // Use the same path of a package to override it.
     if ($extension = $package->getExtension()) {
         $extension_path = $extension->getPath();
         $path = dirname($extension_path);
     }
     return array($full_name, $path);
 }