package eliom
Install
Dune Dependency
Authors
Maintainers
Sources
md5=3aeeca5f734f8e932b5a00fbfd43bd26
sha512=d92948949c81fe5b84f7d262b72653175d4f69574cbb4f85433f3a40df436e9e78b3f024ebcd98cb0e1c8ec45af0e3f9cd1153187549883f4ddfd32feeee3176
doc/eliom.server/Eliom_config/index.html
Module Eliom_config
Source
This module makes also possible get information from the configuration file.
It make also possible to add configuration options in configuration file for your Eliom modules. Use Eliom_config.parse_config
for that.
Example:
<eliommodule ...> <myoption myattr="...">myvalue</myoption> </eliommodule>
Set frequency for garnage collection of both in memory data and service sessions. None
means never.
Set frequency for garbage collection of service sessions. None
means never.
Set frequency for garbage collection of in memory data sessions. None
means never.
Set frequency for garbage collection of persistent data sessions. None
means never.
val set_volatile_timeout :
?scope_hierarchy:Eliom_common.scope_hierarchy ->
cookie_level:[< `Session | `Client_process ] ->
int option ->
unit
val set_data_timeout :
?scope_hierarchy:Eliom_common.scope_hierarchy ->
cookie_level:[< `Session | `Client_process ] ->
int option ->
unit
val set_service_timeout :
?scope_hierarchy:Eliom_common.scope_hierarchy ->
cookie_level:[< `Session | `Client_process ] ->
int option ->
unit
val set_persistent_timeout :
?scope_hierarchy:Eliom_common.scope_hierarchy ->
cookie_level:[< `Session | `Client_process ] ->
int option ->
unit
The function get_default_hostname ()
returns the hostname declared in the config file (<host defaulthostname="...">
) or the default machine hostname. In that case, absolute URL will use that hostname.
The function get_default_port ()
returns the port number declared in the config file (<host defaulthttpport="...">
) or -> unit 80 if undeclared.
The function get_default_sslport ()
returns the https port number declared in the config file (<host defaulthttpsport="...">
) or 443 if undeclared.
The function default_protocol_is_https ()
returns true
if there is option (<host defaultprotocol="https">
)or false otherwise. In that case, absolute links will use https protocol even if the current request is http.
The function get_config_default_charset ()
returns the default charset for this site.
The provided value serves as a default value for the optional parameter ~xhr
in the functions Eliom_registration.*.{a, get_form, post_form, lwt_get_form, lwt_post_form}
(cf. Eliom_registration.Html.a
et al.). This value can also be set in the config file.
The function get_config ()
returns the information of the configuration file concerning that site (between <eliommodule>
and </eliommodule>
or <eliom>
and </eliom>
).
Warning: You must call that function during the initialisation of your module (not during a Lwt thread or a service) otherwise it will raise the exception Eliom_common.Eliom_site_information_not_available
. If you want to build a statically linkable module, you must call this function inside the initialisation function given to Eliom_service.register_eliom_module
.
val parse_config :
?pcdata:(string -> unit) ->
?other_elements:(string -> (string * string) list -> Xml.xml list -> unit) ->
Ocsigen_extensions.Configuration.element list ->
unit
Process the configuration (same as the one returned by <<a_api module="Eliom_config" | val get_config>>
) by a given specification (cf. <<a_api project="ocsigenserver" | type Ocsigen_extensions.Configuration.element >>
)
The function get_config_info ()
returns the information concerning the current request from the configuration files (must be called during a request). The configuration may have been modified by previous Ocsigen server extensions.
Same as Ocsigen_config.get_debugmode
. On client side, returns false
for now.