定制 small/swoole-entity-manager-core 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

small/swoole-entity-manager-core

Composer 安装命令:

composer require small/swoole-entity-manager-core

包简介

ORM designed for swoole. This is the core package. Use it for your from scratch implementation.

README 文档

README

Small Swoole Entity Manager is a php ORM designed for swoole.

This is the core package.

Install

Require the package with composer:

composer require small/swoole-entity-manager-core

Swoole 6

Version 2.5.10 fixes three relational/database compatibility defects exposed by stratified persistence: composite-key joins now chain additional predicates with AND, PostgreSQL connections accept an explicit port (default 5432), and MySQL / PostgreSQL date-time hydration accepts fractional seconds without returning false.

Version 2.5.9 isolates the entity-manager cache per EntityManagerFactory instance. Factories using different connection configurations can no longer reuse a manager created by another factory, preventing cross-test and cross-connection state leakage.

Version 2.5.8 makes the expanded coverage suite independent from a stale Composer classmap. PHPUnit loads tests/bootstrap.php explicitly, and fresh Composer installs also register it through autoload-dev.files. This supports source updates performed over an existing vendor directory without producing Class ... not found failures.

Version 2.5.7 raises the enforced line-coverage threshold to 90% and expands unit, integration, relation, persistence, layer, query-builder, and error-path tests. The coverage command deletes stale reports before every run and fails below 90%.

Version 2.5.6 restores generated-key propagation for small-swoole-db persist threads. PersistThread::flush(true) executes inserts individually only for connections marked with PerInsertLastInsertIdInterface, so each entity receives its own generated key and original primary-key snapshot. MySQL and PostgreSQL batches remain merged.

Since version 2.5, the MySQL connector uses native PDO instead of the removed Swoole\Coroutine\MySQL client. Swoole 6 makes PDO MySQL coroutine-aware through runtime hooks.

Enable hooks once during application bootstrap, before database I/O:

if (class_exists(\Swoole\Runtime::class)) {
    \Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
}

The connection pool still assigns one PDO connection to one coroutine at a time. Connections must not be shared concurrently between coroutines.

The development image uses PHP 8.4 and Swoole 6.2.1:

docker compose up -d --build
docker compose exec test-small-swoole-entity-manager composer install
docker compose exec test-small-swoole-entity-manager composer tests

Run the complete validation suite with:

./bin/composer tests

Coverage

The test command generates a fresh XML coverage report and enforces at least 90% line coverage:

./bin/composer unit-tests

The covered source scope is unchanged. PostgreSQL remains excluded from this package's current coverage report because its integration suite is not enabled in phpunit.xml; no additional exclusions were introduced to reach the threshold.

Semantic releases

Run the release script from the main or master branch:

bin/release --patch  # 2.6.4 -> 2.6.5
bin/release --minor  # 2.6.4 -> 2.7.0
bin/release --major  # 2.6.4 -> 3.0.0

The script builds the Docker Compose environment, runs the validation suite, updates .version, commits, tags, and pushes the release. The supported SemVer parts are only patch, minor, and major.

small/swoole-entity-manager-core 适用场景与选型建议

small/swoole-entity-manager-core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 145 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 07 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「orm」 「Entity Manager」 「swoole」 「openswoole」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 small/swoole-entity-manager-core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 small/swoole-entity-manager-core 我们能提供哪些服务?
定制开发 / 二次开发

基于 small/swoole-entity-manager-core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 145
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 14
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2024-07-12