初始化项目
This commit is contained in:
23
app/BaseApp/BaseClient.php
Normal file
23
app/BaseApp/BaseClient.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\BaseApp;
|
||||
|
||||
class BaseClient
|
||||
{
|
||||
private static mixed $_instance;
|
||||
|
||||
|
||||
/**
|
||||
* 获取实例
|
||||
* @return null|static
|
||||
*/
|
||||
public static function getInstance(): null|static
|
||||
{
|
||||
$name = get_called_class();
|
||||
if (!isset(self::$_instance[$name])) {
|
||||
self::$_instance[$name] = new static();
|
||||
}
|
||||
|
||||
return self::$_instance[$name];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user