You are here

function prod_check_update_7104 in Production check & Production monitor 7

Add new dbconnect_path setting to database to prevent warnings.

File

prod_monitor/prod_monitor.install, line 278

Code

function prod_check_update_7104() {
  $table = 'prod_monitor_sites';

  // Fetch all settings.
  $result = db_select($table, 'psm')
    ->fields('psm', array(
    'id',
    'settings',
  ))
    ->execute();

  // Update all sites to add new setting.
  foreach ($result as $site) {
    $settings = unserialize($site->settings);
    $settings['dbconnect_path'] = '';
    $site->settings = serialize($settings);

    // Write to DB.
    drupal_write_record($table, $site, array(
      'id',
    ));
  }
}