<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\QuickRun\Crawl; use Illuminate\Console\Command; use ModStart\Core\Util\CodeUtil; use ModStart\Core\Util\FileUtil; class CrawlerRunnerCommand extends Command { protected $signature = 'crawler-runner {path}'; private $crawlers = array(); public function handle() { goto MIA1R; Zhb00: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto HnIUu; caDKs: $this->info('CrawlerRunner: Run Start'); goto ZdlrB; MIA1R: $REzBr = $this->argument('path'); goto HHtwy; D0TWE: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto Zhb00; HnIUu: foreach ($this->crawlers as $tF8fe) { $this->info('    > ' . get_class($tF8fe)); } goto caDKs; HHtwy: if (is_file($REzBr)) { goto O0ogA; RGCZ5: $this->crawlers[] = $zgLsz; goto M1efQ; UCZxv: $zgLsz = app($nD4z7); goto RGCZ5; O0ogA: $nD4z7 = CodeUtil::getFullClassNameForContent(file_get_contents($REzBr)); goto UCZxv; M1efQ: } else { $wgUQc = FileUtil::listFiles($REzBr, '*.php'); foreach ($wgUQc as $bHKYd) { goto rWUzf; RWggl: $this->crawlers[] = $zgLsz; goto pL44v; rWUzf: $nD4z7 = CodeUtil::getFullClassNameForContent(file_get_contents($bHKYd['pathname'])); goto jy2ch; jy2ch: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $nD4z7)) { continue; } goto LyysE; oMfqk: if (!$zgLsz instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $nD4z7)) { continue; } goto RWggl; LyysE: $zgLsz = app($nD4z7); goto oMfqk; pL44v: } } goto D0TWE; ZdlrB: foreach ($this->crawlers as $tF8fe) { goto m3Rqe; m3Rqe: $tF8fe->init(); goto eEA7y; hNLa_: $tF8fe->run(); goto z0Nr0; eEA7y: app()->call(array($tF8fe, 'setup')); goto hNLa_; z0Nr0: } goto VjeVn; VjeVn: $this->info('CrawlerRunner: Run End'); goto W8LpD; W8LpD: } }