php
SOURCE
,
RESULT
,
FOLDER
,
TIMEOUT

The php statement executes a PHP script (program).


Parameters

This statement has four parameters:

source – PHP script (source code). Note: It is very convenient to use “pipe” delimiters for this parameter, for example |||script|||. This eliminates needing to worry about the delimiters that occur in the script itself.

result – Name of field or variable in which result of the script will be placed. This result is any output sent to the standard console ouptut. If this parameter is not supplied the result will be placed in the global variable ScriptResult.

folder – Folder to execute PHP script in (default to current database folder)

timeout – Maximum amount of time the script will be allowed to run (in seconds). If this option is not specified you can set the default using the scripttimeout statement. If this default has never been set the default is 60 seconds.


Description

This statement executes a PHP script (program). This simple example displays the contents of the A database field (of course this example is silly since this could easily be done without PHP).

local output
php |||print $«A»$; |||,output
message output

WARNING: Apple has stopped providing PHP with macOS. If you are using a recent version of macOS, you will have to install PHP yourself. See Scripting Language Configuration to learn how to do this.


Panorama formulas can be embedded in the script using special tags.

To embed a Panorama text formula use

$«formula»$

The formulas are calculated in advance, then embedded into the source code as constants. For example, the formula $«2*3»$ will be embedded into the program as 6. The formula $«upper("hello world")»$ will be embedded as "HELLO WORLD".

In the case of text formulas any special characters will be encoded as necessary for a proper PHP constant. For example the formula $«{"}»$ will be embedded as """.

To embed a Panorama formula with no quotes or translation use

^«formula»^

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.