frogsystem / fs2core

This is the official repository for Frogsystem 2 development.
http://www.frogsystem.de
2 stars 3 forks source link

Replace configuration tables containing only a row with configuration files #49

Closed Thoronador closed 12 years ago

Thoronador commented 12 years ago

Most configuration tables should be replaced by (PHP) configuration files. Those files could look like this:

<?php
  function getGlobalConfig()
  {
    return array(
      'id' => 1,
      'version' => '2.alix5',
      'virtualhost' => 'http://www.example.com',
      'admin_mail' => 'webmaster@example.com',
      ... //and so on
    );
  } //end of function
?>

Instead of doing a full SQL query every time just include the config file and call getGlobalConfig() instead. As an added bonus, this should also be a little bit faster than executing a database query every time the configuration settings are requested (which usually happens for every page load).

mrgrain commented 12 years ago

already implemented (todo: cleanup old tables)

Thoronador commented 12 years ago

Ah, I was not aware of that.

However, as far as I can see it, that change seems to be implemented for some selected configurations only (global/general and search configuration). There are several admin CP scripts that still use configuration tables. Among them are:

All the related configuration tables should get a similar replacement, something like the global configuration already has, or something like described above.

mrgrain commented 12 years ago
mrgrain commented 12 years ago

The remaining editor_config table and all the others one line tables are listed in Issue #64 and will be replaced when the regarding code is re-factored.