add
This commit is contained in:
+3
-9
@@ -112,24 +112,18 @@ abstract class Base
|
|||||||
protected static $base;
|
protected static $base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $method
|
|
||||||
* @param $configPath
|
* @param $configPath
|
||||||
* @param mixed ...$params
|
* @return static
|
||||||
* @return mixed
|
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function call($method, $configPath, ...$params)
|
public static function call($configPath)
|
||||||
{
|
{
|
||||||
if (!static::$base instanceof Base) {
|
if (!static::$base instanceof Base) {
|
||||||
static::$base = new static();
|
static::$base = new static();
|
||||||
}
|
}
|
||||||
$class = static::$base;
|
$class = static::$base;
|
||||||
$class->loadConfig($configPath);
|
$class->loadConfig($configPath);
|
||||||
|
return $class;
|
||||||
if (!method_exists($class, $method)) {
|
|
||||||
throw new \Exception('未知的执行方法!');
|
|
||||||
}
|
|
||||||
return call_user_func([$class, $method], ...$params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user