Open topic with navigation
You are here: Smart Control > Smart Event Configuration Guidelines
Smart Control Configuration Guidelines
The Smart Control feature uses PHP as its underlying language. It is possible, however, to use this feature with minimal PHP knowledge. Some facts about Smart Control scripts:
- Each Smart Control script is wrapped inside of additional code prior to execution. The purpose of this is to enable added protection and save the environment when a script runs. As a result, tags such as “
<?php ?>
” not needed.
- Smart Control scripts are intended to be run by the ADC in the background. That is, they are generally not designed to produce output. However, if a script produces output, either for debugging purposes, or because a PHP error has occurred, the output of the last time the script was run can be seen using the
lastrun
command. (See Server Instance Class (si) for a description).
- If a script produces a PHP execution error while running, an error is logged in the ADC log, however, the script continues to be executed as normal. The reason for this is that a different execution path may not produce the same error.
- By default, any variables declared during execution of a script are saved for the subsequent execution. If you would like to discard the environment between script executions, “
$save_environment = FALSE;
” should be entered at the beginning of your script.
- Because Smart Control is based on PHP, most PHP constructs will work. These are generally for advanced users, however, they may be useful to create more robust scripts. For example, try/catch blocks can be used for any function that prompts an exception, as described below. However, although a script that catches these exceptions would be more robust, users who are not familiar with PHP may want to look at the output produced by the script, instead. (Exceptions will be displayed by the
lastrun
command).