• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

php should I use pear?

I have a php site that I am going to be totally re-writing soon.  It currently is not object oriented in any way, and I want to start using classes.  I wrote most of it a long time ago, when I don't really think php had classes, or at least, I didn't know about them.

Anyway, I will be using mysql forever and plan to use a db class anyway, so if I ever want to switch my db, I am not worried about re-writing one class.  So the ability to switch db's is of no use to me.

Should I use pear?  I am worried about having to install a bunch of stuff on my servers (I have one template site that I deploy to a ton of different sites all the time.  I could potentially switch hosting companies in the future, and want this as light as possible.)

1 Solution

Packing PEAR with your product is not hard, the only thing you have to do is to copy the pear directory (with only the extensions your are using) to your site. These files can take as much as 4mb (it is a bunch of files)(but you can keep it low if you want by not  putting the stuff  you dont use) so its good to have that thing in mind. I for one use PEAR MDB2 and PEAR HTML_Template_IT (and sometimes the DataObject) all the time. I would say you should use html_tempalte_it for your templates and MDB2 for the db connection or DataObjects if you want to have objects that represent each table. Use ini_set("include_path", "./path_to_YOUR_local_pear/") to make the includes locally in your project.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now