$tables = '';
$schema_only_patterns =
[];
foreach ($schema_only as $match) { $schema_only_patterns[] = '/^' .
$match . '$/';
} foreach ($this->
getTables($connection) as $table) { $schema =
$this->
getTableSchema($connection,
$table);
// Check for schema only.
if (empty($schema_only_patterns) ||
preg_replace($schema_only_patterns, '',
$table)) { $data =
$this->
getTableData($connection,
$table);
} else { $data =
[];
} $tables .=
$this->
getTableScript($table,
$schema,
$data,
$insert_count);
} $script =
$this->
getTemplate();
// Substitute in the version.
$script =
str_replace('{{VERSION}}', \Drupal::VERSION,
$script);
// Substitute in the tables.
$script =
str_replace('{{TABLES}}',
trim($tables),
$script);