debug_backtrace(), __FILE__, __DIR__ and related should return absolute paths #16
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Aer Information
4c81475afb
Your problem description
Actually all mentioned methods (and probably more) returns a path relative to executable. As the executable can be located in any directory, this says actually nothing. Absolute path should be returned instead:
Expected results
Current results
I don't think
4653e5b44e
fixes this. I have not tested it, but I believe this should be fixed in Engine code, to address also all includes files. Please correct me if Im wrong.Recommited in same branch.
This breaks include_once & require_once.
Ah right I see why...
Hopefully this time...
Merged to master branch.
I have reverted merge. This cannot be implemented this way because PH7_StreamOpenHandle in vfs.c depends on that.
If filename does not begin with / it assumes it is not an absolute path at it is trying to include file from include path (PH7_VM_CONFIG_IMPORT_PATH).
It was not working, because the path builder working buffer was not reinitialized every loop iteration, thus containing some trash. The result was that it could not find a proper path. This is fixed by
3ed00e610f
.To sum up, I think that the absolute path should be saved together with relative path, so that we can use both together depending on current needs. This would allow us to include the relative filename from include path and display its absolute path. Another option is to replace relative path with absolute path from within PH7_StreamOpenHandle after it gets included (and we make sure it is included).