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.103 2001/01/04 07:30:37 nilsson Exp $ + // $Id: module.pike,v 1.104 2001/01/19 16:37:43 per 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; - constant module_name = "Unnamed module"; - constant module_doc = "Undocumented"; - constant module_unique = 1; + // constant module_type = MODULE_ZERO; + // constant module_name = "Unnamed module"; + // constant module_doc = "Undocumented"; + constant module_unique = 1;         private string _module_identifier;   private Configuration _my_configuration;   static mapping _api_functions = ([]);      string|array(string) module_creator;   string module_url;   RXML.TagSet module_tag_set;   
Roxen.git/server/base_server/module.pike:42:    if (!_module_identifier) {    string|mapping name = register_module()[1];    if (mappingp (name)) name = name->standard;    string cname = sprintf ("%O", my_configuration());    if (sscanf (cname, "Configuration(%s", cname) == 1 &&    sizeof (cname) && cname[-1] == ')')    cname = cname[..sizeof (cname) - 2];    _module_identifier = sprintf ("%s,%s",    name    || this_object()->module_name_locale -  || module_name, cname); +  || this_object()->module_name, cname);    }    return _module_identifier;   }      string _sprintf()   {    return "RoxenModule(" +    (Roxen.get_modname (this_object()) || module_identifier()) + ")";   }      array register_module()   {    return ({ -  module_type, -  this_object()->module_name_locale || module_name, -  this_object()->module_doc_locale || module_doc, +  this_object()->module_type, +  this_object()->module_name_locale || this_object()->module_name, +  this_object()->module_doc_locale || this_object()->module_doc,    0,    module_unique,    });   }      string fix_cvs(string from)   {    from = replace(from, ({ "$", "Id: "," Exp $" }), ({"","",""}));    sscanf(from, "%*s,v %s", from);    return replace(from,"/","-");
Roxen.git/server/base_server/module.pike:155:      void start(void|int num, void|Configuration conf) {}      string status() {}      string info(Configuration conf)   {    return (this_object()->register_module()[2]);   }    + string sname( ) + { +  return my_configuration()->otomod[ this_object() ]; + } +    ModuleInfo my_moduleinfo( )   //! Returns the associated @ref{ModuleInfo} object   { -  string f = my_configuration()->otomod[ this_object() ]; +  string f = sname();    if( f ) return roxen.find_module( (f/"#")[0] );   }      void save_me()   {    my_configuration()->save_one( this_object() );    my_configuration()->module_changed( my_moduleinfo(), this_object() );   }      void save()
Roxen.git/server/base_server/module.pike:525:      mixed get_value_from_file(string path, string index, void|string pre)   {    Stdio.File file=Stdio.File();    if(!file->open(path,"r")) return 0;    if(index[sizeof(index)-2..sizeof(index)-1]=="()") {    return compile_string((pre||"")+file->read())[index[..sizeof(index)-3]]();    }    return compile_string((pre||"")+file->read())[index];   } +  +  +  + string get_my_table( string defenition ) + { +  string res = replace(sname(),"#","_"); +  if( catch(get_my_sql()->query( "SELECT * FROM "+res+" LIMIT 1" )) ) +  get_my_sql()->query( "CREATE TABLE "+res+" ("+defenition+")" ); +  return res; + } +  +  + Sql.Sql get_my_sql() + { +  return connect_to_my_mysql( 0, "roxen" ); + }