<?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($RLMU5) { goto bYMC2; bYMC2: $THL2f = Cache::get($ZjtSD = self::CACHE_PREFIX . $RLMU5, null); goto cSVem; cSVem: if (null !== $THL2f) { return $RLMU5 . '?' . $THL2f; } goto T55si; uGtn2: Cache::put($ZjtSD, '', 0); goto RFaEa; RFaEa: return $RLMU5; goto MfbFg; T55si: if (file_exists($RLMU5)) { goto r1u7Y; FNpjh: Cache::put($ZjtSD, $THL2f, 0); goto DrQeI; DrQeI: return $RLMU5 . '?' . $THL2f; goto rnBI4; r1u7Y: $THL2f = '' . crc32(md5_file($RLMU5)); goto FNpjh; rnBI4: } goto uGtn2; MfbFg: } public function getCDN($RLMU5) { goto xHD1j; xHD1j: $wCTyT = config('modstart.asset.cdn_array', array('/')); goto PShna; GaJuW: return $wCTyT[$T3mms]; goto vwARh; PShna: $T3mms = abs(crc32($RLMU5) % count($wCTyT)); goto GaJuW; vwARh: } }