exewen/nacos
最新稳定版本:v2.1.0
Composer 安装命令:
composer require exewen/nacos
包简介
A nacos component for Exewen.
README 文档
README
cp -rf ./publish/exewen /your_project/config
初始化
!defined('BASE_PATH_PKG') && define('BASE_PATH_PKG', dirname(__DIR__, 1)); # 设置配置保存/读取路径 \Exewen\Utils\FileUtil::setSnapshotPath(dirname(__DIR__) . "/config/nacos/env");
nacos
use Exewen\Nacos\NacosFacade; # 获取配置文件 NacosFacade::getConfig($this->namespaceId, $this->dataId, $this->group); # 获取并保存配置文件 NacosFacade::saveConfig($this->namespaceId, $this->dataId, $this->group); # 读取本地配置文件 $configPath = \Exewen\Utils\FileUtil::getSnapshotFile($this->namespaceId, $this->dataId, $this->group); # 注册实例 NacosFacade::setInstance($this->namespaceId, $this->serviceName, $this->group, $ip, $port); # 发送心跳 NacosFacade::setInstanceBeat($this->namespaceId, $this->serviceName, $this->group, $ip, $port); # 获取实例列表 NacosFacade::getInstance($this->namespaceId, $this->serviceName, $this->group, true);
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-11