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

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

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

Post 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().
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Post Reply