<?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($OSU2M, $uxJUJ, $yTO5u) { goto ntmny; QRGPm: $this->cacheSeconds = $yTO5u; goto AFSV4; ntmny: $this->key = $OSU2M; goto uwGf4; uwGf4: $this->param = $uxJUJ; goto QRGPm; AFSV4: } public static function create($OSU2M, $uxJUJ, $yTO5u) { goto lStW3; lStW3: $bicx_ = new LazyValueJob($OSU2M, $uxJUJ, $yTO5u); goto IuHsL; hxWMi: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($bicx_); goto CGrSN; IuHsL: $bicx_->onQueue('LazyValueJob'); goto hxWMi; CGrSN: } public static function createRefresh($OSU2M, $uxJUJ, $yTO5u) { goto gZbFf; hYuUL: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($bicx_); goto xeWqA; fYXa5: $bicx_->onQueue('LazyValueJobRefresh'); goto hYuUL; gZbFf: $bicx_ = new LazyValueJob($OSU2M, $uxJUJ, $yTO5u); goto fYXa5; xeWqA: } public function handle() { goto xKEst; xJt51: if (empty($RfBzG)) { throw new \Exception('LazyValueJob.Error : you should define lazy_value_processor_roots in config/app.php file'); } goto fZOP3; oSlQU: Logger::info('LazyValueJob', 'Result', $qQcPQ); goto FTl2Q; ehdje: foreach ($RfBzG as $QWEj6) { $RsX1N = $QWEj6 . '\\' . $this->key . 'Processor'; if (class_exists($RsX1N)) { goto GvqrC; GvqrC: $ptV5f = new $RsX1N(); goto mavnx; mavnx: $qQcPQ = $ptV5f->execute($this->param); goto vkmM2; vkmM2: $Zcap8 = true; goto JRtCP; JRtCP: } } goto HX7WB; xKEst: $kZQCX = time(); goto HQtuo; Ko2l9: $RfBzG = config('app.lazy_value_processor_roots', array()); goto xJt51; HX7WB: if (!$Zcap8) { throw new \Exception('LazyValueJob.Error : could not found processor ' . $this->key); } goto oSlQU; fZOP3: $Zcap8 = false; goto ehdje; HQtuo: Logger::info('LazyValueJob', 'Start', array($this->key, $this->cacheSeconds, $this->param)); goto Ko2l9; FTl2Q: ModelUtil::update('lazy_value', array('key' => $this->key, 'param' => json_encode($this->param)), array('expire' => time() + $this->cacheSeconds, 'value' => json_encode($qQcPQ))); goto wfm5H; wfm5H: Logger::info('LazyValueJob', 'End'); goto vb0Mv; vb0Mv: } }