/typo3/sysext/install/mod/class.tx_install.php
PHP | 8476 lines | 6717 code | 543 blank | 1216 comment | 728 complexity | 476370d9fe6f6190da6e2ab928087c75 MD5 | raw file
Possible License(s): GPL-2.0, Apache-2.0, BSD-3-Clause, BSD-2-Clause, AGPL-1.0, LGPL-3.0, GPL-3.0, MIT, LGPL-2.1
Large files files are truncated, but you can click here to view the full file
- <?php
- /***************************************************************
- * Copyright notice
- *
- * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
- * All rights reserved
- *
- * This script is part of the TYPO3 project. The TYPO3 project is
- * free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The GNU General Public License can be found at
- * http://www.gnu.org/copyleft/gpl.html.
- * A copy is found in the textfile GPL.txt and important notices to the license
- * from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- * This script is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
- /**
- * Contains the class for the Install Tool
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author Ingmar Schlecht <ingmar@typo3.org>
- */
- // include requirements definition:
- require_once(t3lib_extMgm::extPath('install') . 'requirements.php');
- // include session handling
- require_once(t3lib_extMgm::extPath('install') . 'mod/class.tx_install_session.php');
- // include update classes
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_charsetdefaults.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_compatversion.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_cscsplit.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_notinmenu.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_mergeadvanced.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_installsysexts.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_imagescols.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_installnewsysexts.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_statictemplates.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_t3skin.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_compressionlevel.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_migrateworkspaces.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_flagsfromsprite.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_addflexformstoacl.php');
- require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_imagelink.php');
- /**
- * Install Tool module
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author Ingmar Schlecht <ingmar@typo3.org>
- * @package TYPO3
- * @subpackage tx_install
- */
- class tx_install extends t3lib_install {
- var $templateFilePath = 'typo3/sysext/install/Resources/Private/Templates/';
- var $template;
- var $javascript;
- var $stylesheets;
- var $markers = array();
- var $messages = array();
- var $errorMessages = array();
- var $mailMessage = '';
- var $action = ''; // The url that calls this script
- var $scriptSelf = 'index.php'; // The url that calls this script
- var $updateIdentity = 'TYPO3 Install Tool';
- var $headerStyle ='';
- var $setAllCheckBoxesByDefault=0;
- var $allowFileEditOutsite_typo3conf_dir=0;
- var $INSTALL =array(); // In constructor: is set to global GET/POST var TYPO3_INSTALL
- var $checkIMlzw = 0; // If set, lzw capabilities of the available ImageMagick installs are check by actually writing a gif-file and comparing size
- var $checkIM = 0; // If set, ImageMagick is checked.
- var $dumpImCommands=1; // If set, the image Magick commands are always outputted in the image processing checker
- var $mode = ''; // If set to "123" then only most vital information is displayed.
- var $step = 0; // If set to 1,2,3 or GO it signifies various functions.
- var $totalSteps = 4; // Can be changed by hook to define the total steps in 123 mode
- // internal
- var $passwordOK=0; // This is set, if the password check was ok. The function init() will exit if this is not set
- var $silent=1; // If set, the check routines don't add to the message-array
- var $sections=array(); // Used to gather the message information.
- var $fatalError=0; // This is set if some error occured that will definitely prevent TYpo3 from running.
- var $sendNoCacheHeaders=1;
- var $config_array = array( // Flags are set in this array if the options are available and checked ok.
- 'gd'=>0,
- 'gd_gif'=>0,
- 'gd_png'=>0,
- 'gd_jpg'=>0,
- 'freetype' => 0,
- 'safemode' => 0,
- 'dir_typo3temp' => 0,
- 'dir_temp' => 0,
- 'im_versions' => array(),
- 'im' => 0,
- 'sql.safe_mode_user' => '',
- 'mysqlConnect' => 0,
- 'no_database' => 0
- );
- var $typo3temp_path='';
- /**
- * the session handling object
- *
- * @var tx_install_session
- */
- protected $session = NULL;
- /**
- * the form protection instance used for creating and verifying form tokens
- *
- * @var t3lib_formprotection_InstallToolFormProtection
- */
- protected $formProtection = NULL;
- var $menuitems = array(
- 'config' => 'Basic Configuration',
- 'database' => 'Database Analyser',
- 'update' => 'Upgrade Wizard',
- 'images' => 'Image Processing',
- 'extConfig' => 'All Configuration',
- 'cleanup' => 'Clean up',
- 'phpinfo' => 'phpinfo()',
- 'typo3conf_edit' => 'Edit files in typo3conf/',
- 'about' => 'About',
- 'logout' => 'Logout from Install Tool',
- );
- // PHP modules which are required. Can be changed by hook in getMissingPhpModules()
- protected $requiredPhpModules = array(
- 'fileinfo',
- 'filter',
- 'gd',
- 'json',
- 'mysql',
- 'pcre',
- 'session',
- 'SPL',
- 'standard',
- 'openssl',
- 'xml',
- 'zlib'
- );
- /**
- * Constructor
- *
- * @return void
- */
- function __construct() {
- parent::__construct();
- if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword']) {
- $this->outputErrorAndExit('Install Tool deactivated.<br />You must enable it by setting a password in typo3conf/localconf.php. If you insert the line below, the password will be \'joh316\':<br /><br />$TYPO3_CONF_VARS[\'BE\'][\'installToolPassword\'] = \'bacb98acf97e0b6112b1d1b650b84971\';', 'Fatal error');
- }
- if ($this->sendNoCacheHeaders) {
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
- header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
- header('Expires: 0');
- header('Cache-Control: no-cache, must-revalidate');
- header('Pragma: no-cache');
- }
- // ****************************
- // Initializing incoming vars.
- // ****************************
- $this->INSTALL = t3lib_div::_GP('TYPO3_INSTALL');
- $this->mode = t3lib_div::_GP('mode');
- if ($this->mode !== '123') {
- $this->mode = '';
- }
- if (t3lib_div::_GP('step') === 'go') {
- $this->step = 'go';
- } else {
- $this->step = intval(t3lib_div::_GP('step'));
- }
- // Let DBAL decide whether to load itself
- $dbalLoaderFile = $this->backPath . 'sysext/dbal/class.tx_dbal_autoloader.php';
- if (@is_file($dbalLoaderFile)) {
- include($dbalLoaderFile);
- }
- if ($this->mode === '123') {
- // Check for mandatory PHP modules
- $missingPhpModules = $this->getMissingPhpModules();
- if (count($missingPhpModules) > 0) {
- throw new RuntimeException('TYPO3 Installation Error: The following PHP module(s) is/are missing: <em>' .
- implode(', ', $missingPhpModules) .
- '</em><br /><br />You need to install and enable these modules first to be able to install TYPO3.',
- 1294587482
- );
- }
- // Load saltedpasswords if possible
- $saltedpasswordsLoaderFile = $this->backPath . 'sysext/saltedpasswords/classes/class.tx_saltedpasswords_autoloader.php';
- if (@is_file($saltedpasswordsLoaderFile)) {
- include($saltedpasswordsLoaderFile);
- }
- }
- $this->redirect_url = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('redirect_url'));
- $this->INSTALL['type'] = '';
- if ($_GET['TYPO3_INSTALL']['type']) {
- $allowedTypes = array(
- 'config', 'database', 'update', 'images', 'extConfig',
- 'cleanup', 'phpinfo', 'typo3conf_edit', 'about', 'logout'
- );
- if (in_array($_GET['TYPO3_INSTALL']['type'], $allowedTypes)) {
- $this->INSTALL['type'] = $_GET['TYPO3_INSTALL']['type'];
- }
- }
- if ($this->step == 4) {
- $this->INSTALL['type'] = 'database';
- }
- // Hook to raise the counter for the total steps in the 1-2-3 installer
- if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['additionalSteps'])) {
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['additionalSteps'] as $classData) {
- $hookObject = t3lib_div::getUserObj($classData);
- $this->totalSteps += (integer) $hookObject->executeAdditionalSteps($this);
- }
- }
- if ($this->mode=='123') {
- $tempItems = $this->menuitems;
- $this->menuitems = array(
- 'config' => $tempItems['config'],
- 'database' => $tempItems['database']
- );
- if (!$this->INSTALL['type'] || !isset($this->menuitems[$this->INSTALL['type']])) {
- $this->INSTALL['type'] = 'config';
- }
- } else {
- if (!$this->INSTALL['type'] || !isset($this->menuitems[$this->INSTALL['type']])) {
- $this->INSTALL['type'] = 'about';
- }
- }
- $this->action = $this->scriptSelf .
- '?TYPO3_INSTALL[type]=' . $this->INSTALL['type'] .
- ($this->mode? '&mode=' . $this->mode : '') .
- ($this->step? '&step=' . $this->step : '');
- $this->typo3temp_path = PATH_site.'typo3temp/';
- if (!is_dir($this->typo3temp_path) || !is_writeable($this->typo3temp_path)) {
- $this->outputErrorAndExit('Install Tool needs to write to typo3temp/. Make sure this directory is writeable by your webserver: ' . htmlspecialchars($this->typo3temp_path), 'Fatal error');
- }
- try {
- $this->session = t3lib_div::makeInstance('tx_install_session');
- } catch (Exception $exception) {
- $this->outputErrorAndExit($exception->getMessage());
- }
- // *******************
- // Check authorization
- // *******************
- if (!$this->session->hasSession()) {
- $this->session->startSession();
- }
- if ($this->session->isAuthorized() || $this->checkPassword()) {
- $this->passwordOK=1;
- $this->session->refreshSession();
- $enableInstallToolFile = PATH_typo3conf . 'ENABLE_INSTALL_TOOL';
- if (is_file ($enableInstallToolFile)) {
- // Extend the age of the ENABLE_INSTALL_TOOL file by one hour
- @touch($enableInstallToolFile);
- }
- if($this->redirect_url) {
- t3lib_utility_Http::redirect($this->redirect_url);
- }
- $this->formProtection = t3lib_formProtection_Factory::get(
- 't3lib_formprotection_InstallToolFormProtection'
- );
- $this->formProtection->injectInstallTool($this);
- } else {
- $this->loginForm();
- }
- }
- /**
- * Returns TRUE if submitted password is ok.
- *
- * If password is ok, set session as "authorized".
- *
- * @return boolean TRUE if the submitted password was ok and session was
- * authorized, FALSE otherwise
- */
- function checkPassword() {
- $p = t3lib_div::_GP('password');
- if ($p && md5($p) === $GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword']) {
- $this->session->setAuthorized();
- // Sending warning email
- $wEmail = $GLOBALS['TYPO3_CONF_VARS']['BE']['warning_email_addr'];
- if ($wEmail) {
- $subject = 'Install Tool Login at "' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '"';
- $email_body = 'There has been an Install Tool login at TYPO3 site "' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '" (' . t3lib_div::getIndpEnv('HTTP_HOST') . ') from remote address "' . t3lib_div::getIndpEnv('REMOTE_ADDR') . '" (' . t3lib_div::getIndpEnv('REMOTE_HOST') . ')';
- mail($wEmail,
- $subject,
- $email_body,
- 'From: TYPO3 Install Tool WARNING <>'
- );
- }
- return TRUE;
- } else {
- // Bad password, send warning:
- if ($p) {
- $wEmail = $GLOBALS['TYPO3_CONF_VARS']['BE']['warning_email_addr'];
- if ($wEmail) {
- $subject="Install Tool Login ATTEMPT at '".$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']."'";
- $email_body="There has been an Install Tool login attempt at TYPO3 site '".$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']."' (".t3lib_div::getIndpEnv('HTTP_HOST').").
- The MD5 hash of the last 5 characters of the password tried was '".substr(md5($p), -5)."'
- REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndpEnv('REMOTE_HOST').')';
- mail($wEmail,
- $subject,
- $email_body,
- 'From: TYPO3 Install Tool WARNING <>'
- );
- }
- }
- return FALSE;
- }
- }
- /**
- * Create the HTML for the login form
- *
- * Reads and fills the template.
- * Substitutes subparts when wrong password has been given
- * or the session has expired
- *
- * @return void
- */
- function loginForm() {
- $password = t3lib_div::_GP('password');
- $redirect_url = $this->redirect_url ? $this->redirect_url : $this->action;
- // Get the template file
- $templateFile = @file_get_contents(
- PATH_site . $this->templateFilePath . 'LoginForm.html'
- );
- // Get the template part from the file
- $template = t3lib_parsehtml::getSubpart(
- $templateFile, '###TEMPLATE###'
- );
- // Password has been given, but this form is rendered again.
- // This means the given password was wrong
- if (!empty($password)) {
- // Get the subpart for the wrong password
- $wrongPasswordSubPart = t3lib_parsehtml::getSubpart(
- $template, '###WRONGPASSWORD###'
- );
- // Define the markers content
- $wrongPasswordMarkers = array(
- 'passwordMessage' => 'The password you just tried has this md5-value:',
- 'password' => md5($password)
- );
- // Fill the markers in the subpart
- $wrongPasswordSubPart = t3lib_parsehtml::substituteMarkerArray(
- $wrongPasswordSubPart,
- $wrongPasswordMarkers,
- '###|###',
- TRUE,
- TRUE
- );
- }
- // Session has expired
- if (!$this->session->isAuthorized() && $this->session->isExpired()) {
- // Get the subpart for the expired session message
- $sessionExpiredSubPart = t3lib_parsehtml::getSubpart(
- $template, '###SESSIONEXPIRED###'
- );
- // Define the markers content
- $sessionExpiredMarkers = array(
- 'message' => 'Your Install Tool session has expired'
- );
- // Fill the markers in the subpart
- $sessionExpiredSubPart = t3lib_parsehtml::substituteMarkerArray(
- $sessionExpiredSubPart,
- $sessionExpiredMarkers,
- '###|###',
- TRUE,
- TRUE
- );
- }
- // Substitute the subpart for the expired session in the template
- $template = t3lib_parsehtml::substituteSubpart(
- $template,
- '###SESSIONEXPIRED###',
- $sessionExpiredSubPart
- );
- // Substitute the subpart for the wrong password in the template
- $template = t3lib_parsehtml::substituteSubpart(
- $template,
- '###WRONGPASSWORD###',
- $wrongPasswordSubPart
- );
- // Define the markers content
- $markers = array(
- 'siteName' => 'Site: ' .
- htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']),
- 'headTitle' => 'Login to TYPO3 ' . TYPO3_version . ' Install Tool',
- 'redirectUrl' => htmlspecialchars($redirect_url),
- 'enterPassword' => 'Password',
- 'login' => 'Login',
- 'message' => '
- <p class="typo3-message message-information">
- The Install Tool Password is <em>not</em> the admin password
- of TYPO3.
- <br />
- The default password is <em>joh316</em>. Be sure to change it!
- <br /><br />
- If you don\'t know the current password, you can set a new
- one by setting the value of
- $TYPO3_CONF_VARS[\'BE\'][\'installToolPassword\'] in
- typo3conf/localconf.php to the md5() hash value of the
- password you desire.
- </p>
- '
- );
- // Fill the markers in the template
- $content = t3lib_parsehtml::substituteMarkerArray(
- $template,
- $markers,
- '###|###',
- TRUE,
- TRUE
- );
- // Send content to the page wrapper function
- $this->output($this->outputWrapper($content));
- }
- /**
- * Calling function that checks system, IM, GD, dirs, database
- * and lets you alter localconf.php
- *
- * This method is called from init.php to start the Install Tool.
- *
- * @return void
- */
- function init() {
- // Must be called after inclusion of init.php (or from init.php)
- if (!defined('PATH_typo3')) exit;
- if (!$this->passwordOK) exit;
- // Setting stuff...
- $this->check_mail();
- $this->setupGeneral();
- $this->generateConfigForm();
- if (count($this->messages)) {
- t3lib_utility_Debug::debug($this->messages);
- }
- if ($this->step) {
- $this->output($this->outputWrapper($this->stepOutput()));
- } else {
- // Menu...
- switch($this->INSTALL['type']) {
- case 'images':
- $this->checkIM=1;
- $this->checkTheConfig();
- $this->silent=0;
- $this->checkTheImageProcessing();
- break;
- case 'database':
- $this->checkTheConfig();
- $this->silent=0;
- $this->checkTheDatabase();
- break;
- case 'update':
- $this->checkDatabase();
- $this->silent=0;
- $this->updateWizard();
- break;
- case 'config':
- $this->silent=0;
- $this->checkIM=1;
- $this->message(
- 'About configuration',
- 'How to configure TYPO3',
- $this->generallyAboutConfiguration()
- );
- $isPhpCgi = (PHP_SAPI == 'fpm-fcgi' || PHP_SAPI == 'cgi' || PHP_SAPI == 'isapi' || PHP_SAPI == 'cgi-fcgi');
- $this->message(
- 'System Information',
- 'Your system has the following configuration',
- '
- <dl id="systemInformation">
- <dt>OS detected:</dt>
- <dd>' . (TYPO3_OS == 'WIN' ? 'WIN' : 'UNIX') .'</dd>
- <dt>CGI detected:</dt>
- <dd>' . ($isPhpCgi ? 'YES' : 'NO') . '</dd>
- <dt>PATH_thisScript:</dt>
- <dd>' . PATH_thisScript . '</dd>
- </dl>
- '
- );
- $this->checkTheConfig();
- $ext = 'Write config to localconf.php';
- if ($this->fatalError) {
- if (
- $this->config_array['no_database'] ||
- !$this->config_array['mysqlConnect']
- ) {
- $this->message($ext, 'Database not configured yet!', '
- <p>
- You need to specify database username,
- password and host as one of the first things.
- <br />
- Next you\'ll have to select a database to
- use with TYPO3.
- </p>
- <p>
- Use the form below.
- </p>
- ', 2);
- } else {
- $this->message($ext, 'Fatal error encountered!', '
- <p>
- Somewhere above a fatal configuration
- problem is encountered.
- Please make sure that you\'ve fixed this
- error before you submit the configuration.
- TYPO3 will not run if this problem is not
- fixed!
- <br />
- You should also check all warnings that may
- appear.
- </p>
- ', 2);
- }
- } elseif ($this->mode=='123') {
- if (!$this->fatalError) {
- $this->message($ext, 'Basic configuration completed', '
- <p>
- You have no fatal errors in your basic
- configuration.
- You may have warnings though. Please pay
- attention to them!
- However you may continue and install the
- database.
- </p>
- <p>
- <strong>
- <span style="color:#f00;">Step 2: </span>
- </strong>
- <a href="' . $this->scriptSelf .
- '?TYPO3_INSTALL[type]=database' .
- ($this->mode ? '&mode=' . rawurlencode($this->mode) : '') .
- '">Click here to install the database.</a>
- </p>
- ', -1, 1);
- }
- }
- $this->message($ext, 'Very Important: Changing Image Processing settings', '
- <p>
- When you change the settings for Image Processing
- you <em>must</em> take into account
- that <em>old images</em> may still be in typo3temp/
- folder and prevent new files from being generated!
- <br />
- This is especially important to know, if you\'re
- trying to set up image processing for the very first
- time.
- <br />
- The problem is solved by <a href="' .
- htmlspecialchars($this->setScriptName('cleanup')) .
- '">clearing the typo3temp/ folder</a>.
- Also make sure to clear the cache_pages table.
- </p>
- ', 1, 1);
- $this->message($ext, 'Very Important: Changing Encryption Key setting', '
- <p>
- When you change the setting for the Encryption Key
- you <em>must</em> take into account that a change to
- this value might invalidate temporary information,
- URLs etc.
- <br />
- The problem is solved by <a href="' .
- htmlspecialchars($this->setScriptName('cleanup')) .
- '">clearing the typo3temp/ folder</a>.
- Also make sure to clear the cache_pages table.
- </p>
- ', 1, 1);
- $this->message($ext, 'Update localconf.php', '
- <p>
- This form updates the localconf.php file with the
- suggested values you see below. The values are based
- on the analysis above.
- <br />
- You can change the values in case you have
- alternatives to the suggested defaults.
- <br />
- By this final step you will configure TYPO3 for
- immediate use provided that you have no fatal errors
- left above.
- </p>' . $this->setupGeneral('get_form') . '
- ', 0, 1);
- $this->output($this->outputWrapper($this->printAll()));
- break;
- case 'extConfig':
- $this->silent=0;
- $this->generateConfigForm('get_form');
- // Get the template file
- $templateFile = @file_get_contents(
- PATH_site . $this->templateFilePath . 'InitExtConfig.html'
- );
- // Get the template part from the file
- $template = t3lib_parsehtml::getSubpart(
- $templateFile, '###TEMPLATE###'
- );
- // Define the markers content
- $markers = array(
- 'action' => $this->action,
- 'content' => $this->printAll(),
- 'write' => 'Write to localconf.php',
- 'notice' => 'NOTICE:',
- 'explanation' => '
- By clicking this button, localconf.php is updated
- with new values for the parameters listed above!
- '
- );
- // Fill the markers in the template
- $content = t3lib_parsehtml::substituteMarkerArray(
- $template,
- $markers,
- '###|###',
- TRUE,
- FALSE
- );
- // Send content to the page wrapper function
- $this->output($this->outputWrapper($content));
- break;
- case 'cleanup':
- $this->checkTheConfig();
- $this->silent=0;
- $this->cleanupManager();
- break;
- case 'phpinfo':
- $this->silent=0;
- $this->phpinformation();
- break;
- case 'typo3conf_edit':
- $this->silent=0;
- $this->typo3conf_edit();
- break;
- case 'logout':
- $enableInstallToolFile = PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL';
- if (is_file($enableInstallToolFile) && trim(file_get_contents($enableInstallToolFile)) !== 'KEEP_FILE') {
- unlink(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
- }
- $this->formProtection->clean();
- $this->session->destroySession();
- t3lib_utility_Http::redirect($this->scriptSelf);
- break;
- case 'about':
- default:
- $this->silent=0;
- $this->message('About', 'Warning - very important!', $this->securityRisk().$this->alterPasswordForm(), 2);
- $this->message('About', 'Using this script', '
- <p>
- Installing TYPO3 has always been a hot topic on the
- mailing list and forums. Therefore we\'ve developed
- this tool which will help you through configuration
- and testing.
- <br />
- There are three primary steps for you to take:
- </p>
- <p>
- <strong>1: Basic Configuration</strong>
- <br />
- In this step your PHP-configuration is checked. If
- there are any settings that will prevent TYPO3 from
- running correctly you\'ll get warnings and errors
- with a description of the problem.
- <br />
- You\'ll have to enter a database username, password
- and hostname. Then you can choose to create a new
- database or select an existing one.
- <br />
- Finally the image processing settings are entered
- and verified and you can choose to let the script
- update the configuration file,
- typo3conf/localconf.php with the suggested settings.
- </p>
- <p>
- <strong>2: Database Analyser</strong>
- <br />
- In this step you can either install a new database
- or update the database from any previous TYPO3
- version.
- <br />
- You can also get an overview of extra/missing
- fields/tables in the database compared to a raw
- sql-file.
- <br />
- The database is also verified against your
- \'tables.php\' configuration ($TCA) and you can
- even see suggestions to entries in $TCA or new
- fields in the database.
- </p>
- <p>
- <strong>3: Upgrade Wizard</strong>
- <br />
- Here you will find update methods taking care of
- changes to the TYPO3 core which are not backwards
- compatible.
- <br />
- It is recommended to run this wizard after every
- update to make sure everything will still work
- flawlessly.
- </p>
- <p>
- <strong>4: Image Processing</strong>
- <br />
- This step is a visual guide to verify your
- configuration of the image processing software.
- <br />
- You\'ll be presented to a list of images that should
- all match in pairs. If some irregularity appears,
- you\'ll get a warning. Thus you\'re able to track an
- error before you\'ll discover it on your website.
- </p>
- <p>
- <strong>5: All Configuration</strong>
- <br />
- This gives you access to any of the configuration
- options in the TYPO3_CONF_VARS array. Every option
- is also presented with a comment explaining what it
- does.
- </p>
- <p>
- <strong>6: Cleanup</strong>
- <br />
- Here you can clean up the temporary files in typo3temp/
- folder and the tables used for caching of data in
- your database.
- </p>
- ');
- $this->message('About', 'Why is this script stand-alone?', '
- <p>
- You would think that this script should rather be a
- module in the backend and access-controlled to only
- admin-users from the database. But that\'s not how
- it works.
- <br />
- The reason is, that this script must not be
- depending on the success of the configuration of
- TYPO3 and whether or not there is a working database
- behind. Therefore the script is invoked from the
- backend init.php file, which allows access if the
- constant \'TYPO3_enterInstallScript\' has been
- defined and is not FALSE. That is and should be the
- case <em>only</em> when calling the script
- \'typo3/install/index.php\' - this script!
- </p>
- ');
- $headCode='Header legend';
- $this->message($headCode, 'Notice!', '
- <p>
- Indicates that something is important to be aware
- of.
- <br />
- This does <em>not</em> indicate an error.
- </p>
- ', 1);
- $this->message($headCode, 'Just information', '
- <p>
- This is a simple message with some information about
- something.
- </p>
- ');
- $this->message($headCode, 'Check was successful', '
- <p>
- Indicates that something was checked and returned an
- expected result.
- </p>
- ', -1);
- $this->message($headCode, 'Warning!', '
- <p>
- Indicates that something may very well cause trouble
- and you should definitely look into it before
- proceeding.
- <br />
- This indicates a <em>potential</em> error.
- </p>
- ', 2);
- $this->message($headCode, 'Error!', '
- <p>
- Indicates that something is definitely wrong and
- that TYPO3 will most likely not perform as expected
- if this problem is not solved.
- <br />
- This indicates an actual error.
- </p>
- ', 3);
- $this->output($this->outputWrapper($this->printAll()));
- break;
- }
- }
- }
- /**
- * Controls the step 1-2-3-go process
- *
- * @return string The content to output to the screen
- */
- function stepOutput() {
- // Get the template file
- $templateFile = @file_get_contents(
- PATH_site . $this->templateFilePath . 'StepOutput.html'
- );
- // Get the template part from the file
- $template = t3lib_parsehtml::getSubpart(
- $templateFile, '###TEMPLATE###'
- );
- // Define the markers content
- $markers = array(
- 'stepHeader' => $this->stepHeader(),
- 'notice' => 'Skip this wizard (for power users only)',
- 'skip123' => $this->scriptSelf
- );
- $this->checkTheConfig();
- $error_missingConnect = '
- <p class="typo3-message message-error">
- <strong>
- There is no connection to the database!
- </strong>
- <br />
- (Username: <em>' . htmlspecialchars(TYPO3_db_username) . '</em>,
- Host: <em>' . htmlspecialchars(TYPO3_db_host) . '</em>,
- Using Password: YES)
- <br />
- Go to Step 1 and enter a valid username and password!
- </p>
- ';
- $error_missingDB = '
- <p class="typo3-message message-error">
- <strong>
- There is no access to the database (<em>' . htmlspecialchars(TYPO3_db) . '</em>)!
- </strong>
- <br />
- Go to Step 2 and select a valid database!
- </p>
- ';
- // only get the number of tables if it is not the first two steps in the 123-installer
- // (= no DB connection yet)
- $whichTables = ($this->step != 1 && $this->step != 2 ? $this->sqlHandler->getListOfTables() : array());
- $error_emptyDB = '
- <p class="typo3-message message-error">
- <strong>
- The database is still empty. There are no tables!
- </strong>
- <br />
- Go to Step 3 and import a database!
- </p>
- ';
- // Hook to override and add steps to the 1-2-3 installer
- if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['stepOutput'])) {
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['stepOutput'] as $classData) {
- $hookObject = t3lib_div::getUserObj($classData);
- $hookObject->executeStepOutput($markers, $this->step, $this);
- }
- }
- // Use the default steps when there is no override
- if (!$markers['header'] && !$markers['step']) {
- switch(strtolower($this->step)) {
- case 1:
- // Get the subpart for the first step
- $step1SubPart = t3lib_parsehtml::getSubpart(
- $templateFile, '###STEP1###'
- );
- // Add header marker for main template
- $markers['header'] = 'Welcome to the TYPO3 Install Tool';
- // Define the markers content for the subpart
- $step1SubPartMarkers = array(
- 'llIntroduction' => '
- <p>
- TYPO3 is an enterprise content management system
- that is powerful, yet easy to install.
- </p>
- <p>
- In three simple steps you\'ll be ready to add content to your website.
- </p>
- ',
- 'step' => $this->step + 1,
- 'action' => htmlspecialchars($this->action),
- 'continue' => 'Continue'
- );
- // Add step marker for main template
- $markers['step'] = t3lib_parsehtml::substituteMarkerArray(
- $step1SubPart,
- $step1SubPartMarkers,
- '###|###',
- TRUE,
- FALSE
- );
- break;
- case 2:
- // Get the subpart for the second step
- $step2SubPart = t3lib_parsehtml::getSubpart(
- $templateFile, '###STEP2###'
- );
- // Add header marker for main template
- $markers['header'] = 'Connect to your database host';
- // Define the markers content for the subpart
- $step2SubPartMarkers = array(
- 'step' => $this->step + 1,
- 'action' => htmlspecialchars($this->action),
- 'encryptionKey' => $this->createEncryptionKey(),
- 'branch' => TYPO3_branch,
- 'labelUsername' => 'Username',
- 'username' => htmlspecialchars(TYPO3_db_username),
- 'labelPassword' => 'Password',
- 'password' => htmlspecialchars(TYPO3_db_password),
- 'labelHost' => 'Host',
- 'host' => TYPO3_db_host ? htmlspecialchars(TYPO3_db_host) : 'localhost',
- 'continue' => 'Continue',
- 'llDescription' => 'If you have not already created a username and password to access the database, please do so now. This can be done using tools provided by your host.'
- );
- // Add step marker for main template
- $markers['step'] = t3lib_parsehtml::substituteMarkerArray(
- $step2SubPart,
- $step2SubPartMarkers,
- '###|###',
- TRUE,
- FALSE
- );
- break;
- case 3:
- // 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 subpart for the third step
- $step3SubPart = t3lib_parsehtml::getSubpart(
- $templateFile, '###STEP3###'
- );
- // Get the subpart for the database options
- $step3DatabaseOptionsSubPart = t3lib_parsehtml::getSubpart(
- $step3SubPart, '###DATABASEOPTIONS###'
- );
- $dbArr = $this->getDatabaseList();
- $dbIncluded = 0;
- $step3DatabaseOptions = array();
- 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,
- '###|###',
- TRUE,
- TRUE
- );
- if ($dbname==TYPO3_db) $dbIncluded=1;
- }
- 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,
- '###|###',
- TRUE,
- TRUE
- );
- }
- $usePatternList = FALSE;
- $createDatabaseAllowed = $this->checkCreateDatabasePrivileges();
- if ($createDatabaseAllowed === TRUE) {
- $formFieldAttributesNew = 'checked="checked"';
- $llRemark1 = 'Enter a name for your TYPO3 database.';
- } elseif (is_array($createDatabaseAllowed)) {
- $llRemark1 = 'Enter a name for your TYPO3 database.';
- $llDbPatternRemark = 'The name has to match one of these names/patterns (% is a wild card):';
- $llDbPatternList = '<li>' . implode('</li><li>', $createDatabaseAllowed) . '</li>';
- $usePatternList = TRUE;
- } else {
- $formFieldAttributesNew = 'disabled="disabled"';
- $formFieldAttributesSelect = 'checked="checked"';
- $llRemark1 = 'You have no permissions to create new databases.';
- }
- // Substitute the subpart for the database options
- $content = t3lib_parsehtml::substituteSubpart(
- $step3SubPart,
- '###DATABASEOPTIONS###',
- implode(LF, $step3DatabaseOptions)
- );
- if ($usePatternList === FALSE) {
- $content = t3lib_parsehtml::substituteSubpart(
- $content,
- '###DATABASE_NAME_PATTERNS###',
- ''
- );
- }
- // Define the markers content
- $step3SubPartMarkers = array(
- 'step' => $this->step + 1,
- 'llOptions' => 'You have two options:',
- 'action' => htmlspecialchars($this->action),
- 'llOption1' => 'Create a new database (recommended):',
- 'llRemark1' => $llRemark1,
- 'll_Db_Pattern_Remark' => $llDbPatternRemark,
- 'll_Db_Pattern_List' => $llDbPatternList,
- 'formFieldAttributesNew' => $formFieldAttributesNew,
- 'formFieldAttributesSelect' => $formFieldAttributesSelect,
- '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,
- '###|###',
- TRUE,
- TRUE
- );
- } else {
- // Add step marker for main template when no connection
- $markers['step'] = $error_missingConnect;
- }
- break;
- case 4:
- // Add header marker for main template
- $markers['header'] = 'Import the Database Tables';
- // 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
- )) {
- // The selected database should be accessible
- if ($GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) {
- // Get the subpart for the fourth step
- $step4SubPart = t3lib_parsehtml::getSubpart(
- $templateFile, '###STEP4###'
- );
- // Get the subpart for the database type options
- $step4DatabaseTypeOptionsSubPart = t3lib_parsehtml::getSubpart(
- $step4SubPart, '###DATABASETYPEOPTIONS###'
- );
- $sFiles = t3lib_div::getFilesInDir(PATH_typo3conf, 'sql', 1, 1);
- // Check if default database scheme "database.sql" already exists, otherwise create it
- if (!strstr(implode(',', $sFiles).',', '/database.sql,')) {
- array_unshift($sFiles, 'Default TYPO3 Tables');
- }
- $step4DatabaseTypeOptions = array();
- foreach ($sFiles as $f) {
- if ($f=='Default TYPO3 Tables') $key='CURRENT_TABLES+STATIC';
- else $key=htmlspecialchars($f);
- // Define the markers content for database type subpart
- $step4DatabaseTypeOptionMarkers = array(
- 'databaseTypeValue' => 'import|' . $key,
- 'databaseName' => htmlspecialchars(basename($f))
- );
- // Add the option HTML to an array
- $step4DatabaseTypeOptions[] = t3lib_parsehtml::substituteMarkerArray(
- $step4DatabaseTypeOptionsSubPart,
- $step4DatabaseTypeOptionMarkers,
- '###|###',
- TRUE,
- FALSE
- );
- }
- // Substitute the subpart for the database type options
- $content = t3lib_parsehtml::substituteSubpart(
- $step4SubPart,
- '###DATABASETYPEOPTIONS###',
- implode(LF, $step4DatabaseTypeOptions)
- );
- // Define the markers content
- $step4SubPartMarkers = array(
- 'llSummary' => 'Database summary:',
- 'llUsername' => 'Username:',
- 'username' => htmlspecialchars(TYPO3_db_username),
- 'llHost' => 'Host:',
- 'host' => htmlspecialchars(TYPO3_db_host),
- 'llDatabase' => 'Database:',
- 'database' => htmlspecialchars(TYPO3_db),
- 'llNumberTables' => 'Number of tables:',
- 'numberTables' => count($whichTables),
- 'action' => htmlspecialchars($this->action),
- 'llDatabaseType' => 'Select database contents:',
- 'label' => 'Import database'
- );
- // Add step marker for main template
- $markers['step'] = t3lib_parsehtml::substituteMarkerArray(
- $content,
- $step4SubPartMarkers,
- '###|###',
- TRUE,
- TRUE
- );
- } else {
- // Add step marker for main template when no database
- $markers['step'] = $error_missingDB;
- }
- } else {
- // Add step marker for main template when no connection
- $markers['step'] = $error_missingConnect;
- }
- break;
- case 'go':
- // Add header marker for main template
- $markers['header'] = 'Congratulations!';
- // 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
- )) {
- // The selected database should be accessible
- if ($GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) {
- // The database should contain tables
- if (count($whichTables)) {
- // Get the subpart for the go step
- $stepGoSubPart = t3lib_parsehtml::getSubpart(
- $templateFile, '###STEPGO###'
- );
- // Define the markers content
- $stepGoSubPartMarkers = array(
- 'messageBasicFinished' => $this->messageBasicFinished(),
- 'llImportant' => 'Important Security Warning',
- 'securityRisk' => $this->securityRisk(),
- 'llSwitchMode' => '
- <a href="' . $this->scriptSelf . '">
- Change the Install Tool password here
- </a>
- '
- );
- // Add step marker for main template
- $markers['step'] = t3lib_parsehtml::substituteMarkerArray(
- $stepGoSubPart,
- $stepGoSubPartMarkers,
- '###|###',
- TRUE,
- TRUE
- );
- } else {
- // Add step marker for main template when empty database
- $markers['step'] = $error_emptyDB;
- }
- } else {
- // Add step marker for main template when no database
- $markers['step'] = $error_missingDB;
- }
- } else {
- // Add step marker for main template when no connection
- $markers['step'] = $error_missingConnect;
- }
- break;
- }
- }
- // Fill the markers in the template
- $content = t3lib_parsehtml::substituteMarkerArray(
- $template,
- $markers,
- '###|###',
- TRUE,
- FALSE
- );
- return $content;
- }
- /**
- * Calling the functions that checks the system
- *
- * @return void
- */
- function checkTheConfig() {
- // Order important:
- $this->checkDirs();
- $this->checkConfiguration();
- $this->checkExtensions();
- if (TYPO3_OS=='WIN') {
- $paths=array($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'], $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'], 'c:\\php\\imagemagick\\', 'c:\\php\\GraphicsMagick\\', 'c:\\apache\\ImageMagick\\', 'c:\\apache\\GraphicsMagick\\');
- if (!isset($_SERVER['PATH'])) {
- $serverPath = array_change_key_case($_SERVER, CASE_UPPER);
- $paths = array_merge($paths, explode(';', $serverPath['PATH']));
- } else {
- $paths = array_merge($paths, explode(';', $_SERVER['PATH']));
- }
- } else {
- $paths=array($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'], $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'], '/usr/local/bin/', '/usr/bin/', '/usr/X11R6/bin/', '/opt/local/bin/');
- $paths = array_merge($paths, explode(':', $_SERVER['PATH']));
- }
- $paths = array_unique($paths);
- asort($paths);
- if (t3lib_utility_PhpOptions::isSafeModeEnabled()) {
- $paths=array(ini_get('safe_mode_exec_dir'), '/usr/local/php/bin/');
- }
- if ($this->INSTALL['checkIM']['lzw']) {
- $this->checkIMlzw=1;
- }
- if ($this->INSTALL['checkIM']['path']) {
- $paths[]=trim($this->INSTALL['checkIM']['path']);
- }
- if ($this->checkIM) $this->checkImageMagick($paths);
- $this->checkDatabase();
- }
- /**
- * Editing files in typo3conf directory (or elsewhere if enabled)
- *
- * @return void
- */
- function typo3conf_edit() {
- // default:
- $EDIT_path = PATH_typo3conf;
- if ($this->allowFileEditOutsite_typo3conf_dir && $this->INSTALL['FILE']['EDIT_path']) {
- if (t3lib_div::validPathStr($this->INSTALL['FILE']['EDIT_path']) && substr($this->INSTALL['FILE']['EDIT_path'], -1)=='/') {
- $tmp_path = PATH_site.$this->INSTALL['FILE']['EDIT_path'];
- if (is_dir($tmp_path)) {
- $EDIT_path=$tmp_path;
- } else {
- $this->errorMessages[] = '
- \'' . $tmp_path . '\' was not directory
- ';
- }
- } else {
- $this->errorMessages[] = '
- Bad directory name (must be like t3lib/ or media/script/)
- ';
- }
- }
- $headCode = 'Edit files in '.basename($EDIT_path).'/';
- $messages = '';
- if ($this->INSTALL['SAVE_FILE']) {
- $save_to_file = $this->INSTALL['FILE']['name'];
- if (@is_file($save_to_file)) {
- $save_to_file_md5 = md5($save_to_file);
- if (isset($this->INSTALL['FILE'][$save_to_file_md5]) && t3lib_div::isFirstPartOfStr($save_to_file, $EDIT_path.'') && substr($save_to_file, -1)!='~' && !strstr($save_to_file, '_bak')) {
- $this->INSTALL['typo3conf_files'] = $save_to_file;
- $save_fileContent = $this->INSTALL['FILE'][$save_to_file_md5];
- if ($this->INSTALL['FILE']['win_to_unix_br']) {
- $save_fileContent = str_replace(CRLF, LF, $save_fileContent);
- }
- $backupFile = $this->getBackupFilename($save_to_file);
- if ($this->INSTALL['FILE']['backup']) {
- if (@is_file($backupFile)) { unlink($backupFile); }
- rename($save_to_file, $backupFile);
- $messages .= '
- Backup written to <strong>' . $backupFile . '</strong>
- <br />
- ';
- }
- t3lib_div::writeFile($save_to_file, $save_fileContent);
- $messages .= '
- File saved: <strong>' . $save_to_file . '</strong>
- <br />
- MD5-sum: ' . $this->INSTALL['FILE']['prevMD5'] . ' (prev)
- <br />
- MD5-sum: ' . md5($save_fileContent) . ' (new)
- <br />
- ';
- }
- }
- }
- // Filelist:
- // Get the template file
- $templateFile = @file_get_contents(PATH_site . $this->templateFilePath . 'Typo3ConfEdit.html');
- // Get the template part from the file
- $template = t3lib_parsehtml::getSubpart($templateFile, '###TEMPLATE###');
- // Get the subpart for the files
- $filesSubpart = t3lib_parsehtml::getSubpart($template, '###FILES###');
- $files = array();
- $typo3conf_files = t3lib_div::getFilesInDir($EDIT_path, '', 1, 1);
- $fileFound = 0;
- foreach ($typo3conf_files as $k => $file) {
- // Delete temp_CACHED files if option is set
- if ( $this->INSTALL['delTempCached'] && preg_match('|/temp_CACHED_[a-z0-9_]+\.php|', $file)) {
- unlink($file);
- continue;
- }
- if ($this->INSTALL['typo3conf_files'] && !strcmp($this->INSTALL['typo3conf_files'], $file)) {
- $fileFound = 1;
- }
- // Define the markers content for the files subpart
- $filesMarkers = array(
- 'editUrl' => $this->action . '&TYPO3_INSTALL[typo3conf_files]=' . rawurlencode($file) . ($this->allowFileEditOutsite_typo3conf_dir ? '&TYPO3_INSTALL[FILE][EDIT_path]=' . rawurlencode($this->INSTALL['FILE']['EDIT_path']) : '') . '#confEditFileList',
- 'fileName' => basename($file),
- 'fileSize' => t3lib_div::formatSize(filesize($file)),
- 'class' => $this->INSTALL['typo3conf_files'] && !strcmp($this->INSTALL['typo3conf_files'], $file) ? 'class="act"' : ''
- );
- // Fill the markers in the subpart
- $files[] = t3lib_parsehtml::substituteMarkerArray(
- $filesSubpart,
- $filesMarkers,
- '###|###',
- TRUE,
- FALSE
- );
- }
- if ($fileFound && @is_file($this->INSTALL['typo3conf_files'])) {
- $backupFile = $this->getBackupFilename($this->INSTALL['typo3conf_files']);
- $fileContent = t3lib_div::getUrl($this->INSTALL['typo3conf_files']);
- // Get the subpart to edit the files
- $fileEditTemplate = t3lib_parsehtml::getSubpart($template, '###FILEEDIT###');
- $allowFileEditOutsideTypo3ConfDirSubPart = '';
- if (substr($this->INSTALL['typo3conf_files'], -1) != '~' && !strstr($this->INSTALL['typo3conf_files'], '_bak')) {
- // Get the subpart to show the save button
- $showSaveButtonSubPart = t3lib_parsehtml::getSubpart($fileEditTemplate, '###SHOWSAVEBUTTON###');
- }
- if ($this->allowFileEditOutsite_typo3conf_dir) {
- // Get the subpart to show if files are allowed outside the directory typo3conf
- $allowFileEditOutsideTypo3ConfDirSubPart = t3lib_parsehtml::getSubpart($fileEditTemplate, '###ALLOWFILEEDITOUTSIDETYPO3CONFDIR###');
- }
- // Substitute the subpart for the save button
- $fileEditContent = t3lib_parsehtml::substituteSubpart(
- $fileEditTemplate,
- '###SHOWSAVEBUTTON###',
- $showSaveButtonSubPart
- );
- // Substitute the subpart to show if files are allowed outside the directory typo3conf
- $fileEditContent = t3lib_parsehtml::substituteSubpart(
- $fileEditContent,
- '###ALLOWFILEEDITOUTSIDETYPO3CONFDIR###',
- $allowFileEditOutsideTypo3ConfDirSubPart
- );
- // Define the markers content for subpart to edit the files
- $fileEditMarkers = array(
- 'messages' => !empty($messages) ? '<p class="typo3-message message-warning">' . $messages . '</p>' : '',
- 'action' => $this->action . '#fileEditHeader',
- 'saveFile' => 'Save file',
- 'close' => 'Close',
- 'llEditing' => 'Editing file:',
- 'file' => $this->INSTALL['typo3conf_files'],
- 'md5Sum' => 'MD5-sum: ' . md5($fileContent),
- 'fileName' => $this->INSTALL['typo3conf_files'],
- 'fileEditPath' => $this->INSTALL['FILE']['EDIT_path'],
- 'filePreviousMd5' => md5($fileContent),
- 'fileMd5' => md5($this->INSTALL['typo3conf_files']),
- 'fileContent' => t3lib_div::formatForTextarea($fileContent),
- 'winToUnixBrChecked' => TYPO3_OS == 'WIN' ? '' : 'checked="checked"',
- 'winToUnixBr' => 'Convert Windows linebreaks (13-10) to Unix (10)',
- 'backupChecked' => @is_file($backupFile) ? 'checked="checked"' : '',
- 'backup' => 'Make backup copy (rename to ' . basename($backupFile) . ')'
- );
- // Fill the markers in the subpart to edit the files
- $fileEditContent = t3lib_parsehtml::substituteMarkerArray(
- $fileEditContent,
- $fileEditMarkers,
- '###|###',
- TRUE,
- FALSE
- );
- }
- if ($this->allowFileEditOutsite_typo3conf_dir) {
- // Get the subpart to show if files are allowed outside the directory typo3conf
- $allowFileEditOutsideTypo3ConfDirSubPart = t3lib_parsehtml::getSubpart($template, '###ALLOWFILEEDITOUTSIDETYPO3CONFDIR###');
- // Define the markers content
- $allowFileEditOutsideTypo3ConfDirMarkers = array(
- 'action' => $this->acti…
Large files files are truncated, but you can click here to view the full file