Branch: Tag:

2000-09-09

2000-09-09 05:07:15 by Martin Stjernholm <mast@lysator.liu.se>

Fixed server init order when creating a site from a template.

Rev: server/base_server/configuration.pike:1.365
Rev: server/config_interface/standard/sites/site_templates/common.pike:1.16

1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: configuration.pike,v 1.364 2000/09/08 18:41:25 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.365 2000/09/09 05:07:12 mast Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>
2690:    after_init_hooks |= ({ what });   }    - static int got_no_delayed_load; + static int got_no_delayed_load = 0;   // 0 -> enabled delayed loading, 1 -> disable delayed loading,   // -1 -> don't change.    - void enable_all_modules() + void fix_no_delayed_load_flag()   { -  MODULE_LOCK; -  int q = query( "no_delayed_load" ); -  got_no_delayed_load = 0; -  low_init( ); -  if( got_no_delayed_load >= 0 && q != got_no_delayed_load ) { +  if( got_no_delayed_load >= 0 && +  query ("no_delayed_load") != got_no_delayed_load ) {    set( "no_delayed_load", got_no_delayed_load );    save_one( 0 );    }   }    - void low_init() + void enable_all_modules()   { -  +  MODULE_LOCK; +  low_init( ); +  fix_no_delayed_load_flag(); + } +  + void low_init(void|int modules_already_enabled) + {    if( inited )    return; // already done       int start_time = gethrtime(); -  +  if (!modules_already_enabled)    report_debug("\nEnabling all modules for "+query_name()+"... \n");       add_parse_module( (object)this_object() ); -  +  +  if (!modules_already_enabled) {    enabled_modules = retrieve("EnabledModules", this_object());    object ec = roxenloader.LowErrorContainer();    roxenloader.push_compile_error_handler( ec );
2744:    report_error( "While enabling modules in "+name+":\n"+ec->get() );    if( strlen( ec->get_warnings() ) )    report_warning( "While enabling modules in "+name+":\n"+ec->get_warnings()); +  }       foreach( ({this_object()})+indices( otomod ), object mod )    if( mod->ready_to_receive_requests )
2764:    after_init_hooks = ({});       inited = 1; +  if (!modules_already_enabled)    report_notice(LOC_S(4, "All modules for %s enabled in %3.1f seconds") +    "\n\n", query_name(), (gethrtime()-start_time)/1000000.0);   }