COMMUNITY

Haxe php - inluding different modules in one request

in haxe 3.4.7
i have a problem with including different modules in one request of web app
coz same haxe boot classes and functions was declared for each module
i need load module is dinamicaly (this module is some plugins for some CMS which can turned off or on in any time)

how to fix it? how to make only 1 shared copy of haxe sys classes?

i tried prefix argument for build - but it not work for sys haxe functions like _hx_anonymous() and etc

Try adding this to your compilation flags:

--macro exclude('php.Boot')

Though, I’m not sure if it will work for the old php generator, which you seem to be using.

Building with -D php7 will enable the new php generator, which does not generate any top-level functions and supports php-prefix.
Also the new generator should not try to load classes which are already loaded. So even if you have duplicated std classes that should not be a problem.