<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\LazyValue; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Job\BaseJob; use Module\Vendor\Log\Logger; class LazyValueJob extends BaseJob { private $key; private $param; private $cacheSeconds; public function __construct($rY0hM, $EPwwc, $qUOYa) { goto EoIPf; EoIPf: $this->key = $rY0hM; goto VjO8a; daL2I: $this->cacheSeconds = $qUOYa; goto fnrMo; VjO8a: $this->param = $EPwwc; goto daL2I; fnrMo: } public static function create($rY0hM, $EPwwc, $qUOYa) { goto l0kep; idjjE: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($n_tN1); goto NvOHW; utEB6: $n_tN1->onQueue('LazyValueJob'); goto idjjE; l0kep: $n_tN1 = new LazyValueJob($rY0hM, $EPwwc, $qUOYa); goto utEB6; NvOHW: } public static function createRefresh($rY0hM, $EPwwc, $qUOYa) { goto JLszD; JLszD: $n_tN1 = new LazyValueJob($rY0hM, $EPwwc, $qUOYa); goto hSFJE; hSFJE: $n_tN1->onQueue('LazyValueJobRefresh'); goto qCb4Z; qCb4Z: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($n_tN1); goto j8I3K; j8I3K: } public function handle() { goto xMHdY; Wx5rV: Logger::info('LazyValueJob', 'Start', array($this->key, $this->cacheSeconds, $this->param)); goto fVMgI; fVMgI: $VJcMn = config('app.lazy_value_processor_roots', array()); goto N_UGo; RD3aP: $M3aYk = false; goto S19z6; IzAM4: if (!$M3aYk) { throw new \Exception('LazyValueJob.Error : could not found processor ' . $this->key); } goto Y90ua; RuKwC: ModelUtil::update('lazy_value', array('key' => $this->key, 'param' => json_encode($this->param)), array('expire' => time() + $this->cacheSeconds, 'value' => json_encode($hsART))); goto VFVbp; VFVbp: Logger::info('LazyValueJob', 'End'); goto EfV6n; xMHdY: $Qn1EU = time(); goto Wx5rV; Y90ua: Logger::info('LazyValueJob', 'Result', $hsART); goto RuKwC; S19z6: foreach ($VJcMn as $nNIn0) { $UJCDc = $nNIn0 . '\\' . $this->key . 'Processor'; if (class_exists($UJCDc)) { goto Bq_Ec; Bq_Ec: $Fpmtn = new $UJCDc(); goto Z8MQU; v7aOv: $M3aYk = true; goto WaNr0; Z8MQU: $hsART = $Fpmtn->execute($this->param); goto v7aOv; WaNr0: } } goto IzAM4; N_UGo: if (empty($VJcMn)) { throw new \Exception('LazyValueJob.Error : you should define lazy_value_processor_roots in config/app.php file'); } goto RD3aP; EfV6n: } }