Browse Source

added parsing of anonymous params

tags/2.0.0-beta
Tobias Munk 12 years ago
parent
commit
f53b217589
  1. 13
      extensions/composer/yii/composer/InstallHandler.php

13
extensions/composer/yii/composer/InstallHandler.php

@ -8,6 +8,7 @@
namespace yii\composer; namespace yii\composer;
use Composer\Script\CommandEvent; use Composer\Script\CommandEvent;
use yii\console;
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
@ -72,11 +73,13 @@ class InstallHandler
require($appPath . '/vendor/yiisoft/yii2/yii/Yii.php'); require($appPath . '/vendor/yiisoft/yii2/yii/Yii.php');
$config = require($appPath . '/config/console.php'); $config = require($appPath . '/config/console.php');
foreach((array)$options['run'] as $params){ foreach ((array)$options['run'] as $rawParams) {
$command = $params[0]; // TODO: we're doing about the same here like console\Request::resolve()
unset($params[0]); $command = $rawParams[0];
$params = array(); unset($rawParams[0]);
// TODO: add params to array $params[\yii\console\Request::ANONYMOUS_PARAMS] = $rawParams;
// TODO end
echo "Running command: {$command}\n"; echo "Running command: {$command}\n";
$application = new \yii\console\Application($config); $application = new \yii\console\Application($config);
$application->runAction($command, $params); $application->runAction($command, $params);

Loading…
Cancel
Save