<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\HomePage; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\AgentUtil; class HomePageProvider { private static $instances = array(DefaultHomePageProvider::class, DefaultMobileHomePageProvider::class); public static function register($ugwYT) { self::$instances[] = $ugwYT; } public static function registerQuick($n_9y_, $jruZn, $V4Qg5 = array(AbstractHomePageProvider::TYPE_PC, AbstractHomePageProvider::TYPE_MOBILE)) { self::register(QuickHomePageProvider::make($n_9y_, $jruZn, $V4Qg5)); } public static function all() { foreach (self::$instances as $QBy8K => $cG5OI) { if ($cG5OI instanceof \Closure) { self::$instances[$QBy8K] = call_user_func($cG5OI); } else { if (is_string($cG5OI)) { self::$instances[$QBy8K] = app($cG5OI); } } } return self::$instances; } public static function call($Yfo_L, $pOyGm) { goto KFbHt; k7stN: BizException::throwsIfEmpty('首页不存在', $QL4xw); goto CJMgf; CJMgf: list($ndt18, $FQzmY) = explode('@', $QL4xw); goto BhxvF; MmXTb: if (empty($QL4xw)) { $QL4xw = $pOyGm; } goto k7stN; W6bMJ: if (!starts_with($cbabu, '\\')) { $cbabu = '\\' . $cbabu; } goto fYLaV; csShY: $ndt18 = app($ndt18); goto ZQdHW; KFbHt: $QL4xw = null; goto riSYu; ZQdHW: return app()->call(array($ndt18, $FQzmY)); goto qZUc7; riSYu: if (modstart_config('HomePage_Enable', false)) { if (AgentUtil::isMobile()) { $QL4xw = modstart_config('HomePage_HomeMobile'); } if (empty($QL4xw)) { $QL4xw = modstart_config('HomePage_Home'); } } goto MmXTb; fYLaV: if ($cbabu == $ndt18 && $Y8SlH == $FQzmY) { list($ndt18, $FQzmY) = explode('@', $pOyGm); } goto csShY; BhxvF: list($cbabu, $Y8SlH) = explode('::', $Yfo_L); goto W6bMJ; qZUc7: } }