| Author |
Message |
|
Seikilos
|
Post subject: Use ORM as database abstraction layer Posted: Sat Feb 27, 2010 11:17 am |
|
Joined: Sat Feb 27, 2010 9:42 am Posts: 30
|
As noted in this thread: viewtopic.php?f=5&t=99&p=464#p464A bug in PHP causes IP to malfunction on some php plattforms. Here is a request to move the entire Database handling to an ORM. I propose Propel here ( http://propel.phpdb.org/trac/) You get an abstraction layer which allows you to work on mysql, oracle sql, mssql, sqlite and so on without doing the whole query stuff by hand. You also can use the generator abilities of an ORM to avoid manual sql handling and you get all your tables wrapped in very usefull Objects which enforce OOP. There are other ORMs like Doctrine which I do not recommend since Propel is more mature and better in terms of speed and language-query-clearness. Again no offence, but I spent half a day debugging stuff which could be easily avoided
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sat Feb 27, 2010 1:08 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
We are listening. What the others think about this idea?
|
|
 |
|
 |
|
Sokolowski
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sun Feb 28, 2010 7:01 pm |
|
Joined: Tue Nov 24, 2009 12:10 pm Posts: 111
|
IP is not compatibile with 5.2, crashes only on some 5.3.0, can by installed > 5.3.1. IMHO for now modules are more important. 5.3.0 will by replace very soon as all ISP with 5.3 will upgrade it. Now bigger problem is to have hosting with 5.3 
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sun Apr 18, 2010 8:15 am |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
 |
|
 |
|
Seikilos
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sun Apr 18, 2010 8:44 am |
|
Joined: Sat Feb 27, 2010 9:42 am Posts: 30
|
|
It does not provide relation rows as objects, am i right?
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sun Apr 18, 2010 2:04 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
 |
|
 |
|
Seikilos
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sun Apr 18, 2010 2:07 pm |
|
Joined: Sat Feb 27, 2010 9:42 am Posts: 30
|
No, it doenst, this just uses the mysql fetch call and retrieve sets as simple objects. An ORM like Propel would not mess with sql on user side. You would write sth like Code: $u = new User(); $u->setName("foo"); $u->setAge(12); $u->setFriend($otherUser); $u->save(); // this saves the object into database
So you see it creates objects from schema definition, it recognizes foreign key relations, support 1-n, 1-1, n-m relations
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sun Apr 18, 2010 3:01 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
But I think it is much slower. No?
And why do you suggest Propel? What do you think about Doctrine?
|
|
 |
|
 |
|
Seikilos
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sun Apr 18, 2010 3:07 pm |
|
Joined: Sat Feb 27, 2010 9:42 am Posts: 30
|
|
Sure all the logic requires cpu cycles but propel is used in some frameworks and some big enterprise sites since you can tune the performance and you win much more from an OOP DB approach.
Doctrine ist regarded slower and not that mature than propel, the DQL (Doctrine query language) is also more restricted in some cases. However I tried both and Propel won and still wins for me
|
|
 |
|
 |
|
maskas
|
Post subject: Re: Use ORM as database abstraction layer Posted: Sat Apr 24, 2010 6:36 pm |
|
 |
| Project Developer |
Joined: Tue Apr 28, 2009 9:43 am Posts: 1720
|
|
How about installation? Does it possible to install Propel on all shared hosting servers? The requirements look very huge and requires access to command line. Right?
|
|
 |
|
 |
|