swoft/component

基于swoole的微服务框架

v2.0.11 2021-05-07 16:51 UTC

README

Actions Status Build Status GitHub tag (latest SemVer)

此仓库用于管理所有swoft核心组件。

中文说明

中文说明请查看README.zh-CN.md

重要

所有组件将不会在ext组件的原始仓库中修改,必须在此仓库中修改,也请在此仓库中提交和推送,然后由@swoft-bot通过git subtree push同步到组件的原始仓库,注意此操作需要由仓库所有者触发。

用法

将require添加到composer.json

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

安装

composer update

单元测试

为组件快速运行测试

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

仅测试特定组件

./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. 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

版本发布

请参阅https://github.com/swoftlabs/swoft-releasecli

文档

讨论

贡献

开发团队欢迎您向我们提交PR(拉取请求),但为确保代码质量和统一风格,请访问官方主仓库swoft/swoft和开发仓库,注意贡献代码时的代码和提交格式。

提交PR时的注意事项

  • 请勿向每个子仓库提交PR,它们都是只读的
  • 核心组件的开发仓库是swoft/swoft-component
  • 扩展组件的开发仓库是swoft/swoft-ext
  • fork相应的开发仓库。修改后,请将您的PR提交到相应的开发仓库。

新版本发布时,官方会同步代码到各个子仓库

提交信息

  • 提交信息只能使用英文
  • 请尽量确保提交信息是有意义的
  • 最好以关键字add: update: fix:开始

代码风格

  • 提交的PHP代码必须遵循PSR-2代码风格
  • 合理的、有意义的类、方法、变量命名
  • 适当的注释,合理使用空白行以保持代码简洁易读
  • 不要包含一些无意义的信息,如@author等。(作者可以从提交日志中看到