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.25 2001/08/14 19:46:19 nilsson Exp $ + // $Id: Utils.pmod,v 1.26 2001/08/16 21:22:32 nilsson Exp $      #if !constant(report_error)   #define report_error werror   #endif      public array(string) tokenize_and_normalize( string what )   //! This can be optimized quite significantly when compared to   //! tokenize( normalize( x ) ) in the future, currently it's not all   //! that much faster, but still faster.   {
pike.git/lib/modules/Search.pmod/Utils.pmod:291:    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);    array res = get_db()->query("SELECT name, id FROM wf_profile WHERE type=2");    db_profile_names = mkmapping(    res->name,    map(res->id, lambda(string s) { return (int) s; } )); -  last_db_prof_stat = time(1) - 2; +  if(sizeof(res)) +  last_db_prof_stat = time(1);    return res->name;    }       private int last_srh_prof_stat = 0; // 1970       //! Returns a list of available search profiles.    array(string) list_srh_profiles()    {    if (time(1) - last_srh_prof_stat >= 5*60) {    array res = get_db()->query("SELECT name, id FROM wf_profile WHERE type=1");    srh_profile_names = mkmapping( res->name, (array(int)) res->id ); -  last_srh_prof_stat = time(1) - 2; +  if(sizeof(srh_profile_names)) +  last_srh_prof_stat = time(1);    }    return indices(srh_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,