<?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($UtKOH, $qOrzw, $Z0Hja) { goto z7sDL; z7sDL: $this->key = $UtKOH; goto Zt4T2; Tpmxu: $this->cacheSeconds = $Z0Hja; goto NXKwX; Zt4T2: $this->param = $qOrzw; goto Tpmxu; NXKwX: } public static function create($UtKOH, $qOrzw, $Z0Hja) { goto n9Kl6; JwsKS: $pJeg8->onQueue('LazyValueJob'); goto ydKOT; ydKOT: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($pJeg8); goto YaJHs; n9Kl6: $pJeg8 = new LazyValueJob($UtKOH, $qOrzw, $Z0Hja); goto JwsKS; YaJHs: } public static function createRefresh($UtKOH, $qOrzw, $Z0Hja) { goto doIrF; E5pNq: $pJeg8->onQueue('LazyValueJobRefresh'); goto BLmh1; doIrF: $pJeg8 = new LazyValueJob($UtKOH, $qOrzw, $Z0Hja); goto E5pNq; BLmh1: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($pJeg8); goto NNUor; NNUor: } public function handle() { goto Fo0Mv; MMKLS: $Uqv_y = config('app.lazy_value_processor_roots', array()); goto ta0vZ; fLj07: if (!$nMLLk) { throw new \Exception('LazyValueJob.Error : could not found processor ' . $this->key); } goto hC5gA; cfdjz: $nMLLk = false; goto JSxjd; Fo0Mv: $bn5lU = time(); goto P3DuC; PvEwy: Logger::info('LazyValueJob', 'End'); goto ZCVRW; JSxjd: foreach ($Uqv_y as $qu0al) { $M3hwx = $qu0al . '\\' . $this->key . 'Processor'; if (class_exists($M3hwx)) { goto W2SlA; HYqv0: $fo71I = $PhDXH->execute($this->param); goto BEg1c; BEg1c: $nMLLk = true; goto pDShH; W2SlA: $PhDXH = new $M3hwx(); goto HYqv0; pDShH: } } goto fLj07; P3DuC: Logger::info('LazyValueJob', 'Start', array($this->key, $this->cacheSeconds, $this->param)); goto MMKLS; ta0vZ: if (empty($Uqv_y)) { throw new \Exception('LazyValueJob.Error : you should define lazy_value_processor_roots in config/app.php file'); } goto cfdjz; hC5gA: Logger::info('LazyValueJob', 'Result', $fo71I); goto iLTBl; iLTBl: ModelUtil::update('lazy_value', array('key' => $this->key, 'param' => json_encode($this->param)), array('expire' => time() + $this->cacheSeconds, 'value' => json_encode($fo71I))); goto PvEwy; ZCVRW: } }