Project

Profile

Help

Bug #4682

closed

Inconsistencies in documentation on relative and absolute paths in PHP

Added by O'Neil Delpratt almost 2 years ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2020-08-13
Due date:
% Done:

100%

Estimated time:
Found in version:
1.2.1
Fixed in version:
11.3
Platforms:

Description

In the Saxon/C PHP extension we internally set the current working directory (i.e. setcwd) to where the php script is located. When a user uses absolute paths in arguments to method like parseXmlFromFile(string $fileName) it is not being resolved correctly.

The current workaround is to set the cwd to empty string. For example:

$saxonProc = new SaxonProcessor(true, ''); // can be false or true

or

$saxonProc = new SaxonProcessor(true); // can be false or true
$saxonProc->setcwd('');

Actions required:

  1. Fix code to resolve files with absolute path names
  2. update documentation to mention cwd to php script
Actions #1

Updated by O'Neil Delpratt 3 months ago

  • Category set to Saxon-C Internals
  • Status changed from New to In Progress
  • Assignee set to O'Neil Delpratt
  1. Has been done, but the problem reported in 1. is still present in SaxonC 11.2.

I have applied the fix to the SaxonCAPI.java class. The parseXmlFile method now uses resolveFileToSource to resolve cwd and the filename.

Testing change in PHP example.

Actions #2

Updated by O'Neil Delpratt 3 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
Actions #3

Updated by O'Neil Delpratt 2 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 11.3

Bug fix applied in the SaxonC 11.3 maintenance release.

Please register to edit this issue

Also available in: Atom PDF