<?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 Rxw7i; X6ECi: $this->info('CrawlerRunner: Run Start'); goto gLYqi; mb65l: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto Wpw_V; gLYqi: foreach ($this->crawlers as $rrpIQ) { goto jWm51; Mncqa: app()->call(array($rrpIQ, 'setup')); goto SH2rH; SH2rH: $rrpIQ->run(); goto S5rA0; jWm51: $rrpIQ->init(); goto Mncqa; S5rA0: } goto pk9PV; Wpw_V: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto X6XTK; pk9PV: $this->info('CrawlerRunner: Run End'); goto lReAD; X6XTK: foreach ($this->crawlers as $rrpIQ) { $this->info('    > ' . get_class($rrpIQ)); } goto X6ECi; udMhf: if (is_file($SCMtv)) { goto xYo2D; uahBe: $this->crawlers[] = $Osj8s; goto vBFaQ; awAwc: $Osj8s = app($UJCDc); goto uahBe; xYo2D: $UJCDc = CodeUtil::getFullClassNameForContent(file_get_contents($SCMtv)); goto awAwc; vBFaQ: } else { $GntWd = FileUtil::listFiles($SCMtv, '*.php'); foreach ($GntWd as $Jm77a) { goto hEcPQ; suOAR: $Osj8s = app($UJCDc); goto iidsb; hEcPQ: $UJCDc = CodeUtil::getFullClassNameForContent(file_get_contents($Jm77a['pathname'])); goto l036j; l036j: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $UJCDc)) { continue; } goto suOAR; iidsb: if (!$Osj8s instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $UJCDc)) { continue; } goto TsDAw; TsDAw: $this->crawlers[] = $Osj8s; goto BUCXT; BUCXT: } } goto mb65l; Rxw7i: $SCMtv = $this->argument('path'); goto udMhf; lReAD: } }