HookProviders.php
720 字节
<?php
namespace app\api\providers;
use app\api\interfaces\HookProvidersInterface;
class HookProviders implements HookProvidersInterface {
static private $providers;
static private $instance;
public static function getInstance()
{
//判断$instance是否是Singleton的对象,不是则创建
if (!self::$instance instanceof self) {
self::$instance = new self();
}
return self::$instance;
}
public function getProviders(){
self::$providers = [
'user'=>[
'user_init' => [
'app\\api\\behavior\\user\\User',
],
]
];
return self::$providers;
}
}