$path =
$backup->
getPath();
$dir = \
dirname($path);
// Only unzip at the first time
if ((int) $offset === 0
) { $this->
extractedFilesFromZip($path,
$dir);
} // Get list of data sql files
$dataFiles =
$this->
getDirectoryList($dir . '/',
['datasql'
]);
$numFiles = null;
if (!
empty($dataFiles)) { $tables =
[];
// Group by table
foreach ($dataFiles as $file) { // securely remove extensions
$table =
preg_replace('/\.[0-9a-zA-Z]+\.datasql$/', '',
basename($file));
$tables[$table][] =
$file;
}