本文整理汇总了PHP中Illuminate\Console\Command::getOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::getOutput方法的具体用法?PHP Command::getOutput怎么用?PHP Command::getOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Console\Command
的用法示例。
在下文中一共展示了Command::getOutput方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: call
/**
*
*
* @param string $class
* @return void
*/
public function call($class)
{
$this->resolve($class)->run();
if (isset($this->command)) {
$this->command->getOutput()->writeln("<info>Gencrud:</info> {$class}");
}
}
示例2: call
/**
* Seed the given connection from the given path.
*
* @param string $class
* @return void
*/
public function call($class)
{
$this->resolve($class)->__invoke();
if (isset($this->command)) {
$this->command->getOutput()->writeln("<info>Seeded:</info> {$class}");
}
}
示例3: seed
/**
* Seed the fixtures.
*/
public function seed($table)
{
$data = $this->yamlLoader->loadYmlData($table);
if ($this->command) {
$this->command->getOutput()->writeln("<info>Seeded Fixture:</info> {$table}");
}
$this->process($data['settings'], $data['items']);
}
示例4: progressIterator
/**
* Print progress on an iterator
*
* @param array $items
* @param callable $closure
*/
public function progressIterator($items, callable $closure)
{
// Normal loop if no output
if (!$this->command or sizeof($items) == 1) {
foreach ($items as $value) {
$closure($value);
}
return;
}
$output = $this->command->getOutput();
$iterations = sizeof($items);
// Create Progress helper
if (class_exists('Symfony\\Component\\Console\\Helper\\ProgressBar')) {
$progress = new \Symfony\Component\Console\Helper\ProgressBar($output, $iterations);
$progress->start();
} else {
$progress = $this->command->getHelper('progress');
$progress->start($output, $iterations);
}
// Loop over items
foreach ($items as $value) {
$progress->advance();
$closure($value, $progress);
}
$progress->finish();
}
示例5: call
/**
* Seed the given connection from the given path.
*
* @param string $class
* @return void
*/
public function call($class)
{
$this->resolve($class)->run();
$this->command->getOutput()->writeln("<info>Seeded:</info> {$class}");
}
示例6: done
/**
* Write a done message to the output.
*
* @param \Illuminate\Console\Command $command
* @return void
*/
protected function done(Command $command)
{
$command->getOutput()->writeln('<info>Done!</info>');
}