本文整理匯總了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>');
}