pike.git / lib / modules / Search.pmod / Utils.pmod

version» Context lines:

pike.git/lib/modules/Search.pmod/Utils.pmod:665:   //!   class Logger {       private string|Sql.Sql logdb;    private int profile;    private int stderr_logging;       private int last_log_purge_time;    private constant log_purge_freq = 8*60*60; // Purge log every 8 h or so.    -  private string indentation = " "; +  private string indentation = " " * 20;       private Sql.Sql get_db() {    Sql.Sql db;   #if constant(DBManager)    if(stringp(logdb))    db = DBManager.get(logdb);    else   #endif    db = logdb;       // if(!logdb || !logdb->query)    // throw( ({ "Couldn't find any database object.\n", backtrace() }) );       return db;    }    -  +  // Detection constant for code that instantiate this class to avoid +  // compilation errors. +  constant supports_flexible_indentation = 1; +     //! @decl void create(Sql.Sql db_object, int profile, int stderr_logging)    //! @decl void create(string db_url, int profile, int stderr_logging) -  void create(string|Sql.Sql _logdb, int _profile, int _stderr_logging, void|int indentation_width) { +  void create(string|Sql.Sql _logdb, int _profile, int _stderr_logging, void|int(0..) indentation_width) {    logdb = _logdb;    profile = _profile;    stderr_logging = _stderr_logging;    if (!zero_type(indentation_width)) { -  indentation = sprintf("%"+indentation_width+"n"); +  indentation = (" " * indentation_width);    }       // create table eventlog (event int unsigned auto_increment primary key,    // at timestamp not null, code int unsigned not null, extra varchar(255))       Sql.Sql db = get_db();       if(catch(db->query("SELECT code FROM eventlog WHERE event=0")))    db->query("CREATE TABLE eventlog ("    "event int unsigned auto_increment primary key,"