1 config.inc public ConfigFileStorage::importArchive($file_uri)

Import an archive of configuration files into the config storage managed by this object.

Parameters

string $file_uri: The URI of the tar archive file to import.

Return value

bool TRUE on success, FALSE otherwise.

Throws

ConfigStorageException

Overrides ConfigStorageInterface::importArchive

File

core/includes/config.inc, line 1260
This is the API for configuration storage.

Class

ConfigFileStorage
Defines the file storage controller.

Code

public function importArchive($file_uri) {
  $realpath = backdrop_realpath($file_uri);

  try {
    $archiver = new ArchiverTar($realpath);
    $archiver->extract($this->directory, $archiver->listContents());
  }
  catch (\Exception $e) {
    watchdog('config', 'Could not extract the archive @uri: @error', array('@uri' => $file_uri, '@error' => $e->getMessage()), WATCHDOG_ERROR);
    throw new ConfigStorageException($e->getMessage(), 0, $e);
  }
  return TRUE;
}