Example #1
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // Check if the input file exists
     $filename = base_path() . '/' . $this->argument('filename');
     if (!file_exists($filename)) {
         $this->error("The input filename you specified doesn't exist: {$filename}");
     }
     // If the file exists, get it contents and parse it
     try {
         $parsed = $this->parser->parse(file_get_contents($filename));
     } catch (ParseError $e) {
         $this->error($e->getMessage());
         die;
     }
     // Now, run the desired function of the subclass
     $this->runCommand($parsed);
 }
 public static function getParsedOutput($input)
 {
     $p = new Parser(new FieldParser(), new ModelDefinitionParser(), new ModelList(), new MigrationList());
     return $p->parse($input);
 }