You are here

private function DrupalSiteArchiveSource::arrayToIni in Backup and Migrate 5.0.x

Translate a 2d array to an INI string which can be written to a file.

Parameters

array $info: The array to convert. Must be an array of sections each of which is an array of field/value pairs.

Return value

string The data in INI format.

1 call to DrupalSiteArchiveSource::arrayToIni()
DrupalSiteArchiveSource::getManifestFile in src/Drupal/Source/DrupalSiteArchiveSource.php
Get a file which contains the file.

File

src/Drupal/Source/DrupalSiteArchiveSource.php, line 122

Class

DrupalSiteArchiveSource
@package Drupal\backup_migrate\Drupal\Source

Namespace

Drupal\backup_migrate\Drupal\Source

Code

private function arrayToIni(array $info) {
  $content = "";
  foreach ($info as $section => $data) {
    $content .= '[' . $section . ']' . "\n";
    foreach ($data as $key => $val) {
      $content .= $key . " = \"" . $val . "\"\n";
    }
    $content .= "\n";
  }
  return $content;
}