mkTmpDir example

/** * Gets an Interpolator with 'web-root' and 'package-name' set. * * Use in place of ManageOptions::getLocationReplacements(). * * @return \Drupal\Composer\Plugin\Scaffold\Interpolator * An interpolator with location replacements, including 'web-root'. * * @see \Drupal\Composer\Plugin\Scaffold\ManageOptions::getLocationReplacements() */
  public function getLocationReplacements() {
    $destinationTmpDir = $this->mkTmpDir('location-replacements');
    $interpolator = new Interpolator();
    $interpolator->setData(['web-root' => $destinationTmpDir, 'package-name' => 'fixtures/tmp-destination']);
    return $interpolator;
  }

  /** * Creates a ReplaceOp fixture. * * @param string $project_name * The name of the project to fetch; $package_name is * "fixtures/$project_name". * @param string $source * The name of the asset; path is "assets/$source". * * @return \Drupal\Composer\Plugin\Scaffold\Operations\ReplaceOp * A replace operation object. */
Home | Imprint | This part of the site doesn't use cookies.