mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
可以允许自定义Output的driver,以适应命令行模式下调用其它命令行指令
这样在命令行下,调用别的命令行,可以直接一行一行地输出日志,而不用等到buffer完,才输出
This commit is contained in:
@@ -88,18 +88,19 @@ class Console
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $command
|
* @param $command
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
|
* @param string $driver
|
||||||
* @return Output|Buffer
|
* @return Output|Buffer
|
||||||
*/
|
*/
|
||||||
public static function call($command, array $parameters = [])
|
public static function call($command, array $parameters = [], $driver = 'buffer')
|
||||||
{
|
{
|
||||||
$console = self::init(false);
|
$console = self::init(false);
|
||||||
|
|
||||||
array_unshift($parameters, $command);
|
array_unshift($parameters, $command);
|
||||||
|
|
||||||
$input = new Input($parameters);
|
$input = new Input($parameters);
|
||||||
$output = new Output('buffer');
|
$output = new Output($driver);
|
||||||
|
|
||||||
$console->setCatchExceptions(false);
|
$console->setCatchExceptions(false);
|
||||||
$console->find($command)->run($input, $output);
|
$console->find($command)->run($input, $output);
|
||||||
|
|||||||
Reference in New Issue
Block a user