<?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($sCmIC) { goto CgU8v; fKEiF: if (null !== $fEpHF) { return $sCmIC . '?' . $fEpHF; } goto JaL0G; CgU8v: $fEpHF = Cache::get($gQjQS = self::CACHE_PREFIX . $sCmIC, null); goto fKEiF; cwKBq: Cache::put($gQjQS, '', 0); goto DKZBt; JaL0G: if (file_exists($sCmIC)) { goto ETM1l; Vfy3y: Cache::put($gQjQS, $fEpHF, 0); goto Xvxss; Xvxss: return $sCmIC . '?' . $fEpHF; goto LrDGE; ETM1l: $fEpHF = '' . crc32(md5_file($sCmIC)); goto Vfy3y; LrDGE: } goto cwKBq; DKZBt: return $sCmIC; goto J2mAk; J2mAk: } public function getCDN($sCmIC) { goto KBF57; KVEb3: $iod2m = abs(crc32($sCmIC) % count($DVSFc)); goto vW39S; vW39S: return $DVSFc[$iod2m]; goto i_LZv; KBF57: $DVSFc = config('modstart.asset.cdn_array', array('/')); goto KVEb3; i_LZv: } }