function drush_archive_guess_manifest

8.0.x archive.drush.inc drush_archive_guess_manifest($path)
6.x archive.drush.inc drush_archive_guess_manifest($path)
7.x archive.drush.inc drush_archive_guess_manifest($path)
5.x archive.drush.inc drush_archive_guess_manifest($path)
master archive.drush.inc drush_archive_guess_manifest($path)

Try to find docroot and DB dump file in an extracted archive.

Parameters

string $path The location of the extracted archive.:

Return value

array The manifest data.

1 call to drush_archive_guess_manifest()
drush_archive_restore in commands/core/archive.drush.inc
Command callback. Restore web site(s) from a site archive file.

File

commands/core/archive.drush.inc, line 441
An early implementation of Site Archive dump/restore. See http://groups.drupal.org/site-archive-format.

Code

function drush_archive_guess_manifest($path) {
  $db_file = drush_scan_directory($path, '/\.sql$/', array('.', '..', 'CVS'), 0, 0);

  if (file_exists($path . '/index.php')) {
    $docroot = './';
  }
  else {
    $directories = glob($path . '/*', GLOB_ONLYDIR);
    $docroot = reset($directories);
  }

  $ini = array(
    'Global' => array(
      
      // Very crude detection of a platform...
      'archiveformat' => (drush_drupal_version($docroot) ? 'platform' : 'site'),
    ),
    'default' => array(
      'docroot' => $docroot,
      'sitedir' => 'sites/default',
      'database-default-file' => key($db_file),
    ),
  );

  return $ini;
}