HEScript - using php function inside hescript


#1

Hi,
Is it possible to use php functions in hescript?
I need base64_encode for now, but don’t know how to use it in hescript

Thank you


#2

No, it’s not possible. You can run HEScript from PHP but not the contrary.


#3

Maybe you could think about add posibility to use internal php.exe because it is just compiled. It could be simple one line commands, but it helps us a lot, because no one is hescript experts :slight_smile:

php -r ‘echo base64_encode(“something”);’


#4

Sure, we’ll check whether this can be done this way.


#5

Please check if in hescript could call script inside compiled application and if return from this script can be assign to hescript variable. It could be powerfull.

Pseudocode
SomeVariable := PHP(‘tools.php?var=’ + getglobalvar(‘something’);


#6

Did you think about it if it is possible?


#7

We added the ability to run PHP code in HEScript thanks to the new ExecutePHPScript function.
Example code:

procedure TestRunScript;
var
 SRes: String;
begin
 SRes := ExecutePHPScript("<?php echo 'TEST'; ?>");
 ShowMessage(SRes);

end;

#8

great, I can not wait for the new version :slight_smile:

Can we run php script and output assing to SRes? and how to do is?

procedure TestRunScript;
var
  SRes: String;
begin
  SRes := ExecutePHPScript("<?php include("test.php") ?>");
  ShowMessage(SRes);
end;

#9

It will normally work provided that test.php lies in the application’s root folder (the source folder).


#11

I think that documentation should be fix


#12

There was a HTML cleanup problem in the post-processing… It’s fixed in the online version, thanks!
https://www.exeoutput.com/help/scriptreference