josbeir/cakephp-uid
Composer 安装命令:
composer require josbeir/cakephp-uid
包简介
CakePHP plugin that provides various UID types for the ORM
README 文档
README
CakePHP UID Plugin
A CakePHP plugin providing a collection of UID field types for your applications.
You can follow ongoing discussion about native UID support on the official CakePHP issue tracker here. This plugin provides a solution until more convenient support is available in CakePHP core.
Features
- UUIDv4 field type
- UUIDv6 field type
- UUIDv7 field type
- ULID field type
Easily add modern, sortable unique identifiers to your CakePHP models.
Installation
Install via Composer:
composer require josbeir/cakephp-uid
Usage
Before using the UID field types in your schema, you need to map them using TypeFactory::map in your application bootstrap or plugin initialization:
If you want to use these types instead of CakePHP's native ones, you need to override the original types as shown below. CakePHP will handle the rest based on your database field settings.
- For UUID: use column type
UUID(when supported by your db) orBINARY(16)orCHAR(36): - FOR ULID: use column type
BINARY(16)orCHAR(26): - Remember that a UUID/BINARY is prefererd for performance reasons.
TypeFactory::map('binaryuuid', BinaryUuidV7Type::class); // Uses UUID V7 TypeFactory::map('binaryuuid', BinaryUlidType::class); // Uses ULID
Other possibilities:
TypeFactory::map('uuidv4', UuidV4Type::class); TypeFactory::map('uuidv6', UuidV6Type::class); TypeFactory::map('uuidv7', UuidV7Type::class); TypeFactory::map('ulid', UlidType::class); TypeFactory::map('binaryuuidv4', BinaryUuidV4Type::class); TypeFactory::map('binaryuuidv6', BinaryUuidV6Type::class); TypeFactory::map('binaryuuidv7', BinaryUuidV7Type::class); TypeFactory::map('binaryulid', BinaryUlidType::class);
Underlying Library
This plugin utilizes the Symfony UID component to generate, validate, and convert UIDs. Refer to the Symfony documentation for advanced usage and interoperability details.
License
Contributing
Pull requests are welcome. For major changes, please open an issue first.
josbeir/cakephp-uid 适用场景与选型建议
josbeir/cakephp-uid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 167 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 08 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「orm」 「cakephp」 「uuid」 「UID」 「ulid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 josbeir/cakephp-uid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 josbeir/cakephp-uid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 josbeir/cakephp-uid 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Kinikit - PHP Application development framework MVC component
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
DrUUID RFC 4122 library for PHP
Trait to generate uuid when creating models
Email Toolkit Plugin for CakePHP
统计信息
- 总下载量: 167
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-09