PHPackages                             xdapp/service-register - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. xdapp/service-register

ActiveLibrary

xdapp/service-register
======================

v1.1.10(5y ago)0961PHPPHP ^7.0.0

Since Jul 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/xdapp/xdapp-sdk-php)[ Packagist](https://packagist.org/packages/xdapp/service-register)[ RSS](/packages/xdapp-service-register/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (17)Used By (0)

XDApp RPC Service SDK
=====================

[](#xdapp-rpc-service-sdk)

XDAppRPC服务SDK

依赖
--

[](#依赖)

- PHP &gt;= 7.0（推荐7.2）
- PHP Swoole 扩展 &gt;=4.0，推荐最新版本
- PHP hprose 扩展
- PHP mbstring 扩展 (通常默认安装)
- PHP snappy 扩展，安装 see

安装
--

[](#安装)

> 首先需要安装composer，安装方式（see [https://getcomposer.org/download/）](https://getcomposer.org/download/%EF%BC%89)

### 在已有PHP项目中加入依赖包

[](#在已有php项目中加入依赖包)

```
composer require xdapp/service-register

```

### 在新项目中使用（HelloWorld，适合新手）

[](#在新项目中使用helloworld适合新手)

1.新建文件夹，创建 `composer.json` 文件，内容：

```
{
  "minimum-stability": "stable",
  "autoload": {
    "psr-4": {
      "App\\": "src/"
    }
  },
  "require": {
    "xdapp/service-register": "^1.1"
  }
}
```

2.运行 `composer install`，稍等片刻即可安装好（若网络慢，可使用中国镜像，see [https://pkg.phpcomposer.com/）](https://pkg.phpcomposer.com/%EF%BC%89)

3.创建一个文件夹，比如叫 `service`，然后创建一个 `test.php` 文件，内容：

```
