Putting XML file within the exe

I want to put my XML file within the exe, what I have to do, right now it call from X:\Data
I don’t want to deliver my XML separately, please guide me.

Just put your XML file in the source folder and ExeOutput for PHP will compile it into the EXE. Then you can make it available at runtime with the “Unpack files at startup” option (search in the doc for that feature). With that option, your XML file can be read by your PHP script as if it was normally on the hard disk, but it won’t be for real because it will be in memory.

Thank you so much, It worked fine.
Some more questions, please guide:

  1. What should be the maximum size for xml file with one record have 20 fields with 100 words each field so that it don’t affect speed performance.

  2. As I understand, let suppose if I have 50 xml files all files will be loaded to memory only once at runtime and on calling any specific record it will not load again, am i right?

  3. What will be the best choice XML vs SQlite if I have 5000 records, each record with 20 fields, each have 100 words?

You should do tests yourself because we can’t tell you that easily. Unpacking to memory is fast, but with a large amount, it can take time. You can also delay the unpacking until you need the XML files: you can request the XML file with a built-in PHP exo… function: see the documentation.

Anyway, in ExeOutput 2, the program is able to see if PHP requires a specific file that is compiled and makes it available automatically, without any additional code programming requirement.