<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\MailSender; use ModStart\Core\Exception\BizException; class MailSenderProvider { private static $instances = array(); public static function register($sefXk) { self::$instances[] = $sefXk; } public static function all() { foreach (self::$instances as $JdFJR => $PSYn9) { if ($PSYn9 instanceof \Closure) { self::$instances[$JdFJR] = call_user_func($PSYn9); } else { if (is_string($PSYn9)) { self::$instances[$JdFJR] = app($PSYn9); } } } return self::$instances; } public static function get($BjHij) { foreach (self::all() as $vPOhn) { if ($vPOhn->name() == $BjHij) { return $vPOhn; } } BizException::throws('没有找到MailSenderProvider'); } public static function hasProvider() { $sefXk = app()->config->get('EmailSenderProvider'); return !empty($sefXk); } }