Propel
Http://propel.phpdb.org/
Propel is an Apache torque-based object persistence layer that requires PhP5 support. in fact, it allows you to use an object instead of SQL to read and write records in database tables. it provides a generator to create SQL definition files and corresponding class files based on your data model, and has a runtime engine that transparently processes Object Persistence and retrieval work. it would be easy to customize the generated classes. XML, PHP, and phing build tools make it quite easy to integrate propel into existing application frameworks.
Propel is the implementation of ORM in PHP and uses its brother project Creole as the data abstraction layer.
Its core idea is to generate SQL statements and classes through schema files in XML format and corresponding configuration files. Based on database abstraction, it is closer to each other, "hiding" the database, this allows web developers to focus on business logic. practice: The famous PHP framework symfony uses the lite version of propel. related: pear db_dataobject is another lightweight ORM implementation, but its database abstraction layer uses pear dB. ezpdo
Http://www.ezpdo.net
Ezpdo is a lightweight php orm framework. It aims to reduce complex learning curves, maintain a fairly high running speed and provide as powerful functions as possible. However, the author updates slowly. It takes several months to update a small version.
Reference from the official website
Features features
Here is a quick look at the features in ezpdoBefore you delve into any details.
- Minimum SQLKnowledge required
- SQL transparency as much as possible
- Requires minimum ORMSpecification
- Minimal ORM Configuration
- No phing!No need of explicit command line compile
- Complex command line operations are not required
- Works with existing code and database
- Work on the basis of existing databases and code
- Has a small runtime core to guarentee Performance
- There is a small runtime core to improve performance
- Handles 1: N, and M: N relationships automatically
- The relationship between 1: n, m: N can be automatically processed.
- Provides a simple Runtime API
- Provides a simple and easy-to-understand Runtime API
- Supports object query (ezoql)
- Support for Object Query (ezoql) Note: it seems that it is not fully implemented, just like the hql name of hibernate.
- Auto generates database tables
- Automatically generate database tables
- Test-driven with continuous integration
- Test-driven continuous integration
Licence
EzpdoIs an open source project and uses the BSD license.
The BSD Protocol means that you can use it freely. to modify the software source code, you must include or specify the BSD Protocol in your released source package.
ORM in frameworks
Many development frameworks implement Orm.
Picora provides the implementation of activerecord classes and a cache and serialization implementation. The current version is 0.4.
Thinkphp is one of the most famous open-source PHP frameworks in China. It imitates struts in the template engine. It provides the ORM implementation named VO (valueobject). Since I have not read the source code, it is similar to ezpdo in terms of usage.
Fleaphp is another famous open-source PHP framework in China. The author dualface is furious. It provides the tablegateway ORM implementation.
Zend framework (ZF) is a masterpiece of PHP's parent company Zend. At present, Zend 1.0 production version has been released. In addition to providing encapsulation of SQL statements, tablegateway, tablerowset, and tablerow are also implemented.
Summary
In terms of functions, whether it is the activerecord mode or tablegateway, dealing with simple queries can indeed reduce the development difficulty and improve the development efficiency; however, they are not good at handling complex associations and SQL nested expressions. In addition, due to the weak Object Persistence function of PHP, the speed of the ORM is not flattering. The test results are generally 10-10 slower than that of native SQL ~ 50 times.
In large projects, I want to use Orm, but I am afraid of the complexity that may occur. If you use pure SQL forcibly, it is likely to cause data cache conflicts and damage to the internal Association of ORM.
I am very disappointed with this. Isn't RDBMS really designed for OO. Without looking at hibernate carefully, I don't know how powerful Hibernate is, but the complicated configuration file of Hibernate is daunting. I think this is not the true meaning of ORM.
Although the models model in Django is somewhat less functional than the most powerful sqlalchemy in Python, it is also written in a way similar to db_select in ZF, but it uses the powerful introspection function of Python, django models is still a beautiful and easy-to-use Orm. I think it is not very difficult to port Django's ORM to PhP, but there is still a big gap between me to do this, therefore, we hope that people with good intentions can make such a beneficial attempt.