You are here

function backup_migrate_files_destination_archivesource::generate_manifest in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/sources.archivesource.inc \backup_migrate_files_destination_archivesource::generate_manifest()
  2. 7.3 includes/sources.archivesource.inc \backup_migrate_files_destination_archivesource::generate_manifest()

Generate a manifest file.

2 calls to backup_migrate_files_destination_archivesource::generate_manifest()
backup_migrate_files_destination_archivesource::_backup_to_file_cli in includes/sources.archivesource.inc
Backup from this source.
backup_migrate_files_destination_archivesource::_backup_to_file_php in includes/sources.archivesource.inc
Backup from this source.

File

includes/sources.archivesource.inc, line 126
A destination type for saving locally to the server.

Class

backup_migrate_files_destination_archivesource
A destination type for saving locally to the server.

Code

function generate_manifest() {
  $info = array(
    'Global' => array(
      'datestamp' => time(),
      'formatversion' => '2011-07-02',
      'generator' => 'Backup and Migrate (http://drupal.org/project/backup_migrate)',
      'generatorversion' => BACKUP_MIGRATE_VERSION,
    ),
    'Site 0' => array(
      'version' => VERSION,
      'name' => variable_get('site_name', ''),
      'docroot' => 'docroot',
      'sitedir' => 'docroot/' . conf_path(),
      'database-file-default' => 'database.sql',
      'database-file-driver' => 'mysql',
    ),
  );
  if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
    $info['Site 0']['files-private'] = 'docroot/' . file_directory_path();
    $info['Site 0']['files-mode'] = 'private';
  }
  else {
    $info['Site 0']['files-public'] = 'docroot/' . file_directory_path();
    $info['Site 0']['files-mode'] = 'public';
  }
  $ini = $this
    ->_array_to_ini($info);
  $tmpdir = backup_migrate_temp_directory();
  $filepath = $tmpdir . '/MANIFEST.ini';
  file_put_contents($filepath, $ini);
  return $filepath;
}