{
"dependencies": {
"php": {
"github": "miyako/php",
"version": "*"
}
}
}
Based on miyako/4d-class-php.
The CGI class has been refactored as a Shared Singleton.
$CGI:=cs.PHP.PHP_CGI.new(cs.PHP._PHP_CGI_Controller).cgi()
$php:="<?php\n\nfunction sum(int $a, int $b): int {\nreturn $a + $b;\n}\n"
$phpFile:=Folder(fk desktop folder).file("test.php")
$phpFile.setText($php)
var $returnValue : Text
If (PHP Execute($phpFile.platformPath; "sum"; $returnValue; 5; 3))
ALERT($returnValue)
End if
to test CGI mode
#DECLARE($params : Object)
If (Count parameters=0)
CALL WORKER(1; Current method name; {})
Else
$form:=cs.PHP.CGI_PHPForm.new()
End if
to test interactive
#DECLARE($params : Object)
If (Count parameters=0)
CALL WORKER(1; Current method name; {})
Else
$form:=cs.PHP.Interactive_PHPForm.new()
End if
to test one-shot
#DECLARE($params : Object)
If (Count parameters=0)
CALL WORKER(1; Current method name; {})
Else
$form:=cs.PHP.Run_PHPForm.new()
End if