Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
<?php
|
|
|
|
|
2019-08-22 02:45:53 +00:00
|
|
|
namespace Drupal\Composer\Plugin\Scaffold\Operations;
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
|
|
|
|
use Composer\IO\IOInterface;
|
2019-08-22 02:45:53 +00:00
|
|
|
use Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath;
|
|
|
|
use Drupal\Composer\Plugin\Scaffold\ScaffoldOptions;
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Scaffold operation to skip a scaffold file (do nothing).
|
2020-02-21 09:34:07 +00:00
|
|
|
*
|
|
|
|
* @internal
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
*/
|
2019-10-09 02:55:24 +00:00
|
|
|
class SkipOp extends AbstractOperation {
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Identifies Skip operations.
|
|
|
|
*/
|
|
|
|
const ID = 'skip';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The message to output while processing.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $message;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SkipOp constructor.
|
|
|
|
*
|
|
|
|
* @param string $message
|
|
|
|
* (optional) A custom message to output while skipping.
|
|
|
|
*/
|
|
|
|
public function __construct($message = " - Skip <info>[dest-rel-path]</info>: disabled") {
|
|
|
|
$this->message = $message;
|
|
|
|
}
|
|
|
|
|
2020-05-03 10:42:30 +00:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function generateContents() {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function process(ScaffoldFilePath $destination, IOInterface $io, ScaffoldOptions $options) {
|
|
|
|
$interpolator = $destination->getInterpolator();
|
|
|
|
$io->write($interpolator->interpolate($this->message));
|
|
|
|
return new ScaffoldResult($destination, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|