<?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($ypGny) { goto mPY9k; JS4H7: if (file_exists($ypGny)) { goto TOMjS; AnFru: Cache::put($ghVhG, $yAv3U, 0); goto H3VBF; TOMjS: $yAv3U = '' . crc32(md5_file($ypGny)); goto AnFru; H3VBF: return $ypGny . '?' . $yAv3U; goto cNQIZ; cNQIZ: } goto uG_S7; uG_S7: Cache::put($ghVhG, '', 0); goto KFTLY; YOAiG: if (null !== $yAv3U) { return $ypGny . '?' . $yAv3U; } goto JS4H7; KFTLY: return $ypGny; goto ipV10; mPY9k: $yAv3U = Cache::get($ghVhG = self::CACHE_PREFIX . $ypGny, null); goto YOAiG; ipV10: } public function getCDN($ypGny) { goto CQuhE; gYnx2: return $gtuDT[$kMvXT]; goto Ginud; CQuhE: $gtuDT = config('modstart.asset.cdn_array', array('/')); goto GapId; GapId: $kMvXT = abs(crc32($ypGny) % count($gtuDT)); goto gYnx2; Ginud: } }