PHPackages                             swoft/component - 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. [Framework](/categories/framework)
4. /
5. swoft/component

ActiveLibrary[Framework](/categories/framework)

swoft/component
===============

micro-service framework base on swoole

v2.0.11(5y ago)95882103[4 issues](https://github.com/swoft-cloud/swoft-component/issues)[6 PRs](https://github.com/swoft-cloud/swoft-component/pulls)1Apache-2.0PHPPHP &gt;7.1.0

Since Apr 3Pushed 3y ago15 watchersCompare

[ Source](https://github.com/swoft-cloud/swoft-component)[ Packagist](https://packagist.org/packages/swoft/component)[ RSS](/packages/swoft-component/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (13)Versions (14)Used By (1)

Swoft Component
===============

[](#swoft-component)

[![Actions Status](https://github.com/swoft-cloud/swoft-component/workflows/Unit-tests/badge.svg)](https://github.com/swoft-cloud/swoft-component/actions)[![Build Status](https://camo.githubusercontent.com/4c079ae3836919dad6ff3c720b1ff7a5e77612de2c9b87880fdc01b657130236/68747470733a2f2f7472617669732d63692e6f72672f73776f66742d636c6f75642f73776f66742d636f6d706f6e656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/swoft-cloud/swoft-component)[![GitHub tag (latest SemVer)](https://camo.githubusercontent.com/7fbbc36ae36edd8ec5f85e63ba091fe6d5c9a220010550ba8298b1e699170e9b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f73776f66742d636c6f75642f73776f66742d636f6d706f6e656e74)](https://github.com/swoft-cloud/swoft-component)

This repository is used to manage all swoft core components.

[中文说明](README.zh-CN.md)
-----------------------

[](#中文说明)

中文说明请查看 [README.zh-CN.md](README.zh-CN.md)

IMPORTANT
---------

[](#important)

All components will **NOT** be modified in the original repository of ext component, **SHOULD ALWAYS** be modified in this repository, also commit and push to this repository, and then @swoft-bot would sync changes to the original repository of component by `git subtree push`, notice that this action needs triggered by the repositories owner.

Usage
-----

[](#usage)

Add require to `composer.json`

```
"require": {
    "swoft/ext": "dev-master as 2.0"
}
```

Install:

```
composer update
```

### Unit Tests

[](#unit-tests)

Quick run tests for component:

```
// For all components
./phpunit.sh all
// For multi components
./phpunit.sh db event
// For one component
./phpunit.sh event
```

Only tests an special component:

```
./phpunit.sh event
// use run.php
php run.php -c src/event/phpunit.xml
// filter test method name
php run.php -c src/event/phpunit.xml --filter testAddModule
```

Output coverage data:

```
// output coverage. require xdebug ext
phpunit --coverage-text
// output coverage without xdebug
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
phpdbg -dauto_globals_jit=Off -qrr run.php --coverage-text -c src/event/phpunit.xml
```

Releases
--------

[](#releases)

Please see

Document
--------

[](#document)

- [中文文档](https://www.swoft.org/docs)
- [English](https://en.swoft.org/docs)

Discuss
-------

[](#discuss)

- Forum
- Gitter.im
- Reddit
- QQ Group1: 548173319
- QQ Group2: 778656850

Contributing
------------

[](#contributing)

The development team welcomes you to submit PR (*Pull Request*) to us, but to ensure code quality and uniform style, go to the official main repository [swoft/swoft](https://github.com/swoft-cloud/swoft) and Development repository, Note the code and commit format when contributing code

### Precautions when initiating PR

[](#precautions-when-initiating-pr)

- Please do not submit PR to each sub-repository, they are all read-only
- The *development repository* for the core components is **[swoft/swoft-component](https://github.com/swoft-cloud/swoft-component)**
- The *development repository* for extension components is **[swoft/swoft-ext](https://github.com/swoft-cloud/swoft-ext)**
- Please `fork` the corresponding development warehouse. After modification, please submit your PR to the corresponding development warehouse.

> Officially syncs code to individual sub-warehouses when new versions are released

### Commit Message

[](#commit-message)

- the commit message can only be in English
- Please try to ensure that the commit message is meaningful
- it is best to start with the keyword `add:` `update:` `fix:`

### Code Style

[](#code-style)

- Submitted PHP code **Must** Follow PSR-2 code style
- Reasonable and meaningful class, method, variable naming
- Appropriate comments, reasonable use of blank lines to keep the code simple and easy to read
- Don't include some meaningless information such as `@author`, etc. (*author is that can be seen from the commit log*)

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community34

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~74 days

Recently: every ~134 days

Total

10

Last Release

1880d ago

Major Versions

1.x-dev → v2.0.62019-09-20

PHP version history (2 changes)v2.0.3PHP &gt;7.1.0

1.x-devPHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![inhere](https://avatars.githubusercontent.com/u/5302062?v=4)](https://github.com/inhere "inhere (1061 commits)")[![stelin](https://avatars.githubusercontent.com/u/1677543?v=4)](https://github.com/stelin "stelin (888 commits)")[![huangzhhui](https://avatars.githubusercontent.com/u/12077148?v=4)](https://github.com/huangzhhui "huangzhhui (276 commits)")[![sakuraovq](https://avatars.githubusercontent.com/u/30211214?v=4)](https://github.com/sakuraovq "sakuraovq (196 commits)")[![swoft-bot](https://avatars.githubusercontent.com/u/43714909?v=4)](https://github.com/swoft-bot "swoft-bot (51 commits)")[![limingxinleo](https://avatars.githubusercontent.com/u/16648551?v=4)](https://github.com/limingxinleo "limingxinleo (51 commits)")[![aprchen](https://avatars.githubusercontent.com/u/13740363?v=4)](https://github.com/aprchen "aprchen (26 commits)")[![whiteCcinn](https://avatars.githubusercontent.com/u/13690966?v=4)](https://github.com/whiteCcinn "whiteCcinn (25 commits)")[![panyongwei](https://avatars.githubusercontent.com/u/6112421?v=4)](https://github.com/panyongwei "panyongwei (17 commits)")[![DeivaLiang](https://avatars.githubusercontent.com/u/12182319?v=4)](https://github.com/DeivaLiang "DeivaLiang (13 commits)")[![wvfeng](https://avatars.githubusercontent.com/u/33809027?v=4)](https://github.com/wvfeng "wvfeng (8 commits)")[![sentrychen](https://avatars.githubusercontent.com/u/10239273?v=4)](https://github.com/sentrychen "sentrychen (6 commits)")[![HZMarico](https://avatars.githubusercontent.com/u/15900595?v=4)](https://github.com/HZMarico "HZMarico (6 commits)")[![phpmathan](https://avatars.githubusercontent.com/u/527140?v=4)](https://github.com/phpmathan "phpmathan (6 commits)")[![wujunze](https://avatars.githubusercontent.com/u/12997869?v=4)](https://github.com/wujunze "wujunze (5 commits)")[![anhoder](https://avatars.githubusercontent.com/u/27605589?v=4)](https://github.com/anhoder "anhoder (4 commits)")[![andiechang](https://avatars.githubusercontent.com/u/7233960?v=4)](https://github.com/andiechang "andiechang (4 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![luxin88](https://avatars.githubusercontent.com/u/874056?v=4)](https://github.com/luxin88 "luxin88 (3 commits)")[![assert6](https://avatars.githubusercontent.com/u/28561563?v=4)](https://github.com/assert6 "assert6 (3 commits)")

---

Tags

aopcoroutinemicroserviceswoftswoolephpswooleswoftswoft-component

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/swoft-component/health.svg)

```
[![Health](https://phpackages.com/badges/swoft-component/health.svg)](https://phpackages.com/packages/swoft-component)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

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

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[laravel/framework

The Laravel Framework.

34.8k532.1M19.5k](/packages/laravel-framework)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[silverstripe/framework

The SilverStripe framework

7223.7M2.7k](/packages/silverstripe-framework)[contao/core-bundle

Contao Open Source CMS

1231.6M2.7k](/packages/contao-core-bundle)

PHPackages © 2026

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