The configuration file is divided into sections headed by a section name in square brackets. Each section contains one or more name=value pairs setting various settings relating to that section.
The caching feature is not yet implemented. Watch this space.
Settings in path_ sections apply to the virtual path specified in the section name. Virtual paths are what the user sees the website to be structured as, rather than how the local filesystem sees it.
These all have the SYS: prefix, and are set by MML to contain different parts of the source document.
SYS:TITLE |
The title specified in the MML document. |
SYS:HEAD |
Optional extra header code specified in the MML document. |
SYS:BODY |
The content of the MML document, as specified in the body section. |
These are supplied by the web server as part of the CGI transaction, so can and do vary from server to server. Here are some more commonly-used variables:
ENV:SERVER_NAME |
The hostname of the web server. Useful in creating canonical links. |
ENV:REMOTE_ADDR |
The IP address of the client making the request. |
ENV:REMOTE_USER |
When a document is protected by HTTP authentication, this variable contains the username used to log in. |
ENV:HTTP_USER_AGENT |
The text supplied by client software to identify it. |
ENV:HTTP_otherstuff |
HTTP headers supplied by the client are mapped on to HTTP_ variables. |
ENV:SERVER_SOFTWARE |
A string provided by the web server to identify it. |
ENV:REQUEST_URI |
The path portion of the URL for the MML document being processed. |
Todo: write this section.
MML provides some variables and functions which allow you to do things commonly done in web-based scripting, but which perl doesn't normally provide easy access to.
MML provides some hashes containing things that might be useful in embedded code...
%MML::Var |
All of the user-defined MML variables that have been set for this document and its associated style. |
%MML::SysVar |
Environment variables as provided by the web server. Equivalent to %ENV, but provided for completeness. |
%MML::Form |
Form variables as supplied by the client in either the entity body (a POST request) or in the URL (a GET request). Multiple values are separated by a null character (\0). |
%MML::Cookies |
All of the cookies the client sent for this document. |
The following functions are provided for convenience...
MML::escapehtml($text) |
Returns the contents of $text with all HTML special characters escaped. This string is suitable for insertion into HTML attributes or tags. |
MML::addheader($name,$value) |
Adds a HTTP header to the response. This function is only available within initscripts. |
MML::formdate($format,$ctime) |
Formats the time/date specified as a UNIX timestamp in $ctime (or, if omitted, the current time) into a string in the specified format. Format string is mostly identical to SSI date formatting. |
MML::urldecode($text) |
Decodes a string in www-form-urlencoded format and returns the result. |
MML::urlencode($text) |
Returns a string suitable for inclusion in a URL. |
MML::duration($numberofseconds) |
Takes a number of seconds as a parameter and returns that value in a more appropriate unit along with the name of that unit, eg: "5 minutes". |
MML::documentinfo($type) |
Returns information about the current document.
$type can be lastmod, created,
httppath or localpath |