Add pear modules, mail and net_smtp via composer (#93)

Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
Thilina Hasantha
2018-01-08 23:13:43 +01:00
committed by GitHub
parent 359e3f8382
commit e7792e7d79
2349 changed files with 117270 additions and 83170 deletions

View File

@@ -3,8 +3,13 @@ namespace Robo;
use League\Container\Container;
use League\Container\ContainerInterface;
use Robo\Common\ProcessExecutor;
use Consolidation\Config\ConfigInterface;
use Consolidation\Config\Loader\ConfigProcessor;
use Consolidation\Config\Loader\YamlConfigLoader;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Process\Process;
/**
* Manages the container reference and other static data. Favor
@@ -14,7 +19,7 @@ use Symfony\Component\Console\Application as SymfonyApplication;
class Robo
{
const APPLICATION_NAME = 'Robo';
const VERSION = '1.0.4';
const VERSION = '1.2.1';
/**
* The currently active container object, or NULL if not initialized yet.
@@ -34,9 +39,10 @@ class Robo
*
* @return int
*/
public static function run($argv, $commandClasses, $appName = null, $appVersion = null, $output = null)
public static function run($argv, $commandClasses, $appName = null, $appVersion = null, $output = null, $repository = null)
{
$runner = new \Robo\Runner($commandClasses);
$runner->setSelfUpdateRepository($repository);
$statusCode = $runner->execute($argv, $appName, $appVersion, $output);
return $statusCode;
}
@@ -85,6 +91,33 @@ class Robo
return static::$container !== null;
}
/**
* Create a config object and load it from the provided paths.
*/
public static function createConfiguration($paths)
{
$config = new \Robo\Config\Config();
static::loadConfiguration($paths, $config);
return $config;
}
/**
* Use a simple config loader to load configuration values from specified paths
*/
public static function loadConfiguration($paths, $config = null)
{
if ($config == null) {
$config = static::config();
}
$loader = new YamlConfigLoader();
$processor = new ConfigProcessor();
$processor->add($config->export());
foreach ($paths as $path) {
$processor->extend($loader->load($path));
}
$config->import($processor->export());
}
/**
* Create a container and initiailze it. If you wish to *change*
* anything defined in the container, then you should call
@@ -93,7 +126,7 @@ class Robo
* @param null|\Symfony\Component\Console\Input\InputInterface $input
* @param null|\Symfony\Component\Console\Output\OutputInterface $output
* @param null|\Robo\Application $app
* @param null|\Robo\Config $config
* @param null|ConfigInterface $config
*
* @return \League\Container\Container|\League\Container\ContainerInterface
*/
@@ -109,7 +142,7 @@ class Robo
}
if (!$config) {
$config = new Config();
$config = new \Robo\Config\Config();
}
// Set up our dependency injection container.
@@ -139,11 +172,11 @@ class Robo
*
* @param \League\Container\ContainerInterface $container
* @param \Symfony\Component\Console\Application $app
* @param \Robo\Config $config
* @param ConfigInterface $config
* @param null|\Symfony\Component\Console\Input\InputInterface $input
* @param null|\Symfony\Component\Console\Output\OutputInterface $output
*/
public static function configureContainer(ContainerInterface $container, SymfonyApplication $app, Config $config, $input = null, $output = null)
public static function configureContainer(ContainerInterface $container, SymfonyApplication $app, ConfigInterface $config, $input = null, $output = null)
{
// Self-referential container refernce for the inflector
$container->add('container', $container);
@@ -156,12 +189,14 @@ class Robo
if (!$output) {
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
}
$config->setDecorated($output->isDecorated());
$config->set(Config::DECORATED, $output->isDecorated());
$config->set(Config::INTERACTIVE, $input->isInteractive());
$container->share('application', $app);
$container->share('config', $config);
$container->share('input', $input);
$container->share('output', $output);
$container->share('outputAdapter', \Robo\Common\OutputAdapter::class);
// Register logging and related services.
$container->share('logStyler', \Robo\Log\RoboLogStyle::class);
@@ -175,22 +210,30 @@ class Robo
->withArgument('output');
$container->share('resultPrinter', \Robo\Log\ResultPrinter::class);
$container->add('simulator', \Robo\Task\Simulator::class);
$container->share('globalOptionsEventListener', \Robo\GlobalOptionsEventListener::class);
$container->share('globalOptionsEventListener', \Robo\GlobalOptionsEventListener::class)
->withMethodCall('setApplication', ['application']);
$container->share('injectConfigEventListener', \Consolidation\Config\Inject\ConfigForCommand::class)
->withArgument('config')
->withMethodCall('setApplication', ['application']);
$container->share('collectionProcessHook', \Robo\Collection\CollectionProcessHook::class);
$container->share('hookManager', \Consolidation\AnnotatedCommand\Hooks\HookManager::class)
->withMethodCall('addResultProcessor', ['collectionProcessHook', '*']);
$container->share('alterOptionsCommandEvent', \Consolidation\AnnotatedCommand\Options\AlterOptionsCommandEvent::class)
->withArgument('application');
$container->share('hookManager', \Consolidation\AnnotatedCommand\Hooks\HookManager::class)
->withMethodCall('addCommandEvent', ['alterOptionsCommandEvent'])
->withMethodCall('addCommandEvent', ['injectConfigEventListener'])
->withMethodCall('addCommandEvent', ['globalOptionsEventListener'])
->withMethodCall('addResultProcessor', ['collectionProcessHook', '*']);
$container->share('eventDispatcher', \Symfony\Component\EventDispatcher\EventDispatcher::class)
->withMethodCall('addSubscriber', ['globalOptionsEventListener'])
->withMethodCall('addSubscriber', ['alterOptionsCommandEvent'])
->withMethodCall('addSubscriber', ['hookManager']);
$container->share('formatterManager', \Consolidation\OutputFormatters\FormatterManager::class)
->withMethodCall('addDefaultFormatters', [])
->withMethodCall('addDefaultSimplifiers', []);
$container->share('prepareTerminalWidthOption', \Consolidation\AnnotatedCommand\Options\PrepareTerminalWidthOption::class)
->withMethodCall('setApplication', ['application']);
$container->share('commandProcessor', \Consolidation\AnnotatedCommand\CommandProcessor::class)
->withArgument('hookManager')
->withMethodCall('setFormatterManager', ['formatterManager'])
->withMethodCall('addPrepareFormatter', ['prepareTerminalWidthOption'])
->withMethodCall(
'setDisplayErrorFunction',
[
@@ -202,8 +245,13 @@ class Robo
);
$container->share('commandFactory', \Consolidation\AnnotatedCommand\AnnotatedCommandFactory::class)
->withMethodCall('setCommandProcessor', ['commandProcessor']);
// Deprecated: favor using collection builders to direct use of collections.
$container->add('collection', \Robo\Collection\Collection::class);
// Deprecated: use CollectionBuilder::create() instead -- or, better
// yet, BuilderAwareInterface::collectionBuilder() if available.
$container->add('collectionBuilder', \Robo\Collection\CollectionBuilder::class);
static::addInflectors($container);
// Make sure the application is appropriately initialized.
@@ -246,6 +294,10 @@ class Robo
->invokeMethod('setOutput', ['output']);
$container->inflector(\Robo\Contract\ProgressIndicatorAwareInterface::class)
->invokeMethod('setProgressIndicator', ['progressIndicator']);
$container->inflector(\Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface::class)
->invokeMethod('setHookManager', ['hookManager']);
$container->inflector(\Robo\Contract\VerbosityThresholdInterface::class)
->invokeMethod('setOutputAdapter', ['outputAdapter']);
}
/**
@@ -292,7 +344,7 @@ class Robo
}
/**
* @return \Robo\Config
* @return ConfigInterface
*/
public static function config()
{
@@ -334,4 +386,9 @@ class Robo
{
return static::service('input');
}
public static function process(Process $process)
{
return ProcessExecutor::create(static::getContainer(), $process);
}
}