Read output from php

nicolas

Member
Is there any way to get a php variable from a procedure progress?
In php execute a procedure .r using exec function, complete the procedure and I want to read it returns a value from php.
In codigo.php do this:

exec(' "C:\Program Files\PROGRESS\OpenEdge\bin\prowin32.exe" -db X -N X -S X -H X -U X -P X -p C:\ruta\proceso.r -param ' . $_SESSION['Parametros'] . ');

the idea or what I want is:

$variablePhp = valorSalida

where:
proceso.p
output parameter valorSalida
 

RealHeavyDude

Well-Known Member
Never did that with PHP but whenever you set a variable in an OS script ( and export it properly on *nix ) then you are able to access it by name from within the ABL with the OS-GETENV ( ) function. Other than that the only possibility I know is to pass parameters to an ABL session at start up is via the -param parameter that you already use in your syntax.

In your case, instead of invoking the progress executable directly, I would think about generating an OS script on the fly from PHP that includes the setting of the variables as environment variables and then invoke the progress executable in that script. Next you can then invoke that script from PHP. That way you have full control about the environment the ABL session is started in and what it has access to.

Heavy Regards, RealHeavyDude.
 
Top