Watch, Follow, &
Connect with Us

Please visit our new home

Public Report
Report From: Delphi for PHP/IDE/Other    [ Add a report in this area ]  
Report #:  79097   Status: Reported
Relative path not formed correctly when adding a USES file
Project:  HTML5 Builder Build #:
Version:    2.0 Submitted By:   John Mackerras
Report Type:  Basic functionality failure Date Reported:  10/29/2009 11:48:54 AM
Severity:    Commonly encountered problem Last Updated:
Platform:    All versions Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 1
When using the "Use Unit" menu item to add in a required use file, and that use-file is located in a higher directory than the directory using the file, the relative path is incorrectly formed.

By example, if the path to my use-file includes the step-down (../) command, you would normally add in the line  


If I choose "Use Unit" from the File menu of Delphi for PHP, the file is identifed in the chooce box as "../use.php" yet an additional step-down command is added into the path such "../../use.php" and the require line is shown


The require_once line must then be manually edited so that the correct number of step-downs is in the file path.
Steps to Reproduce:
Re-create steps

1. Create a new project in D4PHP.

2. Save a PHP file in the main project directory, called "datamodule.php"

3. Create a sub-directory inside the main project directory and call this directory "SubDir".

4. Save a PHP file in the newly created "SubDir" directory and call it "main.php"

5. While working in main.php, choose "Use Unit" from the file menu. A selection box will pop up and will contain one item. This item will be "../datamodule.php". Double-click on this file and Delphi for PHP will add in a require_once line into sub.php.

6 Examine the newly added require_once line. It will look like this.
  but should look like this  
  as the file we require is only one directory below the focussed directory.



Server Response from: ETNACODE01