NYCPHP Meetup

NYPHP.org

[nycphp-talk] Include vs Include_once

Daniel Convissor danielc at analysisandsolutions.com
Thu Nov 29 23:11:09 EST 2007


Urb:

On Thu, Nov 29, 2007 at 08:19:02AM -0500, Urb LeJeune wrote:
> include_once() files are in the same directory as the application
> but blows up if they files are not in the same directory but are
> in /usr/local/include.

What exactly happens when it "blows up?"  Are your includes silenced by 
@'s?  If so, remove the @'s in order to get the PHP errors to show up.

include_once is a real performance drag.  You should use better program 
logic to make it possible to use a regular include call.

Also, provide a full path to the file name.  This avoids looking at the 
include_path all together, making things clearer and faster.

Mr Chech may be onto something: you may have two scripts with the same 
name.  You think you're including one but you're actually getting the 
other.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list