module Extensions: sig .. end
type of URLs, without parameter
exception Ocsigen_404
exception Ocsigen_Is_a_directory
exception Ocsigen_malformed_url
exception Ocsigen_Internal_Error of string
exception Bad_config_tag_for_extension of string
exception Error_in_config_file of string
type url_path = string list
type of URLs, without parameter
type current_url = string list
type current_dir = string list
type cookies =
| |
Set of string list option * float option * (string * string) list |
| |
Unset of (string list option * string list) |
Type used for cookies to set. The url_path option is for the path,
The float option is the timestamp for the expiration date.
type cookieslist = cookies list
val change_cookie : cookies ->
string list option * float option * (string * string) list
type file_info = {
|
tmp_filename : string; |
|
filesize : int64; |
|
original_filename : string; |
}
The files sent in the request
Note that the files are cancelled once the request has been fulfilled
type request_info = {
|
ri_url : string; |
|
ri_path_string : string; |
|
ri_path : string list; |
|
ri_params : string; |
|
ri_host : string option; |
|
ri_get_params : (string * string) list Lazy.t; |
|
ri_post_params : (string * string) list Lwt.t Lazy.t; |
|
ri_files : (string * file_info) list Lwt.t Lazy.t; |
|
ri_inet_addr : Unix.inet_addr; |
|
ri_ip : string; |
|
ri_port : int; |
|
ri_user_agent : string; |
|
ri_cookies : (string * string) list Lazy.t; |
|
ri_ifmodifiedsince : float option; |
|
ri_http_frame : Predefined_senders.Stream_http_frame.http_frame; |
}
The request
If you force ri_files or ri_post_params, the request is fully read,
so it is not possible any more to read it from ri_http_frame
(and vice versa).
type result = {
}
The result of a page generation
type charset_tree_type
Charset for each directory
type answer =
The result given by the extension (filter or page generation)
module R: sig .. end
We register for each extension four functions: a function that will be called for each
virtual server, generating two functions:, one that will be called to generate the pages
(from charset (string option) and request_info), one to parse the configuration file, a function that will be called at the beginning
of the initialisation phase , a function that will be called at the end of the initialisation phase
of the server, a function that will create an error message from the exceptions
that may be raised during the initialisation phase, and raise again
all other exceptions
val get_config : unit -> Simplexmlparser.xml list
While loading an extension,
get the configuration tree between <dynlink></dynlink>