28 parent::__construct();
29 $this->title =
'Update database schema: Modify tables and fields';
39 $contextService = $this->objectManager->get(
'TYPO3\\CMS\\Install\\Service\\ContextService');
40 $description =
'There are tables or fields in the database which need to be changed.<br /><br />' .
41 'This update wizard can be run only when there are no other update wizards left to make sure they have all needed fields unchanged.<br /><br />' .
42 'If you want to apply changes selectively, <a href="Install.php?install[action]=importantActions&install[context]=' . $contextService->getContextString() .
'&install[controller]=tool">go to Database Analyzer</a>.';
45 $updateSuggestions = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);
47 return isset($updateSuggestions[
'change']);
60 $updateSuggestions = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);
62 if (!isset($updateSuggestions[
'change'])) {
68 Change the following fields in tables: 71 <ol class="t3-install-form-label-after">%s</ol> 75 Change the following keys in tables: 78 <ol class="t3-install-form-label-after">%s</ol> 81 <li class="labelAfter"> 82 <label><strong>%1$s</strong>: %2$s</label> 85 $fieldItems = array();
87 foreach ($databaseDifferences[
'diff'] as $tableName => $difference) {
88 if ($difference[
'fields']) {
89 $fieldNames = array();
90 foreach ($difference[
'fields'] as $fieldName =>
$sql) {
91 $fieldNames[] = $fieldName;
93 $fieldItems[] = sprintf($item, $tableName, implode(
', ', $fieldNames));
95 if ($difference[
'keys']) {
97 foreach ($difference[
'keys'] as $keyName =>
$sql) {
98 $keyNames[] = $keyName;
100 $keyItems[] = sprintf($item, $tableName, implode(
', ', $keyNames));
103 if (!empty($fieldItems)) {
104 $result .= sprintf($fieldsList, implode(
'', $fieldItems));
106 if (!empty($keyItems)) {
107 $result .= sprintf($keysList, implode(
'', $keyItems));
124 $updateStatements = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);
126 $customMessagesArray = array();
127 foreach ((array)$updateStatements[
'change'] as $query) {
128 $GLOBALS[
'TYPO3_DB']->admin_query($query);
129 $dbQueries[] = $query;
130 if (
$GLOBALS[
'TYPO3_DB']->sql_error()) {
131 $customMessagesArray[] =
'SQL-ERROR: ' . htmlspecialchars(
$GLOBALS[
'TYPO3_DB']->sql_error());
135 if (!empty($customMessagesArray)) {
136 $customMessages =
'Update process not fully processed. This can happen because of dependencies of table fields and ' .
137 'indexes. Please repeat this step! Following errors occurred:' . LF . LF . implode(LF, $customMessagesArray);
140 return count($customMessagesArray) === 0;
getUserInput($inputPrefix)
performUpdate(array &$dbQueries, &$customMessages)
checkForUpdate(&$description)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]