sbolch/doctrine-ds-types
Composer 安装命令:
composer require sbolch/doctrine-ds-types
包简介
Doctrine DBAL types for php-ds structures.
README 文档
README
Doctrine DBAL types for php-ds structures.
Supported types
Type names map 1:1 with php-ds structures:
set=>Ds\Set(JSON array)vector=>Ds\Vector(JSON array)deque=>Ds\Deque(JSON array)stack=>Ds\Stack(JSON array)queue=>Ds\Queue(JSON array)map=>Ds\Map(JSON object)priority_queue=>Ds\PriorityQueue(PHPserialize()string)pair=>Ds\Pair(PHPserialize()string)
Installation
composer require sbolch/doctrine-ds-types
Requirements
- PHP 8.4+
ext-dsorphp-ds/php-ds- Doctrine DBAL 3.x or 4.x
Registering types (DBAL)
use Doctrine\DBAL\Types\Type; use sbolch\DoctrineDsTypes\Type\SetType; use sbolch\DoctrineDsTypes\Type\VectorType; use sbolch\DoctrineDsTypes\Type\DequeType; use sbolch\DoctrineDsTypes\Type\StackType; use sbolch\DoctrineDsTypes\Type\QueueType; use sbolch\DoctrineDsTypes\Type\MapType; use sbolch\DoctrineDsTypes\Type\PriorityQueueType; use sbolch\DoctrineDsTypes\Type\PairType; Type::addType('set', SetType::class); Type::addType('vector', VectorType::class); Type::addType('deque', DequeType::class); Type::addType('stack', StackType::class); Type::addType('queue', QueueType::class); Type::addType('map', MapType::class); Type::addType('priority_queue', PriorityQueueType::class); Type::addType('pair', PairType::class);
Symfony DBAL configuration
doctrine: dbal: types: set: sbolch\DoctrineDsTypes\Type\SetType vector: sbolch\DoctrineDsTypes\Type\VectorType deque: sbolch\DoctrineDsTypes\Type\DequeType stack: sbolch\DoctrineDsTypes\Type\StackType queue: sbolch\DoctrineDsTypes\Type\QueueType map: sbolch\DoctrineDsTypes\Type\MapType priority_queue: sbolch\DoctrineDsTypes\Type\PriorityQueueType pair: sbolch\DoctrineDsTypes\Type\PairType
Doctrine ORM mapping (example)
#[ORM\Column(type: 'set')] public Set $roles;
Notes
- JSON-backed types store
nullasnulland readnullback tonull. priority_queueusesserialize()becauseDs\PriorityQueuedoes not expose priorities via its public API.pairusesserialize()becauseDs\Pairis not JSON-serializable.
sbolch/doctrine-ds-types 适用场景与选型建议
sbolch/doctrine-ds-types 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「dbal」 「doctrine」 「data-structure」 「ds」 「php-ds」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sbolch/doctrine-ds-types 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sbolch/doctrine-ds-types 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sbolch/doctrine-ds-types 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
A custom Doctine DBAL type to use PHP DateTime objects set to the system's default timezone.
Immutable data structures based on php/ds.
Classic data structures: Queue (FIFO), Stack (LIFO), and PriorityQueue
Immutable tree data structures and operations for hierarchical data
Make pimcore migration simple
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-02