Problem with __FILE__ magic constant

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Pomasl

    Problem with __FILE__ magic constant

    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
Working...