<?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($VKrDJ, $f_HcG, $AKKj2) { goto Bitt2; e5UcA: $this->param = $f_HcG; goto ly74q; ly74q: $this->cacheSeconds = $AKKj2; goto Uq1Xx; Bitt2: $this->key = $VKrDJ; goto e5UcA; Uq1Xx: } public static function create($VKrDJ, $f_HcG, $AKKj2) { goto PaB8S; J2rzr: $ZnNP5->onQueue('LazyValueJob'); goto NY1w2; NY1w2: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($ZnNP5); goto idn9q; PaB8S: $ZnNP5 = new LazyValueJob($VKrDJ, $f_HcG, $AKKj2); goto J2rzr; idn9q: } public static function createRefresh($VKrDJ, $f_HcG, $AKKj2) { goto GdVJj; a21TR: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($ZnNP5); goto n1akJ; GdVJj: $ZnNP5 = new LazyValueJob($VKrDJ, $f_HcG, $AKKj2); goto ALp3g; ALp3g: $ZnNP5->onQueue('LazyValueJobRefresh'); goto a21TR; n1akJ: } public function handle() { goto SPilQ; D3KJ9: ModelUtil::update('lazy_value', array('key' => $this->key, 'param' => json_encode($this->param)), array('expire' => time() + $this->cacheSeconds, 'value' => json_encode($L58zW))); goto c0eNW; c0eNW: Logger::info('LazyValueJob', 'End'); goto T2Bsd; JPWw2: $QHq7k = config('app.lazy_value_processor_roots', array()); goto upAub; yA86O: if (!$MB7Jb) { throw new \Exception('LazyValueJob.Error : could not found processor ' . $this->key); } goto UrArU; SPilQ: $xc08J = time(); goto cZpRp; OiCN1: foreach ($QHq7k as $MTVgI) { $qEZCw = $MTVgI . '\\' . $this->key . 'Processor'; if (class_exists($qEZCw)) { goto Rh2V1; DOzXQ: $MB7Jb = true; goto QuEQ_; Rh2V1: $rsYfe = new $qEZCw(); goto eIsAu; eIsAu: $L58zW = $rsYfe->execute($this->param); goto DOzXQ; QuEQ_: } } goto yA86O; cZpRp: Logger::info('LazyValueJob', 'Start', array($this->key, $this->cacheSeconds, $this->param)); goto JPWw2; upAub: if (empty($QHq7k)) { throw new \Exception('LazyValueJob.Error : you should define lazy_value_processor_roots in config/app.php file'); } goto irO5n; irO5n: $MB7Jb = false; goto OiCN1; UrArU: Logger::info('LazyValueJob', 'Result', $L58zW); goto D3KJ9; T2Bsd: } }