text stringlengths 12 786k |
|---|
let full_state_name_of_cookie_name cookie_level cookiename = let _pref , cookiename = Ocsigen_lib . String . sep ' ' | cookiename in let secure , cookiename = Ocsigen_lib . String . sep ' ' | cookiename in let site_dir_str , cookiename = Ocsigen_lib . String . sep ' ' | cookiename ... |
let getcookies secure cookie_level cookienamepref cookies = let length = String . length cookienamepref in let last = length - 1 in Ocsigen_cookie_map . Map_inner . fold ( fun name value beg -> if String . first_diff cookienamepref name 0 last = length then try let expcn = full_state_name_of_cookie_n... |
let eliom_params_after_action = Polytables . make_key ( ) |
let tab_cookie_action_info_key = Polytables . make_key ( ) |
type cpi = client_process_info = { cpi_ssl : bool ; cpi_hostname : string ; cpi_server_port : int ; cpi_original_full_path : string list } |
let matches_regexp name ( _ , re ) = try let _ = Re . exec re name in true with Not_found -> false |
let matches_regexps regexps ( name , _ ) = List . exists ( matches_regexp name ) regexps |
let get_session_info ~ sitedata ~ req previous_extension_err = let req_whole = req and ri = req . Ocsigen_extensions . request_info and ci = req . Ocsigen_extensions . request_config in let rc = Ocsigen_request . request_cache ri in let no_post_param , p = match Ocsigen_request . post_params ri ci... |
module Omit_persistent_storage = struct let check_if_omitting_storage ( ) = match get_sp_option ( ) with | Some { sp_request ; sp_sitedata = { omitpersistentstorage = Some rules } } -> let apply_rule = function | HeaderRule ( header_name , regexp ) -> ( match Ocsigen_request . heade... |
module Ocsipersist = struct include Ocsipersist module Polymorphic = struct include Ocsipersist . Polymorphic let add table key value = Omit_persistent_storage . not_if_omitting_storage ( fun ( ) -> add table key value ) let remove table key = Omit_persistent_storage . not_if_omitting_storage ( fun... |
module Persistent_tables = struct let polymorphic_tables = ref [ ] let functorial_tables = ref [ ] let create name = polymorphic_tables := name :: ! polymorphic_tables ; Ocsipersist . Polymorphic . open_table name let add_functorial_table t = functorial_tables := t :: ! functorial_tables let re... |
type ' a wrapper = ' a Eliom_wrap . wrapper |
let make_wrapper f = Eliom_wrap . create_wrapper f |
let empty_wrapper ( ) = Eliom_wrap . empty_wrapper |
let react_up_unwrap_id : unwrap_id = Eliom_wrap . id_of_int react_up_unwrap_id_int |
let react_down_unwrap_id : unwrap_id = Eliom_wrap . id_of_int react_down_unwrap_id_int |
let signal_down_unwrap_id : unwrap_id = Eliom_wrap . id_of_int signal_down_unwrap_id_int |
let comet_channel_unwrap_id : unwrap_id = Eliom_wrap . id_of_int comet_channel_unwrap_id_int |
let bus_unwrap_id : unwrap_id = Eliom_wrap . id_of_int bus_unwrap_id_int |
let patch_request_info ( { Ocsigen_extensions . request_info } as r ) = let u = Ocsigen_request . uri request_info in match Uri . get_query_param u nl_get_appl_parameter with | Some _ -> { r with Ocsigen_extensions . request_info = ( let get_params_flat = List . remove_assoc nl_get_appl_par... |
let get_site_dir sitedata = sitedata . site_dir |
let get_site_dir_string sitedata = sitedata . site_dir_string |
let get_secure ~ secure_o ~ sitedata ( ) = match secure_o with None -> sitedata . secure_cookies | Some s -> s |
module To_and_of_shared = struct type wrapper type ' a t = { server : ' a to_and_of ; client : ' a to_and_of Eliom_client_value . t option ; wrapper : wrapper } let wrapper : wrapper = Obj . magic @@ Eliom_wrap . create_wrapper @@ function | { client = Some tao } -> tao | { client... |
let client_html_file ( ) = failwith " client_html_file is only defined on client " |
type scope_hierarchy = | User_hier of string | Default_ref_hier | Default_comet_hier |
type user_scope = [ ` Session_group of scope_hierarchy | ` Session of scope_hierarchy | ` Client_process of scope_hierarchy ] |
type scope = [ ` Site | user_scope ] |
type all_scope = [ scope | ` Global | ` Request ] |
type session_group_scope = [ ` Session_group of scope_hierarchy ] |
type session_scope = [ ` Session of scope_hierarchy ] |
type client_process_scope = [ ` Client_process of scope_hierarchy ] |
type user_level = [ ` Session_group | ` Session | ` Client_process ] |
type cookie_level = [ ` Session | ` Client_process ] |
type cookie_scope = [ ` Session of scope_hierarchy | ` Client_process of scope_hierarchy ] |
let level_of_user_scope : [ < user_scope ] -> [ > user_level ] = function | ` Session _ -> ` Session | ` Session_group _ -> ` Session_group | ` Client_process _ -> ` Client_process |
let cookie_level_of_user_scope : [ < user_scope ] -> [ > cookie_level ] = function | ` Session _ | ` Session_group _ -> ` Session | ` Client_process _ -> ` Client_process |
let cookie_scope_of_user_scope : [ < user_scope ] -> [ > cookie_scope ] = function | ` Session n | ` Session_group n -> ` Session n | ` Client_process n -> ` Client_process n |
let scope_hierarchy_of_user_scope : [ < user_scope ] -> scope_hierarchy = function | ` Session n | ` Session_group n | ` Client_process n -> n |
type full_state_name = { user_scope : user_scope ; secure : bool ; site_dir_str : string } |
module Full_state_name_table = Map . Make ( struct type t = full_state_name let compare = compare end ) |
type att_key_serv = | SAtt_no | SAtt_named of string | SAtt_anon of string | SAtt_csrf_safe of ( int * user_scope * bool option ) | SAtt_na_named of string | SAtt_na_anon of string | SAtt_na_csrf_safe of ( int * user_scope * bool option ) |
type na_key_serv = | SNa_no | SNa_void_keep | SNa_void_dontkeep | SNa_get_ of string | SNa_post_ of string | SNa_get ' of string | SNa_post ' of string | SNa_get_csrf_safe of ( int * user_scope * bool option ) | SNa_post_csrf_safe of ( int * user_scope * bool option ) |
type att_key_req = | RAtt_no | RAtt_named of string | RAtt_anon of string |
type na_key_req = | RNa_no | RNa_get_ of string | RNa_post_ of string | RNa_get ' of string | RNa_post ' of string |
let att_key_serv_of_req = function | RAtt_no -> SAtt_no | RAtt_named s -> SAtt_named s | RAtt_anon s -> SAtt_anon s |
let na_key_serv_of_req = function | RNa_no -> SNa_no | RNa_post ' s -> SNa_post ' s | RNa_get ' s -> SNa_get ' s | RNa_post_ s -> SNa_post_ s | RNa_get_ s -> SNa_get_ s |
let eliom_suffix_internal_name = " __ ( suffix service ) __ " |
let pnl_param_prefix = nl_param_prefix ^ " p_ " |
let npnl_param_prefix = nl_param_prefix ^ " n_ " |
let nl_is_persistent n = n . [ 0 ] = ' p ' |
type client_process_info = { cpi_ssl : bool ; cpi_hostname : string ; cpi_server_port : int ; cpi_original_full_path : Url . path } |
type sess_info = { si_other_get_params : ( string * string ) list ; si_all_get_params : ( string * string ) list ; si_all_post_params : ( string * string ) list option ; si_all_file_params : ( string * file_info ) list option ; si_service_session_cookies : string Full_state_name_tabl... |
type eliom_js_page_data = { ejs_global_data : ( Eliom_runtime . global_data * Eliom_wrap . unwrapper ) option ; ejs_request_data : Eliom_runtime . request_data ; ejs_event_handler_table : Eliom_runtime . RawXML . event_handler_table ; ejs_client_attrib_table : Eliom_runtime . RawXML . cl... |
let ( ) = assert ( tyxml_unwrap_id_int = 1 ) |
let ( ) = assert ( client_value_unwrap_id_int = 7 ) |
let ( ) = assert ( global_data_unwrap_id_int = 8 ) |
let make_actual_path path = let rec aux accu path = match accu , path with | [ ] , " . . " :: path ' -> aux accu path ' | _ :: accu ' , " . . " :: path ' -> aux accu ' path ' | _ , a :: path ' -> aux ( a :: accu ) path ' | _ , [ ] -> accu in match ... |
let is_client_app = ref false |
let prefixlength = String . length nl_param_prefix |
let prefixlengthminusone = prefixlength - 1 |
let split_nl_prefix_param l = let rec aux other map = function | [ ] -> map , other | ( ( n , _ ) as a ) :: l -> if String . first_diff n nl_param_prefix 0 prefixlengthminusone = prefixlength then try let last = String . index_from n prefixlength ' . ' in let nl_param_name = String... |
let split_prefix_param pref l = let len = String . length pref in List . partition ( fun ( n , _ ) -> try String . sub n 0 len = pref with Invalid_argument _ -> false ) l |
let remove_prefixed_param pref l = let len = String . length pref in let rec aux = function | [ ] -> [ ] | ( ( n , _ ) as a ) :: l -> ( try if String . sub n 0 len = pref then aux l else a :: aux l with Invalid_argument _ -> a :: aux l ) in aux l |
let remove_na_prefix_params l = remove_prefixed_param na_co_param_prefix l |> List . remove_assoc naservice_name |> List . remove_assoc naservice_num |
let filter_na_get_params = List . filter @@ fun ( s , ( _ : string ) ) -> s = naservice_name || s = naservice_num || String . sub s 0 ( String . length na_co_param_prefix ) = na_co_param_prefix |
type ( ' a , ' b ) foundornot = Found of ' a | Notfound of ' b |
type ' a dircontent = Vide | Table of ' a direlt ref String . Table . t |
let empty_dircontent ( ) = Vide |
type meth = [ ` Get | ` Post | ` Put | ` Delete | ` Other ] |
type page_table_key = { key_state : att_key_serv * att_key_serv ; key_meth : meth } |
type ( ' params , ' result ) service = { s_id : anon_params_type * anon_params_type ; mutable s_max_use : int option ; s_expire : ( float * float ref ) option ; s_f : bool -> ' params -> ' result Lwt . t } |
type ' a to_and_of = { of_string : string -> ' a ; to_string : ' a -> string } |
let backtrace_lwt = let lwt_slot_re = Re . Str . regexp " Called from Lwt . " in fun skip -> let stack = Printexc . get_callstack 16 in let stack_length = Printexc . raw_backtrace_length stack in let rec loop acc i = if i >= stack_length then acc else match let open Printexc in Slot . format i ... |
let get_default_hostname ( ) = Url . Current . host |
let get_default_port ( ) = 80 |
let get_default_sslport ( ) = 443 |
let default_protocol_is_https ( ) = Url . Current . protocol = " https " |
let get_default_links_xhr ( ) = true |
let debug_timings = ref false |
let is_tracing = ref false |
let set_tracing value = is_tracing := value |
let get_tracing ( ) = ! is_tracing |
let get_debugmode ( ) = try Js . to_bool Js . Unsafe . global . ## ___eliom_debug_mode_ with _ -> false |
let get_default_hostname ( ) = let sitedata = Eliom_request_info . find_sitedata " get_default_hostname " in sitedata . Eliom_common . config_info . Ocsigen_extensions . default_hostname |
let get_default_port ( ) = let sitedata = Eliom_request_info . find_sitedata " get_default_port " in sitedata . Eliom_common . config_info . Ocsigen_extensions . default_httpport |
let get_default_sslport ( ) = let sitedata = Eliom_request_info . find_sitedata " get_default_sslport " in sitedata . Eliom_common . config_info . Ocsigen_extensions . default_httpsport |
let default_protocol_is_https ( ) = let sitedata = Eliom_request_info . find_sitedata " default_protocol_is_https " in sitedata . Eliom_common . config_info . Ocsigen_extensions . default_protocol_is_https |
let get_default_links_xhr ( ) = let sitedata = Eliom_request_info . find_sitedata " get_default_links_xhr " in sitedata . Eliom_common . default_links_xhr # get |
let set_default_links_xhr ? override_configfile : _ v = let sitedata = Eliom_request_info . find_sitedata " set_default_links_xhr " in sitedata . Eliom_common . default_links_xhr # set v |
let get_config_default_charset_sp sp = Ocsigen_charset_mime . default_charset sp . Eliom_common . sp_request . Ocsigen_extensions . request_config . Ocsigen_extensions . charset_assoc |
let get_config_default_charset ( ) = let sp = Eliom_common . get_sp ( ) in get_config_default_charset_sp sp |
let get_config_info_sp sp = sp . Eliom_common . sp_request . Ocsigen_extensions . request_config |
let get_config_info ( ) = let sp = Eliom_common . get_sp ( ) in get_config_info_sp sp |
let get_config ( ) = match Eliom_common . global_register_allowed ( ) with | Some _ -> ! Eliommod . config | None -> raise ( Eliom_common . Eliom_site_information_not_available " Eliom_config . get_config " ) |
let parse_config ? pcdata ? other_elements elements = Ocsigen_extensions . Configuration . process_elements ~ in_tag :! Eliommod . config_in_tag ? pcdata ? other_elements ~ elements ( get_config ( ) ) |
module MakeManip ( Kind : sig type ' + a elt val toelt : ' a elt -> Xml . elt end ) ( To_dom : sig val of_element : ' a Kind . elt -> Dom_html . element Js . t end ) ( Of_dom : sig val of_element : Dom_html . element Js . t -> ' a Kind . elt end ) ( Id : sig type ' a id ... |
module Svg = struct module F = Svg . F module D = Svg . D module R = Svg . R module C = struct let node ? init : _ x = x let attr ? init : _ x = x end type ' + a elt = ' a F . elt type ' + a attrib = ' a F . attrib type uri = F . uri module Of_dom = Eliom_content_core . Svg . ... |
module Html = struct module F = struct include Html . F module Arg = struct include Html . F module Svg = Eliom_content_core . Svg . F let uri_of_fun = Eliom_content_core . Xml . uri_of_fun let attrib_of_service s info = Eliom_content_core . ( Html . F . to_attrib ( Xml . internal_event_ha... |
module Svg = struct module F = Svg . F module D = Svg . D module R = struct module Raw = Eliom_shared_content . Svg . R include Raw let pcdata _ = ` Unimplemented end module Id = Svg . Id type ' + a elt = ' a F . elt type ' a wrap = ' a F . wrap type ' a list_wrap = ' a F . lis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.