Ejemplo n.º 1
0
 /**
  * Gets the sql data dump for a specific sql file (for example ext_tables.sql)
  *
  * @param string $sqlFile
  * @return string
  */
 protected function getSqlDataDumpForFile($sqlFile)
 {
     $sqlData = '';
     if (file_exists($sqlFile)) {
         $sqlContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($sqlFile);
         $fieldDefinitions = $this->installToolSqlParser->getFieldDefinitions_fileContent($sqlContent);
         $sqlData = $this->databaseUtility->dumpStaticTables($fieldDefinitions);
     }
     return $sqlData;
 }
Ejemplo n.º 2
0
 /**
  * Determine all create table statements which create the sys_file* tables
  *
  * @return array
  */
 protected function getRequiredUpdates()
 {
     $requiredUpdates = array();
     $fileContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl(PATH_t3lib . 'stddb/tables.sql');
     $FDfile = $this->installerSql->getFieldDefinitions_fileContent($fileContent);
     $FDdb = $this->installerSql->getFieldDefinitions_database(TYPO3_db);
     $diff = $this->installerSql->getDatabaseExtra($FDfile, $FDdb);
     $update_statements = $this->installerSql->getUpdateSuggestions($diff);
     foreach ((array) $update_statements['create_table'] as $string) {
         if (preg_match('/^CREATE TABLE sys_file($|_)?/', $string)) {
             $requiredUpdates[] = $string;
         }
     }
     return $requiredUpdates;
 }