Trouble with addressing resources in PHP


(Arnim) #1

Hello community,

I have set up a project targeting PHP.

It is supposed to read a resource file that is set in the .hxml file and another one created on compileTime. To read the lattter one is set within the Main.main() as a macro.

The .hxml file is also set up to have a centralized top-level php-library ( --php-lib …/…/phpLib` )

The macro works fine. But the runTime, trying to read the resource via Resource.getByte(…) expects the ‘res’ folder (holding the resources) to be in the same folder like the library folder. But the compiler actually has put it within the the same folder like the index.php file.

(the Context.addResource( “resourceName”, resource ) has worked out as well)

What have I done wrong?
How do I get the compiler to put the resources to a ‘res’ folder on top-level?

Or alternatively:
How do I get the runTime to look for the ‘res’ folder within the same folder like the index.php file?

Kind regards

(Aleksandr Kuzmenko) #2

The runtime path to that “res” directory is hardcoded in haxe.Resource module:

Could you please open an issue in Haxe repo with the minimal sample?

(Arnim) #3

Hello Aleksandr,

thank you for your answer.

I would have done so earlier. But in the past it turned out quite often, that there are some other things to be considered (e.g. an option to be set), that I have overseen.

So in general I do not know if it’s a bug or a feature…

I will post this issue, when I have updated my HAXE version and if the bug still persists.

Kind regards