Page 1 of 2

What Class/Library you use to speed up project development

Posted: Thu Oct 02, 2003 11:32 pm
by chrislee
I use the following Free and Open Source Class / Library to speed up development :

Template: Smarty (http://smarty.php.net) , however not work well w/Dreamweaver

Database: ADOdb (http://php.weblogs.com/adodb)

Report: FPDF (http://www.fpdf.org/): Slower then PDFLib, but free for commercial use

Interface: PHP Layers Menu (http://phplayersmenu.sourceforge.net/)

Any other good suggestion?

JpGraph is a must in my toolset!!

Posted: Fri Oct 03, 2003 9:41 am
by php_passerby
JpGraph is the best library I have seen for charts
http://www.aditus.nu/jpgraph/

Posted: Fri Oct 03, 2003 10:17 am
by jason

Also, for those interested in web GIS servers

Posted: Fri Oct 03, 2003 10:22 am
by php_passerby
Another class library that I use often is phpMapscript, for publishing Geographic Information through a web server, it is an API to another component called Minnesotta Map Server which does the actual GIS operations

http://www.maptools.org/php_mapscript/index.phtml

Posted: Fri Oct 03, 2003 7:28 pm
by Sevengraff
I wrote my own mysql class
Use ets for templates
will start using pear mail for email and their benchmark class too.

Posted: Wed Oct 15, 2003 8:05 pm
by evilMind
Since I don't like to have to learn other peoples code/habits and becoming dependant on them for accuracy and features; I usually tend to code my own classes/control structures. I've even started to take control of the php error process, since I can depict how the page looks along with many other things.

Posted: Thu Oct 16, 2003 7:00 am
by qads
i just stared useing classes, so far i made my life easier by writeing a user login/logout class and a validation class (never stop editing it lol)..next on my list is a mysql class so i dont have to use mysql_query() every where :D.

also have used fpdf class...its very nice :wink:

Posted: Thu Oct 16, 2003 7:41 am
by jason
qads: Why not just use something that already exists for that qads? Eclipse has a nice database interface. It doesn't have a login/logout class, but that isn't really something you want a library to do.

evilMind: The reasoning for not wanting to use existing libraries sounds alright, until you actually consider what you are saying. There are a number of libraries and frameworks that exist for various needs. There is bound to be one that suits your likes and dislikes.

Good libraries developed with care are not easy to develop. The benefit of a good PHP library is that it's open source. You can modify something if you need to. However, the time you spend developing a library with the features you think it needs is the time you could have learned a library someone else wrote, and started writing your applications.

I am also a bit wary any time anyone suggests they are taking control of the PHP error process. The PHP error process is fine the way it is, and anyone trying to change that, at least in my opinion, doesn't have a concrete understanding of that process.

Think about it like this. PHP errors are not supposed to blend in with your site. They are supposed to stand out, so you can notice them clearly. People don't like this, because once you go into production, they don't like that the errors are ugly.

Guess what? In production, you DON'T display errors. You can turn errors off in PHP, and instead, write the errors to a file.

I am not saying your handling of errors is bad. I am just saying I am wary when people suggest they are "taking control" or retooling the php error process.

Posted: Thu Oct 16, 2003 7:57 am
by qads
can i wake up (3pm lol) in the morning and think "wow, i made that last night" if i use someone else's code jason? i am making my own classes cos i wanna learn 8)...


does it matter if i put a nice table around the error messsages php smacks out?...thats not taking control of error processs is it? :?

Posted: Thu Oct 16, 2003 10:46 am
by jason
qads: I'm not saying you shouldn't create your own. However, you should at least learn how others do it. I don't use PEAR, but I keep an eye on it. If nothing more, it helps me realize things that I may have missed.

You also have an option of joining another existing project. You get the same benefits of using an existing library, but you also get to be apart of it's creation.

As far as the error processing thing, remember what I said:

"I am just saying I am wary when people suggest they are "taking control" or retooling the php error process."

It makes me nervous when people start doing things like that, because I have seen a lot of people do things that aren't good. I am not saying what you are doing is wrong.

For example, it makes me nervous when someone doesn't want to use sessions but wants to use cookies to control login. Most of the time, it's because the person doesn't understand the way sessions and cookies work, and their purpose. Most of the time, people trying to mess with the error handling of PHP are doing so for the wrong reasons.

However, that all being said, doing something to learn about how things work is never wrong. I do it myself. It doesn't change the way I think though. People doing certain things raise flags for me, and I respond accordingly.

Posted: Thu Oct 16, 2003 11:30 am
by qads
i understand what you are saying jason, i do from time to time merge my code with other coders work, but i only do this when i am sure i can create what i am mergeing with, this saves time and this is mostly for my clients, if it is for peronal use then i rather make something new my way and play around with it.

i feel that i can never get the functionlty out of others scripts from what i can get out of my own, this does't mean that they have crap scripts, it just means i dont fully understand the script due to shortage of time and the type of script.

i agree what you mean about peopl doing useless things which are already done in php it self...but outputing something nicely or showing less information from a error message also helps the web site, e.g. i may not want users to see the db connection failed error so i would put

or die("error code:45345, please inform the webmaster");

or something like that...

Posted: Sun Nov 09, 2003 7:58 pm
by sniser
Guess what? In production, you DON'T display errors. You can turn errors off in PHP, and instead, write the errors to a file.
Hmm. My webhost has a very rigid php.ini setup it seems - in case of error you get a blank page and it's getting written to a file. Which is a nice secure setup. BUT since I am outputting debug info anyway when logged in as admin, I might just as well "take control" and output the error message (nicely formatted and integrated into the site no less).. as well as the line in the source containing the error and a the ones above and below! That's not possible with PHP's default error handling and can save a lot of time when playing around. Of course, it's not "in production" and it wouldn't hurt to turn it off then - but it also doesn't hurt to learn how to control the error stuff. The docs are on the usual high standard, and you learn about the different types of errors as a bonus.
For example, it makes me nervous when someone doesn't want to use sessions but wants to use cookies to control login. Most of the time, it's because the person doesn't understand the way sessions and cookies work, and their purpose.
Uhm, why not use cookies? Even this forum uses cookies.. am I missing something here? Session ID's in URL's are an abomination :P

Posted: Sun Nov 09, 2003 8:46 pm
by Gen-ik
I have to say that I write my own classes and functions as well instead of using other peoples for a couple of reasons.

First of all I can say that the code is mine, it's unique, and it's no one elses. You lose a certain 'something' when you use other peoples code, it makes things feel less personal than creating everything yourself.

It's also not good to have to rely on other people to get the job done for you. You should at least try to write your own code before using other peoples.

Also, although I use my own prewritten classes and functions for a lot of different projects I know exactly how each one works so I can edited and streamline them for each project. 9 times out of 10 if you use someone elses code you really don't know what is going on, and what you can change without it kicking up a load of errors.


I guess my final note on this would be write your own code if you can. If not then use other peoples until you can. There are two types of people who use other peoples code... the learners and the lazy. Which are you?

Posted: Sun Nov 09, 2003 11:40 pm
by McGruff
Gen-ik wrote:There are two types of people who use other peoples code... the learners and the lazy. Which are you?
Not so. There are some very well thought out frameworks available. Eclipse for example is very good.

Posted: Mon Nov 10, 2003 8:51 am
by Gen-ik
Ok fair point, but the "Why bother writing my own code when I can use what everyone else is using" mentality will eventually make PHP powered sites really stale. Imagine if everyone in the world drove around in the same type of car?

Although things like phpNuke and phpBB are very good at what they are designed to do, all of the sites which use them look more or less exactly the same structure wise, and you can spot a phpNuke or phpBB site a mile off. They restrict imagination which is one of the things needed these days if you want to get your site to stand out from the crowd.