PHP_LoadFunctionsFromURL


PHP_LoadFunctionsFromURL ( url {; savePath {; timeoutSeconds }} )


 

Description


Allows you to load custom plug-in functions from a web server.

 

Parameters


url (required)
The URL to a PHPx XML file.

savePath (optional)
An optional parameter that makes it easy to store the XML file on disk.

timeoutSeconds (optional)
The number of seconds to wait for the XML file to download.

 

Return


Returns the list of functions that were loaded.

 

Errors


107 Internal plug-in error
301 Invalid package file
310 Invalid save path

 

Example 1 - Load from ULR
PHP_LoadFunctionsFromURL ( "http://www.scodigo.com/PHPx/PHPx_Encryption.xml" )
/*
Returns:
Encryption
    Encr_Decrypt ( password ; text )
    Encr_Encrypt ( password ; text )
    Encr_Version {( option )}
*/
Example 2 - Bad URL
PHP_LoadFunctionsFromURL ( "http://www.badurl.com" )
/*
Returns: 107 Internal plug-in error; cURL returned an error: Couldn't resolve host 'www.badurl.com'
*/

Change Log

VersionDescription
3.0.0cURL is now used to make the url request to get the XML file.
3.0.0Function now returns the package name followed by an indented list of the functions that were loaded from the package.
3.0.0

Added support for store-last-code attribute in the execute-params tag for the PHPx XML format. This allows the function developer to choose whether or not their code can be viewed using the PHP_GetLastCode function. In some cases you may store sensitive information in your code or you may simply want to hide your kung foo. The following XML snippet shows how to set this attribute to off:

<execute-params timeout="60" keep-memory="0" execute-to-container="0" store-last-code="0"/>

3.0.0

Added support for function-prefix attribute in the package tag for the PHPx XML format. This allows you to specify a custom prefix to be used instead of the default "PHPx_". If you don't want a prefix to be added, you can set the value to an empty string (function-prefix=""). Keep in mind that the internal FileMaker function ID is based on the function name. If you change or remove the prefix, the function name will change and a different internal ID will be used. You will then need to update any calculations that were previously stored before the name was changed. The following XML snippet shows how to set the function prefix to Acme:

<package abbreviation="Tst" license-level="1" name="Test" version="1.0.0" function-prefix="Acme">