Roxen.git / server / base_server / global_variables.pike

version» Context lines:

Roxen.git/server/base_server/global_variables.pike:1:   // This file is part of Roxen Webserver.   // Copyright © 1996 - 2000, Roxen IS. - // $Id: global_variables.pike,v 1.42 2000/09/13 11:36:05 lange Exp $ + // $Id: global_variables.pike,v 1.43 2000/09/19 09:26:28 per Exp $      /*   #pragma strict_types   */   #define DEFVAR string,int|string,string|mapping,int,string|mapping(string:string),void|array(string),void|function:void   #define BDEFVAR string,int|string,string|mapping,int,string|mapping(string:string),void|array(string),void|mapping(string:mapping(string:string)):void      #include <module.h>   #include <roxen.h>   #include <config.h>
Roxen.git/server/base_server/global_variables.pike:213:   };      class LanguageList {    inherit Variable.MultipleChoice;       static string _title( string lang ) {    return roxenp()->language(roxenp()->locale->get(), "language")(lang);    }   }    + array(string) old_module_dirs; + void zap_all_module_caches( Variable.Variable v ) + { +  if( !equal( v->query(), old_module_dirs ) ) +  { +  report_notice( "Module path changed - clearing all module caches\n" ); +  catch(this_object()->clear_all_modules_cache()); +  catch(map( this_object()->module_cache->list(), +  this_object()->module_cache->delete )); +  catch +  { +  string f = dirname( master()->make_ofilename( "tmp" ) ); +  foreach( glob("*.o",get_dir( f )), string ofile ) +  catch(rm( ofile )); +  }; +  old_module_dirs = v->query(); +  } + } +    void define_global_variables( )   {    int p;       defvar("port_options", PortOptions());       defvar("RestoreConnLogFull", 0,    LOCALE(90, "Logging: Log entire file length in restored connections"),    TYPE_FLAG,    LOCALE(91, "If this toggle is enabled log entries for restored connections "
Roxen.git/server/base_server/global_variables.pike:582:    TYPE_FLAG,    LOCALE(173, "Save the variable documentation strings as comments "    "in the configuration files. Only useful if you read or "    "edit the config files directly."));   }         void restore_global_variables()   {    setvars(retrieve("Variables", 0)); +  old_module_dirs = query( "ModuleDirs" ); +  getvar( "ModuleDirs" )->add_changed_callback( zap_all_module_caches );   }      static mapping(string:mixed) __vars = ([ ]);      // These two should be documented somewhere. They are to be used to   // set global, but non-persistent, variables in Roxen.   mixed set_var(string var, mixed to)   {    return __vars[var] = to;   }      mixed query_var(string var)   {    return __vars[var];   }