You are here

function _backup_migrate_array_to_ini in Backup and Migrate 7.2

Same name and namespace in other branches
  1. 8.2 backup_migrate.module \_backup_migrate_array_to_ini()
  2. 8.3 backup_migrate.module \_backup_migrate_array_to_ini()
  3. 6.3 backup_migrate.module \_backup_migrate_array_to_ini()
  4. 7.3 backup_migrate.module \_backup_migrate_array_to_ini()

Convert an associated array to an ini format string.

1 call to _backup_migrate_array_to_ini()
backup_migrate_destination::create_info_file in includes/destinations.inc
Create an ini file and write the meta data.

File

./backup_migrate.module, line 1045
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (e.g. cache_*)

Code

function _backup_migrate_array_to_ini($data, $prefix = '') {
  $content = "";
  foreach ($data as $key => $val) {
    if ($prefix) {
      $key = $prefix . '[' . $key . ']';
    }
    if (is_array($val)) {
      $content .= _backup_migrate_array_to_ini($val, $key);
    }
    else {
      $content .= $key . " = \"" . $val . "\"\n";
    }
  }
  return $content;
}