PHPackages                             esd/base-server - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. esd/base-server

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

esd/base-server
===============

base-server

0.64(7y ago)20246MIT

Since Apr 25Compare

[ Source](https://github.com/esd-projects/base-server)[ Packagist](https://packagist.org/packages/esd/base-server)[ RSS](/packages/esd-base-server/feed)WikiDiscussions Synced 3d ago

READMEChangelog (10)Dependencies (6)Versions (67)Used By (0)

base-server
===========

[](#base-server)

基础服务

封装swoole，模块更科学更易用

```
class MyPort extends DefaultServerPort
{

}

class MyProcess extends DefaultProcess
{

}

enableRuntimeCoroutine();

//----多端口配置----
$httpPortConfig = new PortConfig();
$httpPortConfig->setHost("0.0.0.0");
$httpPortConfig->setPort(8080);
$httpPortConfig->setSockType(PortConfig::SWOOLE_SOCK_TCP);
$httpPortConfig->setOpenHttpProtocol(true);

$wsPortConfig = new PortConfig();
$wsPortConfig->setHost("0.0.0.0");
$wsPortConfig->setPort(8081);
$wsPortConfig->setSockType(PortConfig::SWOOLE_SOCK_TCP);
$wsPortConfig->setOpenHttpProtocol(true);

//---服务器配置---
$serverConfig = new ServerConfig();
$serverConfig->setWorkerNum(4);
$serverConfig->setLogFile(__DIR__ . "/../swoole.log");
$serverConfig->setPidFile(__DIR__ . "/../pid");

$server = new DefaultServer($serverConfig);

try {
    //添加端口
    $httpPort = $server->addPort($httpPortConfig, MyPort::class);//使用自定义实例
    $wsPort = $server->addPort($wsPortConfig);//使用默认实例
    //添加进程
    $test1Process = $server->addProcess("test1");
    $test2Process = $server->addProcess("test2", MyProcess::class);//使用自定义实例
    //配置
    $server->configure();
    //启动
    $server->start();
} catch (Exception $e) {
    var_dump($e->getTrace());
}

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity65

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

65

Last Release

2596d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34264874?v=4)[SwooleDistributed](/maintainers/SwooleDistributed)[@SwooleDistributed](https://github.com/SwooleDistributed)

---

Tags

serverswoole

### Embed Badge

![Health badge](/badges/esd-base-server/health.svg)

```
[![Health](https://phpackages.com/badges/esd-base-server/health.svg)](https://phpackages.com/packages/esd-base-server)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k59](/packages/open-dxp-opendxp)[oro/platform

Business Application Platform (BAP)

642140.7k110](/packages/oro-platform)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k45](/packages/friendsoftypo3-content-blocks)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
