--- parser3/src/main/pa_request.C 2002/06/12 10:58:43 1.208 +++ parser3/src/main/pa_request.C 2002/06/12 14:09:49 1.211 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: pa_request.C,v 1.208 2002/06/12 10:58:43 paf Exp $ + $Id: pa_request.C,v 1.211 2002/06/12 14:09:49 paf Exp $ */ #include "pa_sapi.h" @@ -136,10 +136,10 @@ void Request::configure_admin(VStateless if(Value *vcharsets=conf_class.get_element(*charsets_name)) { if(Hash *charsets=vcharsets->get_hash(0)) charsets->for_each(load_charset); - else + else if(!vcharsets->get_string()) throw Exception("parser.runtime", 0, - "$" CHARSETS_NAME " must be hash"); + "$" MAIN_CLASS_NAME ":" CHARSETS_NAME " must be hash"); } // configure root options @@ -160,8 +160,7 @@ void Request::configure_admin(VStateless */ void Request::core( - const char *root_config_filespec, bool root_config_fail_on_read_problem, - const char *site_config_filespec, bool site_config_fail_on_read_problem, + const char *config_filespec, bool config_fail_on_read_problem, bool header_only) { #ifdef RESOURCES_DEBUG @@ -173,23 +172,13 @@ gettimeofday(&mt[0],NULL); try { char *auto_filespec=(char *)malloc(MAX_STRING); - // loading root config - if(root_config_filespec) { + // loading config + if(config_filespec) { 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( filespec, - true/*ignore class_path*/, root_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, + true/*ignore class_path*/, config_fail_on_read_problem, main_class_name, main_class); } @@ -496,11 +485,14 @@ VStateless_class *Request::use_buf(const VStateless_class& cclass=COMPILE(source, aclass, name, base_class, file); // locate and execute possible @conf[] static - if(const String *conf=execute_nonvirtual_method(cclass, *conf_method_name, true /*we need does_exist(result)*/)) - configure_admin(cclass, conf); + const Method *method_called; + execute_nonvirtual_method(cclass, *conf_method_name, 0/*no result needed*/, + &method_called); + if(method_called) + configure_admin(cclass, &method_called->name); // locate and execute possible @auto[] static - execute_nonvirtual_method(cclass, *auto_method_name, false /*no result needed*/); + execute_nonvirtual_method(cclass, *auto_method_name, 0/*no result needed*/); return &cclass; }