FIG_CGITable of Contents

FIG CGI Script Utility ModulePublic Methodsinitis_sproutFIG CGI Script Utility ModuleThis package contains utility methods for initializing and debugging CGI script in the FIG framework.

Public Methodsinitmy($fig, $cgi, $user) = FIG_CGI::init(debug_save => 0, debug_load => 0, print_params => 0);

Initialize a FIG and CGI object for use in the CGI script. Depending on the CGI parameters passed in, the FIG object will be either an actual FIG objec (when we are in SEED mode), or a SFXlate object (when we are in Sprout mode).

debug_saveSet this flag to true if the script should save its parameters to file. (Default filename is the name of the script minus the .cg suffix, placed in the /tmp/ directory).

debug_loadSet this flag to true if the script should load its parameters from file as saved with debug_save.

print_paramsSet this flag to true if the script should print its CGI parameter before exiting.

RETURNReturns a three-tuple. The first element is a FIG or Sprout object. The secon is a CGI object describing the environment of the calling script. The thir is the name of the current user.

is_sproutmy $flag = is_sprout($object);

Return TRUE if we are running in Sprout mode, else FALSE.

objectFIG, SFXlate, or CGI object. If a FIG object is passed in, the result is alway FALSE. If an SFXlate object is passed in, the result is always TRUE. If a CG object is passed in, the value of the SPROUT parameter will be returned.

RETURNReturns TRUE if we're in Sprout mode, else FALSE.