<?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 Z4Ytn; DDuC1: foreach ($this->crawlers as $i_K5s) { goto vJ8pZ; vJ8pZ: $i_K5s->init(); goto UIAPS; UIAPS: app()->call(array($i_K5s, 'setup')); goto uEELb; uEELb: $i_K5s->run(); goto fPtpw; fPtpw: } goto Arrp6; Z4Ytn: $kHgRs = $this->argument('path'); goto BtvLB; Gos83: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto R09ow; MdTWc: $this->info('CrawlerRunner: Run Start'); goto DDuC1; BtvLB: if (is_file($kHgRs)) { goto ncBqV; Gc7vp: $CGEHS = app($RsX1N); goto rCgO0; ncBqV: $RsX1N = CodeUtil::getFullClassNameForContent(file_get_contents($kHgRs)); goto Gc7vp; rCgO0: $this->crawlers[] = $CGEHS; goto d2HMt; d2HMt: } else { $nHAO4 = FileUtil::listFiles($kHgRs, '*.php'); foreach ($nHAO4 as $okURS) { goto SV63T; SV63T: $RsX1N = CodeUtil::getFullClassNameForContent(file_get_contents($okURS['pathname'])); goto m_Gps; RocL2: $this->crawlers[] = $CGEHS; goto JRb0j; cpb4g: $CGEHS = app($RsX1N); goto P3gw1; P3gw1: if (!$CGEHS instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $RsX1N)) { continue; } goto RocL2; m_Gps: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $RsX1N)) { continue; } goto cpb4g; JRb0j: } } goto Gos83; Arrp6: $this->info('CrawlerRunner: Run End'); goto betYE; eKa7P: foreach ($this->crawlers as $i_K5s) { $this->info('    > ' . get_class($i_K5s)); } goto MdTWc; R09ow: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto eKa7P; betYE: } }