bradchesney79/propel3
Composer 安装命令:
composer require bradchesney79/propel3
包简介
High performance data-mapper ORM with optional active-record traits for RAD and modern PHP 7.1+
README 文档
README
Propel3 is an open-source Object-Relational Mapping (ORM) for modern PHP 7.1+.
It is also written and maintained by people better and smarter than I am-- there wasn't an existing Propel3 on packagist. There is now...
So, this github repo and packagist entry exists solely for me to put into my PHP package.json, you are free to use it. But, know that once a valid propelorm/propel3 packagist package becomes available that I will begin using that and not maintaining this one.
Version 3 of Propel ORM replaces Propel2, which is not maintained anymore. Propel3 introduces a data-mapper implementation which separates your entities from the actual persisting logic.
Status
This is in current development and is not yet ready to use.
Features
- Propel is blazing fast
- Data mapper with runtime UnitOfWork for high performance with massive object counts (bulks inserts/updates)
- Query-Builder
- Very IDE friendly thanks to code-generation
- Generation of methods for all columns and relations
- Database schema migration
- Schema reverse engineering
- Customizable
- Propel comes with common ‘behaviors’
- Completely unit tested for MySQL, PostgreSQL, SQLite. Oracle and MSSQL are experimental.
Example
Define the entity
XML
<database name="default"> <entity name="Vendor\Car"> <field name="id" primaryKey="true" autoIncrement="true" type="INTEGER" /> <field name="name" type="VARCHAR" required="true" /> <relation target="Publisher" onDelete="setnull"/> <relation target="Author" onDelete="setnull" onUpdate="cascade"/> </entity> </database>
or annotations
In work.
namespace Vendor use Propel\Annotations\Entity; use Propel\Annotations\Field; use Propel\Annotations\PrimaryKey; /** * @Entity() */ class Car { /** * @PrimaryKey(auto_increment=true) */ private $id; /** * @Field(type="VARCHAR") */ private $name; // getters/setters }
Data mapper
$propel = new Propel\Runtime\Configuration('path/to/propel.yml'); // require a session for each request/workload $session = $propel->getSession(); $car = new Vendor\Car(); $car->setName('Ford'); $session->persist($car); $session->commit();
RAD/Active-record
// use <entity name="Vendor\Car" activeRecord="true"> $car = new Vendor\Car(); $car->setName('Ford'); $car->save();
Installation
Read the Propel documentation. This documentation is for Propel2 still.
Contribute
Everybody can contribute to Propel. Just fork it, and send Pull Requests. You have to follow PSR2 coding standards and provides unit tests as much as possible.
Please see our contribution guideline. Thank you!
License
See the LICENSE file.
bradchesney79/propel3 适用场景与选型建议
bradchesney79/propel3 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 11 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「orm」 「persistence」 「Active Record」 「data mapper」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bradchesney79/propel3 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bradchesney79/propel3 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bradchesney79/propel3 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This bundle provides tools to build persistence-agnostic storage layer.
Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.5 and up.
Kinikit - PHP Application development framework MVC component
A Symfony extension to get active class base on current bundle/controller/action
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
LDAP user provider bundle for Symfony 6.4
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-07
