9:- module(sw_config_handling, 10 [ get_config/2 11 ] 12). 13 14:- ( absolute_file_name(sw_app('config.pl'), P), 15 exists_file(P) -> 16 consult(P) ; 17 assertz(config(none, none)) 18 ).
26get_config(Key, Val) :- 27 config(Key, Val), !. 28get_config(Key, Val) :- 29 default(Key, Val).
35default(static_dir, static). 36default(templates_dir, templates). 37default(st_encoding, utf8). 38default(st_extension, html). 39default(st_cache, false). 40default(st_strip, false). 41default(st_frontend, simple). 42default(st_undefined, error)
Config Handling
Set framework attributes, looks for a
config.pl
file in project and assert facts. Otherwise, set reasonable defaults.*/