|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: May 2003
Location: virginia
Posts: 991
|
Advice on a 'bigger' site. PEAR opinions?
I'm re-building a website that is pretty large in that it has members, member "storefronts" all kinds of categories that change dynamically, an admin front-end, etc...
The site is built from PEAR: B and Smarty now. I didn't want to re-build it using PEAR, or Smarty but...I started messing around with PEAR DB_DataObject tonight and I'm blown away at how easy it is to access "entities" now. It's so easy that it doesn't matter to me if the PEAR code is what some people call "bloated". This is going to make my life so much easier. I'm wondering if anyone has any experience with any of the following classes: DB DB_DataObject HTML_QuickForm HTTP_Upload DB_Pager Pros/Cons? I know there are a lot of tutorials out there, but I want some real feedback. I've actually always been oppossed to using large, open-source libraries (because it's so much more fun for me to code), but if these packages are *stable*, that's all that matters. Thanks! Matt |
|
|
|
|
|
#2 |
|
My precious!!!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2002
Location: Vancouver, BC
Posts: 2,021
|
I just thought I'd toss in another question:
Does the pearDB package have any edge of the eclipse package by Vincent? |
|
|
|
|
|
#3 | |
|
No.
![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2001
Location: Nottingham, UK
Posts: 1,147
|
Quote:
|
|
|
|
|
|
|
#4 | |
|
SitePoint Zealot
![]() ![]() Join Date: Jan 2003
Location: Belgium
Posts: 133
|
Quote:
I see you found your way to DB_DataObject too that package alone made me consider PEAR too.Now I'm working on my own PEAR based framework (actually, the framework itself is based on Ismo, ismo.sf.net, while most of the added functionality stems from PEAR based work). I even got involved in a couple of projects myself. If you like DB_DataObject, I can recommend DB_DataObject_Formbuilder which can create QuickForm forms form your DBDO. You can customize the form in any way you like. So I would recommend QuickForm too. To me the talks about the PEAR bloat seem to originate from complete ignorence. Plus, even if they were really, bloated (they're not!!), the added value and convenience that help to create apps faster, far outweights that. Besides, servers get faster everyday, so it's easy to compensate if needed. Hardware is cheaper than development time IMHO. Why is it that PEAR always gets so much bad press on these boards? There are lots of efficient and usefull packages in PEAR, good quality stuff really. Most of the packages submitted nowadays are worth their salt IMHO. - prefab |
|
|
|
|
|
|
#5 | ||
|
SitePoint Victim
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Apr 2003
Location: London
Posts: 2,265
|
Hi...
Quote:
Quote:
.I guess it depends on whether you have been burned. yours, Marcus |
||
|
|
|
|
|
#6 | ||
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: May 2003
Location: virginia
Posts: 991
|
Quote:
Quote:
How do you mean implement myself? You mean seperate the package from the PEAR library, or write my own DataObject class/library? If you are talking about my own, could you maybe give me a few tips in the right direction? I've been using the MyDatabase from Eclipse for a long time, and haven't had any problems. Anyone want to write out an example of a DAO/DataObject class using Eclipse Database? - would just love to see it! I have tried, and could post some examples of what I've done.Thanks for all of the feedback! Matt |
||
|
|
|
|
|
#7 | |
|
SitePoint Victim
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Apr 2003
Location: London
Posts: 2,265
|
Hi...
Quote:
.yours, Marcus |
|
|
|
|
|
|
#8 | |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: May 2003
Location: virginia
Posts: 991
|
Quote:
Matt |
|
|
|
|
|
|
#9 | |
|
eschew sesquipedalians
![]() Join Date: Jun 2003
Location: Iowa, USA
Posts: 3,764
|
Off Topic: Quote:
)
|
|
|
|
|
|
|
#10 | |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: May 2003
Location: virginia
Posts: 991
|
Quote:
Are you still open to posting some code? I know you're probably busy, just thought I'd let you know that I'm still very interested! Thanks, Matt |
|
|
|
|
|
|
#11 | |
|
No.
![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2001
Location: Nottingham, UK
Posts: 1,147
|
Quote:
PHP Code:
|
|
|
|
|
|
|
#12 | |
|
SitePoint Member
Join Date: Jan 2002
Location: My Chair
Posts: 22
|
Quote:
? ta in advance ![]() |
|
|
|
|
|
|
#13 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2003
Location: Wixom, Michigan
Posts: 619
|
I have to agree with Marcus that one of the biggest problems PEAR has is error handling. AFAIK, its implemented by methods returning an "error object" as oppossed to "False" when they fail. Given that PHP provides you with very customizable error handling hooks, this is not only unnecesary, but completely contrary to many coding guidelines I have heard over the years. As much as I can, I always try to return false from a method that fails or throws an error.
|
|
|
|
|
|
#14 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Aug 2002
Location: Winnipeg, Manitoba, Canada
Posts: 214
|
Quote:
"False means error except in this case where null means error". What happens when both null and false are acceptable? Then -1 means error? Etc... An error object prevents this... if an error object is returned, there is no doubt that an error is the result. Just my belated $0.02! Cheers, Keith. |
|
|
|
|
|
|
#15 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: May 2002
Location: Gent, Belgium
Posts: 283
|
Quote:
Suppose you wrote a nice db-abstraction layer, implemented DAO's, etc... and all of a sudden, the column names of the articles' db table get changed for whatever reason, then you'd still have to change code in the 'other layer' because the column names are reflected in the keys of the array... |
|
|
|
|
|
|
#16 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2003
Location: Wixom, Michigan
Posts: 619
|
Perhaps throwable exceptions in PHP 5 will solve both your concerns about how to define an error and mine about mantaining error handler independance?
|
|
|
|
|
|
#17 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
Late as well - on those packages;
DB - is very solid. The code could be better optimized but it does what it says on the label - DB gets heavy use and is great when you want to "step into" a database you don't know so well. DB_DataObject - like some of the principles. The generated code you probably need to subclass with your own class so you have "fixed api" for the rest of your app. It may be I was using it wrong but I found handling table relationships cumbersome via the DB_DataObject API but otherwise it's useful to shortcut the time spent on writing (testing) hand coded SQL. Code seems a little monolithic last time I looked - lot of code in one file - might benefit from breaking it up. HTML_QuickForm - great for a quick solution (e.g. a single page that needs a solid form) - very powerful in fact and does alot to keep you secure. Last time I tried passing an instance of quickform to another object though, things went badly wrong - seems to rely on access to globals or something - that kind reduces the sphere to which QuickForm can be used for. HTTP_Upload, DB_Pager, Mail - no idea. Overall, quality in PEAR varies - there's some great stuff and some that needs work. Really we should submit refactorings to the developers - in many cases it should be well received. Also if the lead developer has gone quiet, you may be able to take over running a PEAR package. PEAR packages in general save you development time but may cost you later - really you need is to research in spare time and find what you like - that means reading source code. Also most PEAR code is not designed for performance (today). E.g. 90% start with; PHP Code:
Overall I've grown to like PEAR but in some cases, it does need work. Best is to get involved and see if you can change things. The current leaders of PEAR are aware of the weaknesses and open to suggestions for improvment (or better yet offers to help with coding). |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 01:56.




B and Smarty now. I didn't want to re-build it using PEAR, or Smarty but...

that package alone made me consider PEAR too.
.
- would just love to see it! I have tried, and could post some examples of what I've done.



Hybrid Mode
