<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\LazyValue; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Job\BaseJob; use ModStart\Core\Util\SerializeUtil; use Module\Vendor\Log\Logger; class LazyValueJob extends BaseJob { private $key; private $param; private $cacheSeconds; public function __construct($sFwJk, $w6bW5, $Nh2dJ) { goto h1p5f; QHmBg: $this->cacheSeconds = $Nh2dJ; goto m28YW; NMsQd: $this->param = $w6bW5; goto QHmBg; h1p5f: $this->key = $sFwJk; goto NMsQd; m28YW: } public static function create($sFwJk, $w6bW5, $Nh2dJ) { goto Mmicy; Mmicy: $owZYb = new LazyValueJob($sFwJk, $w6bW5, $Nh2dJ); goto IaHNM; heyYf: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($owZYb); goto Pdu8v; IaHNM: $owZYb->onQueue('LazyValueJob'); goto heyYf; Pdu8v: } public static function createRefresh($sFwJk, $w6bW5, $Nh2dJ) { goto YlpIc; j09WU: $owZYb->onQueue('LazyValueJobRefresh'); goto IfwB0; IfwB0: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($owZYb); goto U9EYv; YlpIc: $owZYb = new LazyValueJob($sFwJk, $w6bW5, $Nh2dJ); goto j09WU; U9EYv: } public function handle() { goto lT3Rs; jU_vU: foreach ($bDzXA as $D9ugB) { $nD4z7 = $D9ugB . '\\' . $this->key . 'Processor'; if (class_exists($nD4z7)) { goto fMDif; fMDif: $n95uW = new $nD4z7(); goto Furec; LHYx0: $HwTKj = true; goto Vx8Yk; Furec: $jkY57 = $n95uW->execute($this->param); goto LHYx0; Vx8Yk: } } goto DUGR7; mdt6U: Logger::info('LazyValueJob', 'End'); goto wAFjL; zyjau: $bDzXA = config('app.lazy_value_processor_roots', array()); goto A2NX5; DUGR7: if (!$HwTKj) { throw new \Exception('LazyValueJob.Error : could not found processor ' . $this->key); } goto Qe00T; A2NX5: if (empty($bDzXA)) { throw new \Exception('LazyValueJob.Error : you should define lazy_value_processor_roots in config/app.php file'); } goto VAFyO; lT3Rs: $kHkis = time(); goto pKk0F; Qe00T: Logger::info('LazyValueJob', 'Result', $jkY57); goto pfFZt; pfFZt: ModelUtil::update('lazy_value', array('key' => $this->key, 'param' => SerializeUtil::jsonEncode($this->param)), array('expire' => time() + $this->cacheSeconds, 'value' => SerializeUtil::jsonEncode($jkY57))); goto mdt6U; pKk0F: Logger::info('LazyValueJob', 'Start', array($this->key, $this->cacheSeconds, $this->param)); goto zyjau; VAFyO: $HwTKj = false; goto jU_vU; wAFjL: } }