Beispiel #1
0
 /**
  * database configurationParameter difference calculator / setter
  * call dbsteward.db_config_parameter() to alter the database settings
  * because the database name is not known to dbsteward when creating the runnable sql
  *
  * @param  object $ofs  output file segmenter
  *
  * @return void
  */
 public static function update_database_config_parameters($ofs, $db_doc_old, $db_doc_new)
 {
     foreach (dbx::get_configuration_parameters($db_doc_new) as $new_param) {
         $old_param = null;
         if (is_object(dbsteward::$old_database)) {
             $old_param = dbx::get_configuration_parameter($db_doc_old, $new_param['name']);
         }
         if ($old_param == null || strcmp($old_param['value'], $new_param['value']) != 0) {
             $old_value = "not defined";
             if ($old_param != null) {
                 $old_value = $old_param['value'];
             }
             $sql = "SELECT dbsteward.db_config_parameter('" . $new_param['name'] . "', '" . $new_param['value'] . "'); -- old configurationParameter value: " . $old_value;
             $ofs->write($sql . "\n");
         }
     }
 }