<?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 I85qg; g1NlZ: foreach ($this->crawlers as $Z4nR_) { $this->info('    > ' . get_class($Z4nR_)); } goto KbEHS; nkUgs: if (is_file($EoIvR)) { goto ABWCQ; ABWCQ: $M3hwx = CodeUtil::getFullClassNameForContent(file_get_contents($EoIvR)); goto Lu5in; HIkXk: $this->crawlers[] = $ZO8gl; goto LuAUS; Lu5in: $ZO8gl = app($M3hwx); goto HIkXk; LuAUS: } else { $cRM80 = FileUtil::listFiles($EoIvR, '*.php'); foreach ($cRM80 as $dG73t) { goto u667k; dS5Xl: if (!$ZO8gl instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $M3hwx)) { continue; } goto iXQ0a; siseS: $ZO8gl = app($M3hwx); goto dS5Xl; iXQ0a: $this->crawlers[] = $ZO8gl; goto L3g4S; u667k: $M3hwx = CodeUtil::getFullClassNameForContent(file_get_contents($dG73t['pathname'])); goto cGXL_; cGXL_: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $M3hwx)) { continue; } goto siseS; L3g4S: } } goto mT902; mT902: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto xqST6; r3o3e: foreach ($this->crawlers as $Z4nR_) { goto Ejpdl; Kvnl9: app()->call(array($Z4nR_, 'setup')); goto LdwQF; LdwQF: $Z4nR_->run(); goto AojPO; Ejpdl: $Z4nR_->init(); goto Kvnl9; AojPO: } goto spvAd; xqST6: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto g1NlZ; spvAd: $this->info('CrawlerRunner: Run End'); goto TaUZF; I85qg: $EoIvR = $this->argument('path'); goto nkUgs; KbEHS: $this->info('CrawlerRunner: Run Start'); goto r3o3e; TaUZF: } }