/** * Performs the update itself * * @param array pointer where to insert all DB queries made, so they can be shown to the user if wanted * @param string pointer to output custom messages * @return boolean true if update succeeded, false otherwise */ function performUpdate(&$dbQueries, &$customMessages) { $customMessages = ''; // if we just set it to an older version if ($this->userInput['version']) { $customMessages .= 'If you want to see what you need to do to use the new features, run the update wizard again!'; } $linesArr = $this->pObj->writeToLocalconf_control(); $version = $this->userInput['version'] ? $this->userInput['version'] : TYPO3_branch; $this->pObj->setValueInLocalconfFile($linesArr, '$TYPO3_CONF_VARS[\'SYS\'][\'compat_version\']', $version); $this->pObj->writeToLocalconf_control($linesArr, 0); $customMessages .= '<br />The compatibility version has been set to ' . $version . '.'; return 1; }
/** * Creates a specialized form to configure the database. * * @param array $markers * @param tx_install $instObj */ protected function createDatabaseForm(array &$markers, tx_install $instObj) { $error_missingConnect = ' <p class="typo3-message message-error"> <strong> There is no connection to the database! </strong> <br /> (Username: <em>' . TYPO3_db_username . '</em>, Host: <em>' . TYPO3_db_host . '</em>, Using Password: YES) <br /> Go to Step 1 and enter a valid username and password! </p> '; // Add header marker for main template $markers['header'] = 'Select database'; // There should be a database host connection at this point if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) { // Get the template file $templateFile = @file_get_contents(t3lib_extMgm::extPath('dbal') . $this->templateFilePath . 'install.html'); // Get the template part from the file $template = t3lib_parsehtml::getSubpart($templateFile, '###TEMPLATE###'); // Get the subpart for the database choice step $formSubPart = t3lib_parsehtml::getSubpart($template, '###DATABASE_FORM###'); // Get the subpart for the database options $step3DatabaseOptionsSubPart = t3lib_parsehtml::getSubpart($formSubPart, '###DATABASEOPTIONS###'); $dbArr = $instObj->getDatabaseList(); $dbIncluded = FALSE; foreach ($dbArr as $dbname) { // Define the markers content for database options $step3DatabaseOptionMarkers = array('databaseValue' => htmlspecialchars($dbname), 'databaseSelected' => $dbname === TYPO3_db ? 'selected="selected"' : '', 'databaseName' => htmlspecialchars($dbname)); // Add the option HTML to an array $step3DatabaseOptions[] = t3lib_parsehtml::substituteMarkerArray($step3DatabaseOptionsSubPart, $step3DatabaseOptionMarkers, '###|###', 1, 1); if ($dbname === TYPO3_db) { $dbIncluded = TRUE; } } if (!$dbIncluded && TYPO3_db) { // // Define the markers content when no access $step3DatabaseOptionMarkers = array('databaseValue' => htmlspecialchars(TYPO3_db), 'databaseSelected' => 'selected="selected"', 'databaseName' => htmlspecialchars(TYPO3_db) . ' (NO ACCESS!)'); // Add the option HTML to an array $step3DatabaseOptions[] = t3lib_parsehtml::substituteMarkerArray($step3DatabaseOptionsSubPart, $step3DatabaseOptionMarkers, '###|###', 1, 1); } // Substitute the subpart for the database options $content = t3lib_parsehtml::substituteSubpart($formSubPart, '###DATABASEOPTIONS###', implode(chr(10), $step3DatabaseOptions)); // Define the markers content $step3SubPartMarkers = array('step' => $instObj->step + 1, 'action' => htmlspecialchars($instObj->action), 'llOption2' => 'Select an EMPTY existing database:', 'llRemark2' => 'Any tables used by TYPO3 will be overwritten.', 'continue' => 'Continue'); // Add step marker for main template $markers['step'] = t3lib_parsehtml::substituteMarkerArray($content, $step3SubPartMarkers, '###|###', 1, 1); } else { // Add step marker for main template when no connection $markers['step'] = $error_missingConnect; } }
/** * Creates or displayes an error message telling the user that the submitted * form token is invalid. * * @return void */ protected function createValidationErrorMessage() { $this->installTool->addErrorMessage('Validating the security token of this form has failed. ' . 'Please reload the form and submit it again.'); }