From 1a3d10cdee67c56934a7cec8b959e851a76b3820 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Tue, 26 May 2015 22:34:13 +0200 Subject: [PATCH] Renamed 'callbacks' chapter in User manual to 'Script execution'. --- doc/MANUAL.md | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/doc/MANUAL.md b/doc/MANUAL.md index a8f6a4c..b67e4de 100644 --- a/doc/MANUAL.md +++ b/doc/MANUAL.md @@ -24,9 +24,10 @@ This is the manual for version %%VERSION%%. 1. [Output](#output) - [Output types](#output_types) - [Exit codes](#output_exitcodes) -1. [Callbacks](#callbacks) - - [Validation](#callbacks_validation) - - [Field Values](#callbacks_fieldvalues) + - [Serving static files](#output_static_files) +1. [Script execution](#script_execution) + - [Validation](#script_validation) + - [Field Values](#script_fieldvalues) 1. [Users](#users) - [Passwords](#users_passwords) - [Form limiting](#users_formlimit) @@ -369,24 +370,30 @@ and shown to the user in the browser. If a script's exit code is not 0, it is assumed an error occured. Scriptform will show the script's stderr output (in red) to the user instead of stdin. +## Script execution -## Callbacks +When the user submits the form, scriptform will validate the provided values. +If they check out, the specified script for the form will be executed. -Callbacks are called after the form has been submitted and its values have been -validated. They are the actual implementations of the form's action. +A script can be any kind of executable, written in any kind of language, +including scripting languages. As long as it is executable, can read the +environment and output things to stdout it is usable. Scippts written in +scripting languages should include the shebang line that indicates which +interpreter it should use: -A script callback can be any kind of executable, written in any kind of -language. As long as it is executable, can read the environment and output -things to stdout, it can be used as a callback. + #!/usr/bin/php + -### Validation +### Validation Fields of the form are validated by Scriptform before the script is called. Exactly what is validated depends on the options specified in the Form Definition. For more info on that, see the *Field Types* section of this manual. -### Field values +### Field values Field values are passed to the script in its environment. For instance, a form field definition: