<?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($Jtt5u) { goto U4RKS; QjJVE: if (null !== $I4NE6) { return $Jtt5u . '?' . $I4NE6; } goto uYtSj; U4RKS: $I4NE6 = Cache::get($swetG = self::CACHE_PREFIX . $Jtt5u, null); goto QjJVE; uYtSj: if (file_exists($Jtt5u)) { goto APfhV; get2p: Cache::put($swetG, $I4NE6, 0); goto hpVvs; hpVvs: return $Jtt5u . '?' . $I4NE6; goto oSWsu; APfhV: $I4NE6 = '' . crc32(md5_file($Jtt5u)); goto get2p; oSWsu: } goto MzujC; PJHfV: return $Jtt5u; goto Opau2; MzujC: Cache::put($swetG, '', 0); goto PJHfV; Opau2: } public function getCDN($Jtt5u) { goto i_eDH; wlZaJ: return $AH5DM[$E7aCf]; goto SgzFW; JFK6q: $E7aCf = abs(crc32($Jtt5u) % count($AH5DM)); goto wlZaJ; i_eDH: $AH5DM = config('modstart.asset.cdn_array', array('/')); goto JFK6q; SgzFW: } }