473,242 Members | 3,171 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,242 software developers and data experts.

[Fwd: Problem with __FILE__ magic constant]

Does no one have any insight?......please?

Chris

-------- Original Message --------
Subject: Problem with __FILE__ magic constant
Date: Tue, 06 Jan 2004 16:43:41 GMT
From: Chris Pomasl <po**********@starband.net>
Organization: Starband Communications
Newsgroups: comp.lang.php

We picked up a helpdesk script from sourceforge, Mantis. This script
uses the __FILE__ magic constant to ostensibly derive the path to the
include directory from a script in the top level directory.

Reading the doc about __FILE__ did not gain me enough insight as to what
is going on.

My testbed is running PHP 4.1.0 but the server where it is to run is
4.0.6. The script specifically says that it is designed for a minimum
4.0.6.

In 4.1.0, the __FILE__ constant is set to the full path to the running
script starting from the root:
/home/mydirectory/public_html/mantis/script.php
In 4.0.6, the __FILE__ constant is set to only: /script.php

My question is regarding the history of __FILE__ between these releases
and whether there is any way to influence what is returned by __FILE__?
I could change the script for our purposes but before I even think of
that, I was wondering if there were PHP options that affect this behavior.

As far as upgrading the 4.0.6 to a higher release, I could ASK but the
server is not mine (or I'd likely be at the 4.3.x level.)

TIA,
Chris

--
Christopher J. Pomasl Starband 360, 004/68 Suse Linux 8.0 + KDE 3.1.2
Bari, Sound of the Rockies Chorus Lead, Gimmick quartet
Senior Software Engineer - DB2 products Computer Associates, inc
Always remember, you are unique.....just like everyone else!!
To email me, remove the spam stuff from my eddress

--
Christopher J. Pomasl Starband 360, 004/68 Suse Linux 8.0 + KDE 3.1.2
Bari, Sound of the Rockies Chorus Lead, Gimmick quartet
Senior Software Engineer - DB2 products Computer Associates, inc
Always remember, you are unique.....just like everyone else!!
To email me, remove the spam stuff from my eddress
Jul 17 '05 #1
1 2424
On Fri, 09 Jan 2004 19:52:19 GMT, Chris Pomasl <po**********@starband.net>
wrote:
Does no one have any insight?......please?

Chris

-------- Original Message --------
Subject: Problem with __FILE__ magic constant

http://bugs.php.net/search.php?cmd=d...h_for=__FILE__

... looks like a good place to start.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris Pomasl | last post by:
We picked up a helpdesk script from sourceforge, Mantis. This script uses the __FILE__ magic constant to ostensibly derive the path to the include directory from a script in the top level...
6
by: Tom | last post by:
I'm trying to dynamically adjust the path for one of my scripts using this: $script_path = str_replace( $_SERVER, "", dirname(realpath(__FILE__)) ) . DIRECTORY_SEPARATOR; The problem: the...
9
by: qazmlp | last post by:
How exactly __FILE__ and __LINE__ macros are defined? Or, Is the definition of these macros implementation dependent ? I am wondering how easily they can get the file name and line number...
1
by: Johan Lindh | last post by:
This is somewhat obscure, and I'm not sure if the question is valid in comp.lang.c. If it isn't, please ignore it. In a C program, the pointer resulting from a __FILE__ is stored. The pointer...
5
by: baumann.Pan | last post by:
where are these macros defined? can I use it a release ver code?
19
by: youpak2000 | last post by:
Are MAGIC numbers always bad? Using magic numbers (constant numbers) in programs are generally considered a bad programming practice, and it's recommended that to define constants in single,...
18
by: Lukas Ruf | last post by:
Dear all, for debugging purposes, I like the pre-compiler macros __FILE__, __FUNCTION__, __LINE__ I have been wondering if there is a short form of __FILE__ that provides only the filename...
46
by: lovecreatesbea... | last post by:
Do you prefer malloc or calloc? p = malloc(size); Which of the following two is right to get same storage same as the above call? p = calloc(1, size); p = calloc(size, 1);
4
by: allan.mcrae | last post by:
As part of a very simple memory leak detector, I am trying to store the value of __FILE__ in a char*. Since gcc4.2 I get the following warning... warning: deprecated conversion from string...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.