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.15 2001/07/20 22:30:22 nilsson Exp $ + // $Id: Utils.pmod,v 1.16 2001/07/26 04:50:08 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.   {    return Unicode.split_words_and_normalize( lower_case(what) );   }      public array(string) tokenize(string in)   //! Tokenize the input string (Note: You should first call normalize
pike.git/lib/modules/Search.pmod/Utils.pmod:79:    }       mixed get_search_value(string index) {    if(!search_values)    search_values = my_cache->get_value_mapping(search_profile_id);    return search_values[index];    }       Search.Database.MySQL get_database() {    if(!db) { + #if constant(DBManager)    db = Search.Database.MySQL( DBManager.db_url( get_database_value("db_name"), 1) ); -  + #endif    if(!db)    THROW("Could not aquire the database URL to database " +    get_database_value("db_name") + ".\n");    }    return db;    }       Search.RankingProfile get_ranking() {    if(!ranking)    ranking = Search.RankingProfile(8,
pike.git/lib/modules/Search.pmod/Utils.pmod:168:      class ProfileCache (string db_name) {       private mapping(int:ProfileEntry) entry_cache = ([]);    private mapping(int:mapping(string:mixed)) value_cache = ([]);    private mapping(string:int) db_profile_names = ([]);    private mapping(string:int) srh_profile_names = ([]);    private mapping(int:int) profile_stat = ([]);       private Sql.Sql get_db() { -  Sql.Sql db = DBManager.cached_get(db_name); +  Sql.Sql db; + #if constant(DBManager) +  db = DBManager.cached_get(db_name); + #endif    if(!db) THROW("Could not connect to database " + db_name + ".\n");    return db;    }       int(-1..1) up_to_datep(int profile_id) {    array(mapping(string:string)) res;    res = get_db()->query("SELECT altered, parent FROM wf_profile WHERE id=%d", profile_id);       // The profile is deleted. In such a rare event we take the    // trouble to review all our cached values.