Beispiel #1
0
 /**
  * Job constructor.
  *
  * @param Console $console Console
  */
 public function __construct(Console $console)
 {
     static $kite, $composer;
     $this->console = $console;
     $this->offsetSet('job', $this);
     $this->offsetSet('config', $console->getConfig());
     if (!$kite) {
         $kite = array('path' => $path = dirname(__DIR__), 'dir' => $console->getFilesystem()->findShortestPath(getcwd(), $path));
     }
     $this->offsetSet('kite', $kite);
     parent::__construct($this);
     if (!$composer) {
         $composer = $this->factory->createTask('Netresearch\\Kite\\Service\\Composer', $this);
     }
     $this->offsetSet('composer', $composer);
 }
Beispiel #2
0
 /**
  * Create a job
  *
  * @param string $job The job name
  *
  * @return Job
  */
 public function createJob($job)
 {
     $jobInstance = new Job($this->console);
     return $jobInstance->setFromArray($this->console->getConfig()->getJobConfiguration($job));
 }