This page will attempt to explain the process flow of the Aneuch script. It might be useful to both contributors to the mainline Aneuch source, as well as plugin developers.
- Init
This is the very first subroutine called. It calls the following:
- InitScript
Determines $Url, $ShortUrl, $ScriptName and $ShortScriptName
- InitConfig
Executes $ConfFile (default 'config.pl'), which sets user-configured variables
- InitVars
Initializes default variables. If a variable was set in the previous step (InitConfig) it will not be over-written. This is also where several "special" things get declared via:
- LoadPlugins
This is where all plugins get loaded. Plugins should end in the extensions '.pl' or '.pm', and be in the $PluginDir directory.
- InitTemplate
Initializes the template (see Themes). If no $Template is set (which should be the name of a directory in the $TemplateDir), use the default template (which is at the end of the script, in the DATA section.
- DoRequest
Handles the current request. The following are called as part of this:
- IsBlocked
Checks if the current user is blocked.
- ErrorPage
If the user is blocked, call ErrorPage with a 403 error.
- ReadIn
Checks if the script is getting POST data.
- DoPosting
If ReadIn return true (1), call DoPosting.
- If the 'doing' element of the submitted data exists in %PostingActions, then execute it.
- Check if page requested (or if a command, if the command is defined), and if not, set $HTTPStatus to 404 error.
- If the command is 'revision', check if the requested page revision exists, and if not, set $HTTPStatus to 404 error.
- Interpolate
This is called on $Header, which replaces any variables in the content of $Header with their respective values.
- If a command is being called (GetParam('do')), and it is defined, execute the command.
- OR if the page does not exist, send out the contents of $NewPage (default 'It appears that there is nothing here.')
- OR if the page does exist, and Markup exists:
- Markup
Send the text from $Page to Markup, which should return properly formatted HTML.
- MarkupBuildLink
Takes any text between two ['s and two ]'s and returns an HTML anchor element (<a>).
- IF Markup does not exist:
- Send the text from $Page out to the browser
- DoSpecialPage
If the current $Page matches something defined via RegSpecialPage, execute its associated subroutine.
- Interpolate
This is called on $Footer, which replaces any variables in the content of $Footer with their respective values.
- DoVisit
Records the details of the current browse request to $VisitorLog
- DoMaint
Calls any subroutines defined to %MaintActions, which are used to clean up temp files, $VisitorLog, etc.