增加存储服务
This commit is contained in:
41
extend/icloud/src/factory/AuthFactory.php
Normal file
41
extend/icloud/src/factory/AuthFactory.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Administrator
|
||||
* Date: 2019/1/26
|
||||
* Time: 10:28
|
||||
*/
|
||||
namespace thinking\icloud\factory;
|
||||
|
||||
class AuthFactory
|
||||
{
|
||||
/**
|
||||
* 认证驱动
|
||||
*
|
||||
* @time at 2019年01月26日
|
||||
* @param string $name
|
||||
* @param mixed ...$argument
|
||||
* @return mixed
|
||||
*/
|
||||
public static function create(string $name, ...$argument)
|
||||
{
|
||||
$defaultDriver = config('cloud.driver.default');
|
||||
|
||||
$auth = config('cloud.driver.' . $defaultDriver . 'Auth');
|
||||
|
||||
return $auth::$name(...$argument);
|
||||
}
|
||||
|
||||
/**
|
||||
* 静态访问
|
||||
*
|
||||
* @time at 2019年01月26日
|
||||
* @param string $name
|
||||
* @param $argument
|
||||
* @return mixed
|
||||
*/
|
||||
public static function __callstatic(string $name, $argument)
|
||||
{
|
||||
return self::create($name, ...$argument);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user