<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\LiveStream; use ModStart\Core\Exception\BizException; class LiveStreamProvider { private static $instances = array(); public static function register($pXrNS) { self::$instances[] = $pXrNS; } public static function all() { foreach (self::$instances as $F4wee => $SxG_W) { if ($SxG_W instanceof \Closure) { self::$instances[$F4wee] = call_user_func($SxG_W); } else { if (is_string($SxG_W)) { self::$instances[$F4wee] = app($SxG_W); } } } return self::$instances; } public static function nameTitleMap() { return array_build(self::all(), function ($F4wee, $pXrNS) { return array($pXrNS->name(), $pXrNS->title()); }); } public static function first() { foreach (self::all() as $pXrNS) { return $pXrNS->name(); } return null; } public static function get($fYoEH) { foreach (self::all() as $MNZ1i) { if ($MNZ1i->name() == $fYoEH) { return $MNZ1i; } } return null; } }