<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Assets\Driver; use ModStart\Core\Assets\AssetsPath; use Illuminate\Support\Facades\Cache; class CdnAssetsPath implements AssetsPath { const CACHE_PREFIX = 'modstart:asset-file:'; public function getPathWithHash($WF06r) { goto hdqyu; SwAZR: Cache::put($RmSHT, '', 0); goto yhYow; m8NBr: if (null !== $n0mgm) { return $WF06r . '?' . $n0mgm; } goto cKZj6; hdqyu: $n0mgm = Cache::get($RmSHT = self::CACHE_PREFIX . $WF06r, null); goto m8NBr; yhYow: return $WF06r; goto lzGTq; cKZj6: if (file_exists($WF06r)) { goto f3_3C; f3_3C: $n0mgm = '' . crc32(md5_file($WF06r)); goto jgxhW; ykiQk: return $WF06r . '?' . $n0mgm; goto Bbfo_; jgxhW: Cache::put($RmSHT, $n0mgm, 0); goto ykiQk; Bbfo_: } goto SwAZR; lzGTq: } public function getCDN($WF06r) { goto q5OPW; HqbCR: $G2tFt = abs(crc32($WF06r) % count($Z7Sxc)); goto FuFxm; FuFxm: return $Z7Sxc[$G2tFt]; goto fnM2C; q5OPW: $Z7Sxc = config('modstart.asset.cdn_array', array('/')); goto HqbCR; fnM2C: } }