|
|
| version 1.209, 2002/06/12 11:40:32 | version 1.211.2.1, 2002/06/20 16:31:08 |
|---|---|
| Line 136 void Request::configure_admin(VStateless | Line 136 void Request::configure_admin(VStateless |
| if(Value *vcharsets=conf_class.get_element(*charsets_name)) { | if(Value *vcharsets=conf_class.get_element(*charsets_name)) { |
| if(Hash *charsets=vcharsets->get_hash(0)) | if(Hash *charsets=vcharsets->get_hash(0)) |
| charsets->for_each(load_charset); | charsets->for_each(load_charset); |
| else | else if(!vcharsets->get_string()) |
| throw Exception("parser.runtime", | throw Exception("parser.runtime", |
| 0, | 0, |
| "$" CHARSETS_NAME " must be hash"); | "$" MAIN_CLASS_NAME ":" CHARSETS_NAME " must be hash"); |
| } | } |
| // configure root options | // configure root options |
| Line 160 void Request::configure_admin(VStateless | Line 160 void Request::configure_admin(VStateless |
| */ | */ |
| void Request::core( | void Request::core( |
| const char *root_config_filespec, bool root_config_fail_on_read_problem, | const char *config_filespec, bool config_fail_on_read_problem, |
| const char *site_config_filespec, bool site_config_fail_on_read_problem, | |
| bool header_only) { | bool header_only) { |
| #ifdef RESOURCES_DEBUG | #ifdef RESOURCES_DEBUG |
| Line 173 gettimeofday(&mt[0],NULL); | Line 172 gettimeofday(&mt[0],NULL); |
| try { | try { |
| char *auto_filespec=(char *)malloc(MAX_STRING); | char *auto_filespec=(char *)malloc(MAX_STRING); |
| // loading root config | // loading config |
| if(root_config_filespec) { | if(config_filespec) { |
| String& filespec=*NEW String(pool()); | String& filespec=*NEW String(pool()); |
| filespec.APPEND_CLEAN(root_config_filespec, 0, "root_config", 0); | filespec.APPEND_CLEAN(config_filespec, 0, "config", 0); |
| main_class=use_file( | main_class=use_file( |
| filespec, | filespec, |
| true/*ignore class_path*/, root_config_fail_on_read_problem, | true/*ignore class_path*/, config_fail_on_read_problem, |
| main_class_name, main_class); | |
| } | |
| // loading site config | |
| if(site_config_filespec) { | |
| String& filespec=*NEW String(pool()); | |
| filespec.APPEND_CLEAN(site_config_filespec, 0, "site_config", 0); | |
| main_class=use_file( | |
| filespec, | |
| true/*ignore class_path*/, site_config_fail_on_read_problem, | |
| main_class_name, main_class); | main_class_name, main_class); |
| } | } |
| Line 485 VStateless_class *Request::use_file(cons | Line 474 VStateless_class *Request::use_file(cons |
| if(!source) | if(!source) |
| return base_class; | return base_class; |
| return use_buf(source, file_spec->cstr(), 0/*new class*/, name, base_class); | return use_buf(source, *file_spec, file_spec->cstr(), 0/*new class*/, name, base_class); |
| } | } |
| VStateless_class *Request::use_buf(const char *source, const char *file, | VStateless_class *Request::use_buf(const char *source, |
| const String& filespec, const char *filespec_cstr, | |
| VStateless_class *aclass, const String *name, | VStateless_class *aclass, const String *name, |
| VStateless_class *base_class) { | VStateless_class *base_class) { |
| // compile loaded class | // compile loaded class |
| VStateless_class& cclass=COMPILE(source, aclass, name, base_class, file); | VStateless_class& cclass=COMPILE(source, aclass, name, base_class, filespec_cstr); |
| VString *vfilespec=NEW VString(filespec); | |
| // locate and execute possible @conf[] static | // locate and execute possible @conf[] static |
| const Method *method_called; | const Method *method_called; |
| execute_nonvirtual_method(cclass, *rootconf_method_name, 0/*no result needed*/, | execute_nonvirtual_method(cclass, |
| &method_called); | *conf_method_name, vfilespec, |
| 0/*no result needed*/, &method_called); | |
| if(method_called) | if(method_called) |
| configure_admin(cclass, &method_called->name); | configure_admin(cclass, &method_called->name); |
| // locate and execute possible @auto[] static | // locate and execute possible @auto[] static |
| execute_nonvirtual_method(cclass, *auto_method_name, 0/*no result needed*/); | execute_nonvirtual_method(cclass, |
| *auto_method_name, vfilespec, | |
| 0/*no result needed*/); | |
| return &cclass; | return &cclass; |
| } | } |
| Line 600 const String& Request::mime_type_of(cons | Line 595 const String& Request::mime_type_of(cons |
| else | else |
| throw Exception("parser.runtime", | throw Exception("parser.runtime", |
| mime_types->origin_string(), | mime_types->origin_string(), |
| "MIME-TYPE table column elements must not be empty"); | MIME_TYPES_NAME " table column elements must not be empty"); |
| } | } |
| return *NEW String(pool(), "application/octet-stream"); | return *NEW String(pool(), "application/octet-stream"); |
| } | } |