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 - 2004, Roxen IS. - // $Id: module.pike,v 1.219 2005/05/11 12:59:56 wellhard Exp $ + // $Id: module.pike,v 1.220 2005/06/15 12:32:02 anders 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:2032:    return ddc;   }      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; +  + "_" + replace(sname(), ({ "#","-" }), ({ "_","_" })) + name;       return catch(get_my_sql()->query( "SELECT * FROM "+res+" LIMIT 1" ))?0:res;   }         static string|int get_my_table( string|array(string) name,    void|array(string)|string definition,    string|void comment,    int|void flag )   //! @decl string get_my_table( string name, array(string) types )
Roxen.git/server/base_server/module.pike:2095:    {    definition = name;    oname = name = "";    }    else if(strlen(name))    name = "_"+(oname = name);       Sql.Sql sql = get_my_sql();       string res = hash(_my_configuration->name)->digits(36) -  + "_" + replace(sname(),"#","_") + name; +  + "_" + replace(sname(),({ "#","-" }), ({ "_","_" })) + name;       if( !sql )    {    report_error("Failed to get SQL handle, permission denied for "+my_db+"\n");    return 0;    }    if( arrayp( definition ) )    definition *= ", ";       if( catch(sql->query( "SELECT * FROM "+res+" LIMIT 1" )) )