Beispiel #1
0
 /**
  * Writes the Database-Settings into the clansuite.config.php
  *
  * @param $data_array
  * @return BOOLEAN true, if clansuite.config.php could be written to the INSTALLATION_ROOT
  */
 public static function write_config_settings($data_array)
 {
     // Read/Write Handler for config files
     include KOCH . 'Config/Adapter/Ini.php';
     // the base class is needed for \Koch\Config\Adpater\Ini
     if (false === class_exists('AbstractConfig', false)) {
         require KOCH . 'Config/AbstractConfig.php';
     }
     // throw not needed setting out, before data_array gets written to file
     unset($data_array['step_forward']);
     unset($data_array['lang']);
     unset($data_array['database']['create_database']);
     // read skeleton settings, which are the minimum settings for initial startup
     // (these are not asked from user during installation)
     $installer_config = \Koch\Config\Adapter\Ini::readConfig(INSTALLATION_ROOT . 'config.skeleton.ini');
     // array merge: overwrite the array to the left, with the array to the right, when keys identical
     $data_array = array_merge_recursive($data_array, $installer_config);
     // write Config File to the APPLICATION/configuration folder
     if (false === \Koch\Config\Adapter\Ini::writeConfig(ROOT_APP . 'configuration/clansuite.php', $data_array)) {
         // config not written
         return false;
     }
     // config written
     return true;
 }