<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\SiteTemplate; class SiteTemplateProvider { private static $instances = array(DefaultSiteTemplateProvider::class); public static function register($tDnAb) { self::$instances[] = $tDnAb; } public static function registerQuick($zO6V5, $H_jRb, $D9ugB = null) { self::register(QuickSiteTemplateProvider::make($zO6V5, $H_jRb, $D9ugB)); } public static function all() { foreach (self::$instances as $KAKiA => $Iim2u) { if ($Iim2u instanceof \Closure) { self::$instances[$KAKiA] = call_user_func($Iim2u); } else { if (is_string($Iim2u)) { self::$instances[$KAKiA] = app($Iim2u); } } } return self::$instances; } public static function get($zO6V5) { foreach (self::all() as $tDnAb) { if ($tDnAb->name() == $zO6V5) { return $tDnAb; } } return null; } public static function map() { return array_build(self::all(), function ($KAKiA, $Iim2u) { return array($Iim2u->name(), $Iim2u->title()); }); } }