<?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($aYJAK) { goto VJWwC; q7zE5: return $aYJAK; goto Y6yuw; styuQ: if (file_exists($aYJAK)) { goto a88c7; a88c7: $rCzZc = '' . crc32(md5_file($aYJAK)); goto b0Rpo; T2now: return $aYJAK . '?' . $rCzZc; goto p8W9_; b0Rpo: Cache::put($Xqdgx, $rCzZc, 0); goto T2now; p8W9_: } goto MCDgk; IzbtW: if (null !== $rCzZc) { return $aYJAK . '?' . $rCzZc; } goto styuQ; MCDgk: Cache::put($Xqdgx, '', 0); goto q7zE5; VJWwC: $rCzZc = Cache::get($Xqdgx = self::CACHE_PREFIX . $aYJAK, null); goto IzbtW; Y6yuw: } public function getCDN($aYJAK) { goto U_xI5; UbDyi: $gex67 = abs(crc32($aYJAK) % count($TspCS)); goto DeHUp; U_xI5: $TspCS = config('modstart.asset.cdn_array', array('/')); goto UbDyi; DeHUp: return $TspCS[$gex67]; goto Lex3P; Lex3P: } }