473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

include_once fails with chdir

code green
1,726 Expert 1GB
I use the line
Expand|Select|Wrap|Line Numbers
  1. require_once '../includeFiles.php';
to pull in all required functions etc for my scripts.
It is also possible that a script will include another, both with this line in, but the 'once' prevents double including.

However, if
Expand|Select|Wrap|Line Numbers
  1. chdir(dirname(__FILE__));
is at the beginning of an included file then require_once is ignored and included again.
This causes problems of repeated function declaration etc.

Anybody know a solution?
May 1 '09 #1
1 1465
code green
1,726 Expert 1GB
Sorry. This is not what is happening.
Problem is occuring when a script calls another script
that includes a different 'includeFiles.php'.
Then the different 'includeFiles.php' includes files already included in first script's 'includeFiles.php'

I suppose I have to include_once all those files instead of just include.

Am I making any sense here?
How about deleting the thread until I have a clearer problem?
May 1 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Andrew Crowe | last post by:
Hi guys, We're using the ISAPI version of PHP with IIS5.0 On some websites for some reason any php file in the websites root is given the path winnt/system32 (getcwd() returns...
5
by: Nicholas Geraldi | last post by:
I have a script that uses the chdir() function. I know the script works ( works perfectly on my host ), but when I put the script on my server here at work I get the following error. Warning:...
4
by: Yun Mao | last post by:
Hi, How to make changes to os.environ and os.path.chdir still effective after I run the script? Currently, the changes are only good within my script. I would like the shell who called python...
3
by: dannycolligan | last post by:
I have a strange problem with os.chdir... here is my script that I am using to edit the filenames of my music library: #!/usr/bin/python from os import * ...
1
by: Ş­¾¯ | last post by:
/************************************************** *** *** chrexec.c *** *This shit can be called from root or from any user (in that case executable * should have 06755 permisions) and should...
5
by: HMS Surprise | last post by:
Tried executing os.chdir("c:\twill") from a python Tk shell and got the error message: WindowsError: The filename, directory name, or volume label syntax is incorrect: 'c:\twill'. I have the...
0
by: Julien Biezemans | last post by:
Hi everyone, I've written a file:// scheme stream wrapper that acts like chroot() (but is more flexible, does not require root privileges and works on any platform). Everything works just fine...
15
by: Mikhail Kovalev | last post by:
Hi all, I have a file which is to be included in another script and which takes several seconds to load(!), and which is actually not always used by the script, so instead of using include or...
4
by: Andrew G. Koptyaev | last post by:
Is I can use include_once() or require_once() in function or only include()?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.