Initial Drupal 11 with DDEV setup
This commit is contained in:
97
vendor/consolidation/robo/src/Task/Bower/Base.php
vendored
Normal file
97
vendor/consolidation/robo/src/Task/Bower/Base.php
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Robo\Task\Bower;
|
||||
|
||||
use Robo\Task\BaseTask;
|
||||
use Robo\Exception\TaskException;
|
||||
use Robo\Common\ExecOneCommand;
|
||||
|
||||
abstract class Base extends BaseTask
|
||||
{
|
||||
use ExecOneCommand;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $opts = [];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $action = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $command = '';
|
||||
|
||||
/**
|
||||
* adds `allow-root` option to bower
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function allowRoot()
|
||||
{
|
||||
$this->option('allow-root');
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* adds `force-latest` option to bower
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function forceLatest()
|
||||
{
|
||||
$this->option('force-latest');
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* adds `production` option to bower
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function noDev()
|
||||
{
|
||||
$this->option('production');
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* adds `offline` option to bower
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function offline()
|
||||
{
|
||||
$this->option('offline');
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base constructor.
|
||||
*
|
||||
* @param null|string $pathToBower
|
||||
*
|
||||
* @throws \Robo\Exception\TaskException
|
||||
*/
|
||||
public function __construct($pathToBower = null)
|
||||
{
|
||||
$this->command = $pathToBower;
|
||||
if (!$this->command) {
|
||||
$this->command = $this->findExecutable('bower');
|
||||
}
|
||||
if (!$this->command) {
|
||||
throw new TaskException(__CLASS__, "Bower executable not found.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCommand()
|
||||
{
|
||||
return "{$this->command} {$this->action}{$this->arguments}";
|
||||
}
|
||||
}
|
||||
37
vendor/consolidation/robo/src/Task/Bower/Install.php
vendored
Normal file
37
vendor/consolidation/robo/src/Task/Bower/Install.php
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Robo\Task\Bower;
|
||||
|
||||
use Robo\Contract\CommandInterface;
|
||||
|
||||
/**
|
||||
* Bower Install
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* // simple execution
|
||||
* $this->taskBowerInstall()->run();
|
||||
*
|
||||
* // prefer dist with custom path
|
||||
* $this->taskBowerInstall('path/to/my/bower')
|
||||
* ->noDev()
|
||||
* ->run();
|
||||
* ?>
|
||||
* ```
|
||||
*/
|
||||
class Install extends Base implements CommandInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $action = 'install';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->printTaskInfo('Install Bower packages: {arguments}', ['arguments' => $this->arguments]);
|
||||
return $this->executeCommand($this->getCommand());
|
||||
}
|
||||
}
|
||||
26
vendor/consolidation/robo/src/Task/Bower/Tasks.php
vendored
Normal file
26
vendor/consolidation/robo/src/Task/Bower/Tasks.php
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Robo\Task\Bower;
|
||||
|
||||
trait Tasks
|
||||
{
|
||||
/**
|
||||
* @param null|string $pathToBower
|
||||
*
|
||||
* @return \Robo\Task\Bower\Install|\Robo\Collection\CollectionBuilder
|
||||
*/
|
||||
protected function taskBowerInstall($pathToBower = null)
|
||||
{
|
||||
return $this->task(Install::class, $pathToBower);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|string $pathToBower
|
||||
*
|
||||
* @return \Robo\Task\Bower\Update|\Robo\Collection\CollectionBuilder
|
||||
*/
|
||||
protected function taskBowerUpdate($pathToBower = null)
|
||||
{
|
||||
return $this->task(Update::class, $pathToBower);
|
||||
}
|
||||
}
|
||||
35
vendor/consolidation/robo/src/Task/Bower/Update.php
vendored
Normal file
35
vendor/consolidation/robo/src/Task/Bower/Update.php
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Robo\Task\Bower;
|
||||
|
||||
/**
|
||||
* Bower Update
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* // simple execution
|
||||
* $this->taskBowerUpdate->run();
|
||||
*
|
||||
* // prefer dist with custom path
|
||||
* $this->taskBowerUpdate('path/to/my/bower')
|
||||
* ->noDev()
|
||||
* ->run();
|
||||
* ?>
|
||||
* ```
|
||||
*/
|
||||
class Update extends Base
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $action = 'update';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->printTaskInfo('Update Bower packages: {arguments}', ['arguments' => $this->arguments]);
|
||||
return $this->executeCommand($this->getCommand());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user