Page 1 of 1

PEAR and Type Casting - To have or not to have, that is.....

Posted: Sat Nov 18, 2006 10:17 am
by DaveTheAve
First let me finish the subject title: PEAR and Type Casting - To have or not to have, that is the question.
- There I'm happy, lol.

Alright as the (finished) subject title suggests, I'm wondering if programmers can use PEAR and Type Casting and still be considered standards compliment. I understand it's a stupid question to ask this because PEAR has developed our latest standards to use, so that answer is obvious, but I wish to know if more servers then not have it installed. The type casting part of said question is do the the fact I currently use type casting for $_POST/$_GET variables and timestamp fields in a few on my DB tables to compare them with time().

Posted: Sat Nov 18, 2006 10:25 am
by feyd
Type casting is often perfectly fine no matter where you do it.\

As for PEAR being installed.. many hosts have the basic library installed, but the full extent of it, not very often.

But, good news, you don't have to find a host that has it all installed. You just need to place the files in an accessible location and set your includes correctly to load them.

Posted: Sat Nov 18, 2006 10:27 am
by DaveTheAve
Wait, set the includes to the PEAR folder, or the includes to the pear packages I wish to use, or do both work?

/me thinks he will have to make a pear.inc.php file in the includes folder very shortly.

Posted: Sat Nov 18, 2006 11:05 am
by Chris Corbyn
Yeah one good thing about PEAR is that you can have it download dependencies. I personally try as hard as I can to avoid PEAR though. Personal preference, and a portability issue. Seen some pretty hairy code in some packages too but obviously that's down the the individual developers.