Re: New to PEAR -require_once / include_once is strange...

From: Date: Tue, 22 Mar 2005 22:25:56 +0000
Subject: Re: New to PEAR -require_once / include_once is strange...
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18249@lists.php.net to get a copy of this message
On Mar 22, 2005, at 1:48 PM, Edward Z. Yang wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've just started taking a look at PEAR, at it sounds really interesting. However, there's one thing in the documentation that baffles me: require_once "Auth.php"; I could not understand how that worked, and whether or not it would work. Further delving led to this: ini_set("include_path", '/var/www/www.example.com/includes/' . PATH_SEPARATOR . ini_get("include_path")); At this point, I've got some vague idea about how require works with files when it has no parenthesese,
Please note that require* and include* are not functions, but language-level constructs- that's why they work without the parens.
but I'm still confused on why exactly it works: If I were to install a PEAR package outside of this include directory, would I have to point my include to that file?
Yeah. Of course, the idea is to install all the pear packages in the same spot and point your include path there.
Why does simply saying the first statement work? Thanks in advance for the help.
Magic. -ryan -- http://theryanking.com/

« previous php.pear.general (#18249) next »