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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 small/swoole-entity-manager-core 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Runn Me! Value Objects Library
Kinikit - PHP Application development framework MVC component
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
generates php entities from openapi spec
DCSDynamicDiscriminatorMapBundle simplifies the use of Doctrine Single Table Inheritance mapping strategy in Symfony2.
统计信息
- 总下载量: 145
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2024-07-12