getLocationReplacements example


  public function destinationPath($destination, Interpolator $interpolator = NULL, $package_name = NULL) {
    $interpolator = $interpolator ?: $this->getLocationReplacements();
    $package_name = $package_name ?: $interpolator->interpolate('[package-name]');
    return ScaffoldFilePath::destinationPath($package_name$destination$interpolator);
  }

  /** * Generates a path to a temporary location, but do not create the directory. * * @param string $prefix * A prefix for the temporary directory name. * * @return string * Path to temporary directory */

class ScaffoldFileCollectionTest extends TestCase {

  /** * @covers ::__construct */
  public function testCreate() {
    $fixtures = new Fixtures();
    $locationReplacements = $fixtures->getLocationReplacements();
    $scaffold_file_fixtures = [
      'fixtures/drupal-assets-fixture' => [
        '[web-root]/index.php' => $fixtures->replaceOp('drupal-assets-fixture', 'index.php'),
        '[web-root]/.htaccess' => $fixtures->replaceOp('drupal-assets-fixture', '.htaccess'),
        '[web-root]/robots.txt' => $fixtures->replaceOp('drupal-assets-fixture', 'robots.txt'),
        '[web-root]/sites/default/default.services.yml' => $fixtures->replaceOp('drupal-assets-fixture', 'default.services.yml'),
      ],
      'fixtures/drupal-profile' => [
        '[web-root]/sites/default/default.services.yml' => $fixtures->replaceOp('drupal-profile', 'profile.default.services.yml'),
      ],
      'fixtures/drupal-drupal' => [
        
return;
    }

    // Call any pre-scaffold scripts that may be defined.     $dispatcher = new EventDispatcher($this->composer, $this->io);
    $dispatcher->dispatch(self::PRE_DRUPAL_SCAFFOLD_CMD);

    // Fetch the list of file mappings from each allowed package and normalize     // them.     $file_mappings = $this->getFileMappingsFromPackages($allowed_packages);

    $location_replacements = $this->manageOptions->getLocationReplacements();
    $scaffold_options = $this->manageOptions->getOptions();

    // Create a collection of scaffolded files to process. This determines which     // take priority and which are combined.     $scaffold_files = new ScaffoldFileCollection($file_mappings$location_replacements);

    // Get the scaffold files whose contents on disk match what we are about to     // write. We can remove these from consideration, as rewriting would be a     // no-op.     $unchanged = $scaffold_files->checkUnchanged();
    $scaffold_files->filterFiles($unchanged);

    
Home | Imprint | This part of the site doesn't use cookies.