/** * Download data of an extension as sql statements * * @param string $extension * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException */ protected function downloadExtensionDataAction($extension) { $error = NULL; $sqlData = $this->installUtility->getExtensionSqlDataDump($extension); $dump = $sqlData['extTables'] . $sqlData['staticSql']; $fileName = $extension . '_sqlDump.sql'; $filePath = PATH_site . 'typo3temp/' . $fileName; $error = \TYPO3\CMS\Core\Utility\GeneralUtility::writeFileToTypo3tempDir($filePath, $dump); if (is_string($error)) { throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($error, 1343048718); } $this->fileHandlingUtility->sendSqlDumpFileToBrowserAndDelete($filePath, $fileName); }