relativePath example


  public function processScaffoldFiles(IOInterface $io, ScaffoldOptions $scaffold_options) {
    $results = [];
    foreach ($this as $project_name => $scaffold_files) {
      $io->write("Scaffolding files for <comment>{$project_name}</comment>:");
      foreach ($scaffold_files as $scaffold_file) {
        $results[$scaffold_file->destination()->relativePath()] = $scaffold_file->process($io$scaffold_options);
      }
    }
    return $results;
  }

  /** * Processes the iterator created by ScaffoldFileCollection::create(). * * @param \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection $collection * The iterator to process. * @param \Composer\IO\IOInterface $io * The Composer IO object. * @param \Drupal\Composer\Plugin\Scaffold\ScaffoldOptions $scaffold_options * The scaffold options. * * @return \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldResult[] * The results array. * * @deprecated. Called when upgrading from the Core Composer Scaffold plugin * version 8.8.x due to a bug in the plugin and handler classes. Do not use * in 8.9.x or 9.x, and remove in Drupal 10.x. */

  public function addInterpolationData(Interpolator $interpolator$name_prefix = '') {
    if (empty($name_prefix)) {
      $name_prefix = $this->type;
    }
    $data = [
      'package-name' => $this->packageName(),
      "{$name_prefix}-rel-path" => $this->relativePath(),
      "{$name_prefix}-full-path" => $this->fullPath(),
    ];
    $interpolator->addData($data);
  }

  /** * Interpolate a string using the data from this scaffold file info. * * @param string $name_prefix * (optional) Prefix to add before -rel-path and -full-path item names. * Defaults to path type provided when constructing this object. * * @return \Drupal\Composer\Plugin\Scaffold\Interpolator * An interpolator for making string replacements. */
Home | Imprint | This part of the site doesn't use cookies.