Roxen.git / server / base_server / module.pike

version» Context lines:

Roxen.git/server/base_server/module.pike:1:   // This file is part of Roxen Webserver.   // Copyright © 1996 - 2000, Roxen IS. - // $Id: module.pike,v 1.92 2000/07/04 03:45:20 per Exp $ + // $Id: module.pike,v 1.93 2000/07/18 15:55:53 jhs Exp $      #include <module_constants.h>   #include <module.h>   #include <request_trace.h>      inherit "basic_defvar";   mapping(string:array(int)) error_log=([]);      constant is_module = 1;   constant module_type = MODULE_ZERO;
Roxen.git/server/base_server/module.pike:70:   string fix_cvs(string from)   {    from = replace(from, ({ "$", "Id: "," Exp $" }), ({"","",""}));    sscanf(from, "%*s,v %s", from);    return replace(from,"/","-");   }      int module_dependencies(Configuration configuration,    array (string) modules,    int|void now) + //! If your module depends on other modules present in the server, + //! calling <pi>module_dependencies()</pi>, supplying an array of + //! module identifiers (the filename minus extension, more or less).   {    if(configuration || my_configuration() )    (configuration||my_configuration())->add_modules( modules, now );    return 1;   }      string file_name_and_stuff()   {    return ("<b>Loaded from:</b> "+(roxen->filename(this_object()))+"<br>"+    (this_object()->cvs_version?    "<b>CVS Version: </b>"+    fix_cvs(this_object()->cvs_version)+"\n":""));   }         Configuration my_configuration() -  + //! Returns the Configuration object of the virtual server the module + //! belongs to.   {    if(_my_configuration)    return _my_configuration;    Configuration conf;    foreach(roxen->configurations, conf)    if(conf->otomod[this_object()])    return _my_configuration = conf;    return 0;   }      nomask void set_configuration(Configuration c)   {    if(_my_configuration && _my_configuration != c)    error("set_configuration() called twice.\n");    _my_configuration = c;   }      void set_module_creator(string|array(string) c) -  + //! Set the name and optionally email address of the author of the + //! module. Names on the format "author name <author_email>" will + //! end up as links on the module's information page in the admin + //! interface. In the case of multiple authors, an array of such + //! strings can be passed.   {    module_creator = c;   }      void set_module_url(string to) -  + //! A common way of referring to a location where you maintain + //! information about your module or similar. The URL will turn up + //! on the module's information page in the admin interface, + //! referred to as the module's home page.   {    module_url = to;   }      void free_some_sockets_please(){}      void start(void|int num, void|Configuration conf) {}      string status() {}   
Roxen.git/server/base_server/module.pike:140:   {    save_me();   }      string comment()   {    return "";   }      string query_internal_location() + //! Returns the internal mountpoint, where <ref>find_internal()</ref> + //! is mounted.   {    if(!_my_configuration)    error("Please do not call this function from create()!\n");    return _my_configuration->query_internal_location(this_object());   }    - /* Per default, return the value of the module variable 'location' */ +    string query_location()   {    string s;    catch{s = query("location");};    return s;   }      array(string) location_urls() - // The first is the canonical one built with MyWorldLocation. + //! Returns an array of all locations where the module is mounted. + //! The first is the canonical one built with MyWorldLocation.   {    string loc = query_location();    if (!loc) return ({});    if(!_my_configuration)    error("Please do not call this function from create()!\n");    string world_url = _my_configuration->query("MyWorldLocation");    if (world_url == "") world_url = 0;    array(string) urls = copy_value(_my_configuration->query("URLs"));    string hostname = gethostname();    for (int i = 0; i < sizeof (urls); i++) {
Roxen.git/server/base_server/module.pike:409:   {    _api_functions[name] = ({ f, types });   }      mapping api_functions()   {    return _api_functions;   }      mapping query_tag_callers() + //! Compat   {    mapping m = ([]);    foreach(glob("tag_*", indices( this_object())), string q)    if(functionp( this_object()[q] ))    m[replace(q[4..], "_", "-")] = this_object()[q];    return m;   }      mapping query_container_callers()   {