TYPO3 CMS  TYPO3_6-2
InitUpdateWizard.php
Go to the documentation of this file.
1 <?php
3 
24 
28  protected $title = 'Initialize database tables for the File Abstraction Layer (FAL)';
29 
33  protected $installerSql;
34 
38  public function __construct() {
39  $this->installerSql = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
40  }
41 
48  public function checkForUpdate(&$description) {
49  $description = 'Create the database tables which are required for the File Abstraction Layer in order to work. Do this as the first step for all further wizards related to FAL.';
50  return count($this->getRequiredUpdates()) > 0;
51  }
52 
60  public function performUpdate(array &$dbQueries, &$customMessages) {
61  $updates = $this->getRequiredUpdates();
62  foreach ($updates as $update) {
63  $GLOBALS['TYPO3_DB']->admin_query($update);
64  $dbQueries[] = $update;
65  }
66  return TRUE;
67  }
68 
74  protected function getRequiredUpdates() {
75  $requiredUpdates = array();
77  \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('core'). 'ext_tables.sql'
78  );
79  $FDfile = $this->installerSql->getFieldDefinitions_fileContent($fileContent);
80  $FDdb = $this->installerSql->getFieldDefinitions_database(TYPO3_db);
81  $diff = $this->installerSql->getDatabaseExtra($FDfile, $FDdb);
82  $update_statements = $this->installerSql->getUpdateSuggestions($diff);
83  foreach ((array) $update_statements['create_table'] as $string) {
84  if (preg_match('/^CREATE TABLE sys_file($|_)?/', $string)) {
85  $requiredUpdates[] = $string;
86  }
87  }
88  return $requiredUpdates;
89  }
90 
91 }
static getUrl($url, $includeHeader=0, $requestHeaders=FALSE, &$report=NULL)
performUpdate(array &$dbQueries, &$customMessages)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]