<?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 TN0Pr; rCqGs: $this->info('CrawlerRunner: Run End'); goto z9L8s; c6BCr: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto FaXut; BsiGm: foreach ($this->crawlers as $F9kLA) { $this->info('    > ' . get_class($F9kLA)); } goto FTo6h; xjRJp: if (is_file($fCnvM)) { goto TC_1l; fy_sl: $hKL6P = app($uKAkP); goto gb26z; gb26z: $this->crawlers[] = $hKL6P; goto ndAV8; TC_1l: $uKAkP = CodeUtil::getFullClassNameForContent(file_get_contents($fCnvM)); goto fy_sl; ndAV8: } else { $QxXQB = FileUtil::listFiles($fCnvM, '*.php'); foreach ($QxXQB as $wjJPd) { goto PjsCt; PibdU: $this->crawlers[] = $hKL6P; goto z01DE; A8gws: if (!$hKL6P instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $uKAkP)) { continue; } goto PibdU; ES3Vn: $hKL6P = app($uKAkP); goto A8gws; Ni41H: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $uKAkP)) { continue; } goto ES3Vn; PjsCt: $uKAkP = CodeUtil::getFullClassNameForContent(file_get_contents($wjJPd['pathname'])); goto Ni41H; z01DE: } } goto c6BCr; FaXut: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto BsiGm; TN0Pr: $fCnvM = $this->argument('path'); goto xjRJp; DruAm: foreach ($this->crawlers as $F9kLA) { goto smGZi; Ic2zr: app()->call(array($F9kLA, 'setup')); goto F4N2Y; smGZi: $F9kLA->init(); goto Ic2zr; F4N2Y: $F9kLA->run(); goto d2BDd; d2BDd: } goto rCqGs; FTo6h: $this->info('CrawlerRunner: Run Start'); goto DruAm; z9L8s: } }