Menu

#71 Overwritting config by DB

v1.0 (example)
closed
Tracker (27)
5
2011-01-06
2011-01-05
No

server.cpp, function Cserver::read_config(), file config must reads before DB, was:
Csql_result result = Csql_query(m_database, "select name, value from @config where value is not null").execute();
for (Csql_row row; row = result.fetch_row();) {
if (config.set(row[0].s(), row[1].s()))
std::cerr << "unknown config name: " << row[0].s() << std::endl;
}
Cconfig config;
config.load(m_conf_file);
now:
Cconfig config;
config.load(m_conf_file);
Csql_result result = Csql_query(m_database, "select name, value from @config where value is not null").execute();
for (Csql_row row; row = result.fetch_row();) {
if (config.set(row[0].s(), row[1].s()))
std::cerr << "unknown config name: " << row[0].s() << std::endl;
}

Discussion

  • Anonymous

    Anonymous - 2011-01-05
    • labels: --> Tracker
    • milestone: --> v1.0 (example)
     
  • Olaf van der Spek

    Why?

     
  • Olaf van der Spek

    • assigned_to: nobody --> olafvdspek
     
  • Anonymous

    Anonymous - 2011-01-06

    I think that main config in file and in DB we can overwrite some vars in mysql table.
    Sorry, im russian.

     
  • Anonymous

    Anonymous - 2011-01-06
    • summary: Bug with DB config, fixed --> DB config overwritting
     
  • Anonymous

    Anonymous - 2011-01-06
    • summary: DB config overwritting --> Overwritting config by DB
     
  • Anonymous

    Anonymous - 2011-01-06

    Bad that there i can't edit comments. Actually, I think that in the config file contains the initial values of variables, but now using the database, we can rewrite them, because it's easier than edit the file.
    (c) Translated by Google

     
  • Olaf van der Spek

    It's the other way around. The conf file overrides the config table.

     
  • Anonymous

    Anonymous - 2011-01-06
    • status: open --> closed
     

Log in to post a comment.

Auth0 Logo