include-once

PHP inclusion behaving oddly with multiple includes.

I have the following code: if (include_once(dirname(__FILE__).'/file.php') || include_once(dirname(__FILE__).'/local/file.php') ) { This causes an error because PHP tries to include "1" (presumably dirname(__FILE__).'/file.php' || dirname(__FILE__).'/local/file.php') Commenting out the second line makes this work as intended,...

monitoring disc reads

Hi, i want to use apc in php, to avoid disc reads when including files. But how can i know if files are really coming from shared memory, instead of disc reads? Does anyone know how to measure the number of disc reads for a php script, or in a time interval? (on windows server 2003) Thanks a lot in advance, regards, Charles ...

PHP include_once not working for file in parent directory

I just started working on a site that has been passed down to me that isn't working. I've found that there's a problem when in /admin/index.php it tries to instantiate an instance of /classes/admin.php. However, if I copy /admin/index.php to /admin-index.php, it can instantiate the class just fine. Also, if I move /classes/admin.php into...

PHP include once.

Is it more efficient to use PHP's include_once or require_once instead of using c-like include with a header guard? i.e, include_once 'init.php'; VERSUS include 'init.php'; //contents of init.php if (!defined('MY_INIT_PHP')) { define('MY_INIT_PHP', true); ... } ...

Need to Error Trap include_once somehow

Ok, I'm allowing the uploading of files which can have multiple functions in them. I need to be able to somehow error trap the include_once so that if the function_exists already and that function is being called within the file that is uploaded, than it, either 1 sends an error message, or 2 doesn't include the file at all. Any Ideas?...

php include_once failing despite existence of file and 777 permissions

php include_once is failing for me with the "failed to open stream: No such file or directory" message, despite the existence of the file it is complaining about, and chmod'ing to 777 in order to try to mitigate the problem. warning: include_once() [function.include]: Failed opening '../i_utility/WCHelper.php' for inclusion (include_pat...