<?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($fWBvH) { goto SvEgD; R55g9: Cache::put($ZocKV, '', 0); goto smJHw; SvEgD: $Ooi_1 = Cache::get($ZocKV = self::CACHE_PREFIX . $fWBvH, null); goto waR5N; waR5N: if (null !== $Ooi_1) { return $fWBvH . '?' . $Ooi_1; } goto v2PZt; v2PZt: if (file_exists($fWBvH)) { goto EcF2f; kZHpO: return $fWBvH . '?' . $Ooi_1; goto et_vu; EcF2f: $Ooi_1 = '' . crc32(md5_file($fWBvH)); goto Lho3B; Lho3B: Cache::put($ZocKV, $Ooi_1, 0); goto kZHpO; et_vu: } goto R55g9; smJHw: return $fWBvH; goto njUGp; njUGp: } public function getCDN($fWBvH) { goto L23Do; L23Do: $eRKyj = config('modstart.asset.cdn_array', array('/')); goto IZz0F; AwNvF: return $eRKyj[$CbABT]; goto YU9Rd; IZz0F: $CbABT = abs(crc32($fWBvH) % count($eRKyj)); goto AwNvF; YU9Rd: } }