<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Assets; use Illuminate\Support\Facades\Request; use Illuminate\Support\Str; class AssetsUtil { public static function cdn() { return app('assetPathDriver')->getCDN(''); } public static function fix($ceAjB) { goto ncIZ2; ncIZ2: if (Str::startsWith($ceAjB, 'http://') || Str::startsWith($ceAjB, 'https://') || Str::startsWith($ceAjB, '//')) { return $ceAjB; } goto yWd3H; yWd3H: if (Str::startsWith($ceAjB, '/')) { $ceAjB = substr($ceAjB, 1); } goto gZplx; gZplx: return app('assetPathDriver')->getCDN($ceAjB) . app('assetPathDriver')->getPathWithHash($ceAjB); goto Y5Um1; Y5Um1: } public static function fixOrDefault($ceAjB, $abOlZ) { if (empty($ceAjB)) { return self::fix($abOlZ); } return self::fix($ceAjB); } public static function url($oU8qf) { return app('assetPathDriver')->getCDN($oU8qf) . app('assetPathDriver')->getPathWithHash($oU8qf); } public static function fixCurrentDomain($ceAjB) { goto TFdrU; Ax4Sk: if (Request::secure()) { $xSuYc = 'https'; } else { $xSuYc = 'http'; } goto YB1mX; TFdrU: if (Str::startsWith($ceAjB, 'http://') || Str::startsWith($ceAjB, 'https://')) { return $ceAjB; } goto B8jHr; kyOS4: return $xSuYc . '://' . Request::server('HTTP_HOST') . $ceAjB; goto bbRts; B8jHr: if (!Str::startsWith($ceAjB, '/')) { $ceAjB = '/' . $ceAjB; } goto Ax4Sk; YB1mX: if (Str::startsWith($ceAjB, '//')) { return $xSuYc . ':' . $ceAjB; } goto kyOS4; bbRts: } public static function fixFull($ceAjB) { goto EBDYz; G6xMw: if (Str::startsWith($ceAjB, 'http://') || Str::startsWith($ceAjB, 'https://')) { return $ceAjB; } goto GTXcQ; ksCkw: if (Str::startsWith($ceAjB, '//')) { return $xSuYc . ':' . $ceAjB; } goto fRHlW; EBDYz: $ceAjB = self::fix($ceAjB); goto G6xMw; GTXcQ: if (Request::secure()) { $xSuYc = 'https'; } else { $xSuYc = 'http'; } goto ksCkw; fRHlW: return $xSuYc . '://' . Request::server('HTTP_HOST') . $ceAjB; goto cXsxM; cXsxM: } public static function fixFullOrDefault($ceAjB, $abOlZ = null) { if (empty($ceAjB)) { return self::fixFull($abOlZ); } return self::fixFull($ceAjB); } }