cmdconfig/doctrine-extensions
Composer 安装命令:
composer require cmdconfig/doctrine-extensions
包简介
Doctrine2 behavioral extensions
关键字:
README 文档
README
Version 2.4.2
Note: Extensions 2.4.x are compatible with ORM and doctrine common library versions from 2.2.x to 2.5.x. ORM 2.5.x versions require PHP 5.4 or higher.
Note: Extensions 2.3.x are compatible with ORM and doctrine common library versions from 2.2.x to 2.4.x
Latest updates
2015-05-01
- Reverted back 1272 and see 1263. Use naming strategy for your use cases.
- Fixed bug for sortable 1279
2015-03-26
Support for ORM and Common library 2.5.0. A minor version bump, because of trait column changes.
2015-01-28
Fixed the issue for all mappings, which caused related class mapping failures, when a relation or class name was in the same namespace, but extensions required it to be mapped as full classname.
2015-01-21
Fixed memory leak issue with entity or document wrappers for convenient metadata retrieval.
Summary and features
This package contains extensions for Doctrine2 that hook into the facilities of Doctrine and offer new functionality or tools to use Doctrine2 more efficiently. This package contains mostly used behaviors which can be easily attached to your event system of Doctrine2 and handle the records being flushed in the behavioral way. List of extensions:
- Tree - this extension automates the tree handling process and adds some tree specific functions on repository. (closure, nestedset or materialized path)
- Translatable - gives you a very handy solution for translating records into different languages. Easy to setup, easier to use.
- Sluggable - urlizes your specified fields into single unique slug
- Timestampable - updates date fields on create, update and even property change.
- Blameable - updates string or reference fields on create, update and even property change with a string or object (e.g. user).
- Loggable - helps tracking changes and history of objects, also supports version management.
- Sortable - makes any document or entity sortable
- Translator - explicit way to handle translations
- SoftDeleteable - allows to implicitly remove records
- Uploadable - provides file upload handling in entity fields
- References - supports linking Entities in Documents and vice versa
- RererenceIntegrity - constrains ODM MongoDB Document references
- IpTraceable - inherited from Timestampable, sets IP address instead of timestamp
Currently these extensions support Yaml, Annotation and Xml mapping. Additional mapping drivers can be easily implemented using Mapping extension to handle the additional metadata mapping.
Note: Please note, that xml mapping needs to be in a different namespace, the declared namespace for Doctrine extensions is http://gediminasm.org/schemas/orm/doctrine-extensions-mapping So root node now looks like this:
Note: Use 2.1.x tag in order to use extensions based on Doctrine2.1.x versions. Currently master branch is based on 2.2.x versions and may not work with 2.1.x
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> ... </doctrine-mapping>
XML mapping xsd schemas are also versioned and can be used by version suffix:
- Latest version - http://gediminasm.org/schemas/orm/doctrine-extensions-mapping
- 2.2.x version - http://gediminasm.org/schemas/orm/doctrine-extensions-mapping-2-2
- 2.1.x version - http://gediminasm.org/schemas/orm/doctrine-extensions-mapping-2-1
ODM MongoDB support
List of extensions which support ODM
- Translatable
- Sluggable
- Timestampable
- Blameable
- Loggable
- Translator
- Tree (Materialized Path strategy for now)
- References
- ReferenceIntegrity
All these extensions can be nested together and mapped in traditional ways - annotations, xml or yaml
Running the tests:
pdo-sqlite extension is necessary. To setup and run tests follow these steps:
- go to the root directory of extensions
- download composer:
wget https://getcomposer.org/composer.phar - install dev libraries:
php composer.phar install - run:
bin/phpunit -c tests - optional - run mongodb service if targeting mongo tests
Running the example:
To setup and run example follow these steps:
- go to the root directory of extensions
- download composer:
wget https://getcomposer.org/composer.phar - install dev libraries:
php composer.phar install - edit
example/em.phpand configure your database on top of the file - run:
./example/bin/consoleorphp example/bin/consolefor console commands - run:
./example/bin/console orm:schema-tool:createto create schema - run:
php example/run.phpto run example
Contributors:
Thanks to everyone participating in the development of these great Doctrine2 extensions!
And especially ones who create and maintain new extensions:
- Lukas Botsch lbotsch
- Gustavo Adrian comfortablynumb
- Boussekeyt Jules gordonslondon
- Kudryashov Konstantin everzet
- David Buchmann dbu
cmdconfig/doctrine-extensions 适用场景与选型建议
cmdconfig/doctrine-extensions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.06k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 07 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tree」 「behaviors」 「doctrine2」 「extensions」 「gedmo」 「sluggable」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cmdconfig/doctrine-extensions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cmdconfig/doctrine-extensions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cmdconfig/doctrine-extensions 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
jsTree widget for yii2
An extension of ScnSocialAuth that provides integration with Doctrine2 ORM.
Doctrine2 behavior traits - slowhop fork
Doctrine2 behavior traits
A fast and dynamic Merkle tree implementation
Elasticsearch PHP integration for your Symfony project using Elastica
统计信息
- 总下载量: 1.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-10