Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:3913:    }       me->set_configuration( this_object() );       module_type = moduleinfo->type;    if (module_type & MODULE_TYPE_MASK)    {    if(!(module_type & MODULE_CONFIG))    {    if (err = catch { -  me->defvar("_priority", 5, DLOCALE(12, "Priority"), TYPE_INT_LIST, -  DLOCALE(13, "The priority of the module. 9 is highest and 0 is lowest." -  " Modules with the same priority can be assumed to be " -  "called in random order."), -  ({0, 1, 2, 3, 4, 5, 6, 7, 8, 9})); +  me->defvar("_priority", Variable. +  Priority(5, 0, DLOCALE(12, "Priority"), +  DLOCALE(13, "<p>The priority of the module.</p>\n" +  "<p>Modules with the same priority " +  "can be assumed to be " +  "called in random order.</p>\n")))-> +  set_range(0, query("max_priority"));    }) {    throw(err);    }    }      #ifdef MODULE_LEVEL_SECURITY    if( (module_type & ~(MODULE_LOGGER|MODULE_PROVIDER|MODULE_USERDB)) != 0 )    {   // me->defvar("_sec_group", "user", DLOCALE(14, "Security: Realm"),   // TYPE_STRING,
Roxen.git/server/base_server/configuration.pike:4596:    }    obsolete[ep] = 0;    }       foreach((array)obsolete, string ep) {    if (!ep || (ep == "")) continue;    json_logger->unbind(ep);    }   }    + protected void set_module_max_priority(Variable.Variable var) + { +  int new_max_priority = var->query(); +  foreach(sorted_modules, RoxenModule me) { +  Variable.Variable pri = me->getvar("_priority"); +  if (!pri) continue; +  pri->set_range(0, new_max_priority); +  } + } +    protected void create()   {    if (!name) error ("Configuration name not set through bootstrap_info.\n");       json_logger = ConfigurationLogger(combine_path_unix("conf", name), ([ ]), UNDEFINED);      // int st = gethrtime();    roxen.add_permission( "Site:"+name, LOC_C(306,"Site")+": "+name );       // for now only these two. In the future there might be more variables.
Roxen.git/server/base_server/configuration.pike:4676:    set ("compat_level", roxen.roxen_ver);    // Note to developers: This setting can be accessed through    // id->conf->query("compat_level") or similar, but observe that that    // call is not entirely cheap. It's therefore advisable to put it in    // a local variable if the compatibility level is to be tested    // frequently. It's perfectly all right to do that in e.g. the    // module start function, since the documentation explicitly states    // that a reload of all modules is necessary to propagate a change    // of the setting.    +  defvar("max_priority", +  Variable.IntChoice(9, ({ 9, 99, 999, 9999 }), 0, +  DLOCALE(0, "Maximum priority"), +  DLOCALE(0, "<p>The maximum priority value " +  "for modules.</p>\n" +  "<p>In most cases the default (9) " +  "is fine, but in some configurations " +  "there may be more than 10 modules " +  "of the same type that would otherwise " +  "conflict with each other.</p>\n" +  "<p>Note that existing module priorities " +  "will be scaled accordingly when this " +  "value is changed.</p>")))-> +  set_changed_callback(set_module_max_priority); +     defvar("Log", 1, DLOCALE(28, "Logging: Enabled"),    TYPE_FLAG, DLOCALE(29, "Log requests"));       defvar("LogFormat", #"\   # The default format follows the Combined Log Format, a slight   # extension of the Common Log Format - see   # http://httpd.apache.org/docs/1.3/logs.html#combined   *: $ip-number - $user [$cern-date] \"$method $full-resource $protocol\" $response $length \"$referrer\" \"$user-agent-raw\"      # The following line is an extension of the above that adds useful