Example #1
0
 /**
  *
  *
  * @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}");
     }
 }
Example #2
0
 /**
  * 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}");
     }
 }
Example #3
0
 /**
  * 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']);
 }
Example #4
0
 /**
  * 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();
 }
Example #5
0
 /**
  * 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}");
 }
 /**
  * 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>');
 }