<?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 pIz1A; u47nX: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto egupo; nRbSS: if (is_file($pqMR1)) { goto bqFD_; bqFD_: $zGAvh = CodeUtil::getFullClassNameForContent(file_get_contents($pqMR1)); goto ozan6; IKGy1: $this->crawlers[] = $dmHFN; goto YsB32; ozan6: $dmHFN = app($zGAvh); goto IKGy1; YsB32: } else { $dz8Az = FileUtil::listFiles($pqMR1, '*.php'); foreach ($dz8Az as $obXaA) { goto gdb8h; lugKX: $dmHFN = app($zGAvh); goto JJ2IR; RFDzy: $this->crawlers[] = $dmHFN; goto oqlNR; R5Shz: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $zGAvh)) { continue; } goto lugKX; gdb8h: $zGAvh = CodeUtil::getFullClassNameForContent(file_get_contents($obXaA['pathname'])); goto R5Shz; JJ2IR: if (!$dmHFN instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $zGAvh)) { continue; } goto RFDzy; oqlNR: } } goto Z89BG; IX8AC: $this->info('CrawlerRunner: Run End'); goto Ray8Q; pIz1A: $pqMR1 = $this->argument('path'); goto nRbSS; l609T: $this->info('CrawlerRunner: Run Start'); goto unJm1; Z89BG: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto u47nX; egupo: foreach ($this->crawlers as $drQfR) { $this->info('    > ' . get_class($drQfR)); } goto l609T; unJm1: foreach ($this->crawlers as $drQfR) { goto bhO0X; bhO0X: $drQfR->init(); goto LcN5k; bUBJX: $drQfR->run(); goto cjIJn; LcN5k: app()->call(array($drQfR, 'setup')); goto bUBJX; cjIJn: } goto IX8AC; Ray8Q: } }