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

version» Context lines:

pike.git/lib/modules/Search.pmod/Utils.pmod:1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Utils.pmod,v 1.32 2001/09/12 23:36:16 nilsson Exp $ + // $Id: Utils.pmod,v 1.33 2001/11/22 14:48:16 js Exp $      #if !constant(report_error)   #define report_error werror   #define report_debug werror   #define report_warning werror   #endif      #ifdef SEARCH_DEBUG   # define WERR(X) report_debug("search: "+(X)+"\n");   #else
pike.git/lib/modules/Search.pmod/Utils.pmod:292:    if(!sizeof(res))    THROW("No query profile " + name + " found.\n");       return query_profile_names[name] = (int)res[0]->id;    }       private int last_db_prof_stat = 0; // 1970       //! Returns a list of available database profiles.    array(string) list_db_profiles() { +  /*    if (time(1) - last_db_prof_stat < 5*60) -  return indices(db_profile_names); +  return indices(db_profile_names);*/    array res = get_db()->query("SELECT name, id FROM profile WHERE type=2");    db_profile_names = mkmapping(    res->name,    map(res->id, lambda(string s) { return (int) s; } ));    if(sizeof(res))    last_db_prof_stat = time(1);    return res->name;    }       private int last_query_prof_stat = 0; // 1970       //! Returns a list of available query profiles.    array(string) list_query_profiles()    { -  if (time(1) - last_query_prof_stat >= 5*60) { +  /* +  if (time(1) - last_query_prof_stat < 5*60) +  return indices(query_profile_names);*/    array res = get_db()->query("SELECT name, id FROM profile WHERE type=1");    query_profile_names = mkmapping( res->name, (array(int)) res->id );    if(sizeof(query_profile_names))    last_query_prof_stat = time(1);    } -  return indices(query_profile_names); -  } +        // Used when decoding text encoded pike data types.    private object compile_handler = class {    mapping(string:mixed) get_default_module() {    return ([ "aggregate_mapping":aggregate_mapping,    "aggregate_multiset":aggregate_multiset,    "aggregate":aggregate,    "allocate":allocate,    "this_program":0 ]);    }