<?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 OgmEE; ZgZC8: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto iGqm0; KnZPK: $this->info('CrawlerRunner: Run Start'); goto fl6jd; nzXUK: if (is_file($nio2A)) { goto tpkUC; P1E1r: $zWFYu = app($RsA_2); goto SRWWU; tpkUC: $RsA_2 = CodeUtil::getFullClassNameForContent(file_get_contents($nio2A)); goto P1E1r; SRWWU: $this->crawlers[] = $zWFYu; goto LYl7P; LYl7P: } else { $N_VNZ = FileUtil::listFiles($nio2A, '*.php'); foreach ($N_VNZ as $SgkW3) { goto sqMNe; AMALH: $zWFYu = app($RsA_2); goto QKcdD; sqMNe: $RsA_2 = CodeUtil::getFullClassNameForContent(file_get_contents($SgkW3['pathname'])); goto lIHYe; lIHYe: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $RsA_2)) { continue; } goto AMALH; QKcdD: if (!$zWFYu instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $RsA_2)) { continue; } goto K5ZWf; K5ZWf: $this->crawlers[] = $zWFYu; goto ZsCGt; ZsCGt: } } goto ZW2RX; OgmEE: $nio2A = $this->argument('path'); goto nzXUK; ZFvSo: $this->info('CrawlerRunner: Run End'); goto DMSYX; fl6jd: foreach ($this->crawlers as $rhQeb) { goto H6M41; JanLs: $rhQeb->run(); goto pXfb3; fqhaL: app()->call(array($rhQeb, 'setup')); goto JanLs; H6M41: $rhQeb->init(); goto fqhaL; pXfb3: } goto ZFvSo; ZW2RX: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto ZgZC8; iGqm0: foreach ($this->crawlers as $rhQeb) { $this->info('    > ' . get_class($rhQeb)); } goto KnZPK; DMSYX: } }