<?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 tcJdg; DIQ3g: $this->info('CrawlerRunner: Run End'); goto IoGGy; Q4NtL: $this->info('CrawlerRunner: ' . count($this->crawlers) . ' Crawler(s) Found'); goto pVSZX; beL8k: foreach ($this->crawlers as $PmBHf) { goto nLvFG; nLvFG: $PmBHf->init(); goto m6nQw; lrN5r: $PmBHf->run(); goto drXpk; m6nQw: app()->call(array($PmBHf, 'setup')); goto lrN5r; drXpk: } goto DIQ3g; PdnvD: $this->info('CrawlerRunner: Run Start'); goto beL8k; L7ggS: if (is_file($fvX1i)) { goto Gq1Or; j0wYo: $vFZTy = app($qEZCw); goto xVw5s; Gq1Or: $qEZCw = CodeUtil::getFullClassNameForContent(file_get_contents($fvX1i)); goto j0wYo; xVw5s: $this->crawlers[] = $vFZTy; goto s55x2; s55x2: } else { $ikIIS = FileUtil::listFiles($fvX1i, '*.php'); foreach ($ikIIS as $rZJie) { goto pkjaL; TCpY2: $vFZTy = app($qEZCw); goto TWmic; TWmic: if (!$vFZTy instanceof AbstractCrawler || preg_match('/\\Abstract[A-Za-z0-9_]+$/', $qEZCw)) { continue; } goto YwU8m; JyGb5: if (preg_match('/\\\\Abstract[A-Za-z0-9_]+$/', $qEZCw)) { continue; } goto TCpY2; YwU8m: $this->crawlers[] = $vFZTy; goto B4EnT; pkjaL: $qEZCw = CodeUtil::getFullClassNameForContent(file_get_contents($rZJie['pathname'])); goto JyGb5; B4EnT: } } goto ZqdPG; tcJdg: $fvX1i = $this->argument('path'); goto L7ggS; ZqdPG: if (empty($this->crawlers)) { $this->info('CrawlerRunner: No Crawler Found'); return; } goto Q4NtL; pVSZX: foreach ($this->crawlers as $PmBHf) { $this->info('    > ' . get_class($PmBHf)); } goto PdnvD; IoGGy: } }