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 - 2001, Roxen IS. - // $Id: module.pike,v 1.122 2001/08/09 16:59:56 mast Exp $ + // $Id: module.pike,v 1.123 2001/08/13 18:20:10 per Exp $      #include <module_constants.h>   #include <module.h>   #include <request_trace.h>      constant __pragma_save_parent__ = 1;      inherit "basic_defvar";   mapping(string:array(int)) error_log=([]);   
Roxen.git/server/base_server/module.pike:58:    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, cname);    }    return _module_identifier;   #endif   }    + RoxenModule this_module() + { +  return this_object(); // To be used from subclasses. + } +    string _sprintf()   {    return sprintf ("RoxenModule(%s)", _module_identifier || "?");   }      array register_module()   {    return ({    this_object()->module_type,    this_object()->module_name,
Roxen.git/server/base_server/module.pike:397:   }      static void create_sql_tables( mapping(string:array(string)) defenitions )   //! Create multiple tables in one go. See @[get_my_table]   {    foreach( indices( defenitions ), string t )    get_my_table( t, defenitions[t] );   }      static string sql_table_exists( string name ) + //! Return the real name of the table 'name' if it exists.   {    if(strlen(name))    name = "_"+name;       string res = hash(_my_configuration->name)->digits(36)    + "_" + replace(sname(),"#","_") + name;       return catch(get_my_sql()->query( "SELECT * FROM "+res+" LIMIT 1" ))?0:res;   }         static string get_my_table( string|array(string) name, -  void|array(string)|string defenition ) +  void|array(string)|string defenition, +  string|void comment )   //! @decl string get_my_table( string name, array(string) types )   //! @decl string get_my_table( string name, string defenition )   //! @decl string get_my_table( string defenition )   //! @decl string get_my_table( array(string) defenition )   //!   //! Returns the name of a table in the 'shared' database that is   //! unique for this module. It is possible to select another database   //! by using @[set_my_db] before calling this function.   //!   //! You can use @[create_sql_tables] instead of this function if you want
Roxen.git/server/base_server/module.pike:474:    }    if( arrayp( defenition ) )    defenition *= ", ";       if( catch(sql->query( "SELECT * FROM "+res+" LIMIT 1" )) )    {    mixed error =    catch    {    get_my_sql()->query( "CREATE TABLE "+res+" ("+defenition+")" ); +  DBManager.is_module_table( this_object(), my_db, res, +  oname+"\0"+comment );    };    if( error )    {    if( strlen( name ) )    name = " "+name;    report_error( "Failed to create table"+name+": "+    describe_error( error ) );    return 0;    }    return __my_tables[ "&"+oname+";" ] = res;