PHP_Configure


PHP_Configure ( settingName {; settingValue } )


 

Description


Allows you to set or get plug-in settings.

Settings are persistent between sessions, they are stored on disk and automatically restored the next time FileMaker is launched.

You can create your own settings with this function and they will be saved and restored each time FileMaker is launched (but keep in mind that the settings are only stored on the local machine).

Currently supported plug-in settings:

Setting NameDefaultDescription
AddHelp0Allows you to enable or disable function help comments in the calculation dialog.
CancelSeconds2Allows you to set the number of seconds before execution will exit after the progress bar cancel button is pressed. In some cases, PHP may be busy and not able to check fm_user_cancelled. The plug-in will give PHP time to check but will then automatically exit (and return error 203 User cancelled). This setting allows you to change the amount of time the plug-in waits before exiting.
CurlOptSSLVerifyHost1Allows you to enable or disable the cURL option to verify the SSL host when connecting to a remote server. This setting is used by PHP_LoadFunctionsFromURL when connecting to a web server using a TLS based protocol (https, ftps, etc.). See cURL manual for more details.
CurlOptSSLVerifyPeer1Allows you to enable or disable the cURL option to verify the SSL certificate when connecting to a remote server. This setting is used by PHP_LoadFunctionsFromURL when connecting to a web server using a TLS based protocol (https, ftps, etc.). See cURL manual for more details.

DebugMode

0Allows you to enable or disable debug mode, see Troubleshooting for more info.
ExtraDebugInfo0Allows you to enable or disable extra debug info when debug mode is enabled. This setting is rarely needed and only needs to be turned on if requested.
StoreLastCode0Allows you to enable or disable storing of the last executed code. PHP_GetLastCode is a troubleshooting function that allows you to return the last executed PHP code. In some cases, for example if you include credentials in your code, you may want to disable the StoreLastCode setting.

Settings are stored on disk at the following location:

OS / VersionPath
OSX (Pro)/Users/Username/Library/Application Support/Scodigo/Smartpill/Config/Config.txt
OSX (Server)/Library/FileMaker Server/Database Server/Extensions/Smartpill SE/Config/Config.txt
OSX (Web Publishing)/Library/FileMaker Server/Web Publishing/publishing-engine/cwpc/Plugins/Smartpill SE/Config/Config.txt
Windows (Pro)C:\Users\Username\AppData\Local\Scodigo\Smartpill\Config\Config.txt
Windows (Server)C:\Program Files\FileMaker\FileMaker Server\Database Server\Extensions\Smartpill SE\Config\Config.txt
Windows (Web Publishing)C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\cwpc\Plugins\Smartpill SE\Config\Config.txt

Parameters


settingName (required)
The name of the setting to set or get. If you use this function to store your own settings, the recommendation is to use only alphanumeric and underscore characters for the name.

settingValue (optional)
The value to set.

The following values will evaluate as 1 (boolean True):

  • Numbers > 0
  • True
  • T
  • Yes
  • Y
  • On

Any other value will evaluate as 0 (boolean False).

 

Return


Returns 0 when the setting is successfully set or the setting value when the settingValue parameter is omitted from the call. Returns error 106 if settingName is not found.

Note that DebugMode returns the debug folder path instead of 0 when it's turned on or off. See Troubleshooting for more info.

 

Errors


106 Invalid parameter; Setting not found: settingName

 

Example 1 - Set AddHelp setting
PHP_Configure ( "AddHelp" ; 1 )
/*
Returns: 0 // No error, AddHelp setting has been set
*/
Example 2 - Get AddHelp setting
PHP_Configure ( "AddHelp" )
/*
Returns: 1 // The value of AddHelp is 1 (enabled)
*/
Example 3 - Set StoreLastCode setting
PHP_Configure ( "StoreLastCode" ; 0 )
/*
Returns: 0 // No error, StoreLastCode setting has been set
*/
Example 4 - Set ad hoc setting
PHP_Configure ( "EmailAddress" ; "smartpill@scodigo.com" )
/*
Returns: 0 // No error, EmailAddress setting has been set
*/

Change Log

VersionDescription
3.0.0New function – allows you set and get plug-in settings.