You are here

private function DrupalSiteArchiveSource::arrayToINI in Backup and Migrate 8.4

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/Source/DrupalSiteArchiveSource.php
Get a file which contains the file.

File

src/Source/DrupalSiteArchiveSource.php, line 126

Class

DrupalSiteArchiveSource
Class DrupalSiteArchiveSource.

Namespace

BackupMigrate\Drupal\Source

Code

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