Project

General

Profile

Bug #23147 » 15075_v7.diff

Administrator Admin, 2010-09-24 18:39

View differences:

typo3/sysext/dbal/class.tx_dbal_installtool.php (working copy)
}
/**
* Hooks into Installer to set required PHP modules.
*
* @param array $modules
* @param tx_install $instObj
* @return array modules
*/
public function setRequiredPhpModules(array &$modules, tx_install $instObj) {
$supportedDrivers = array('mysql','mysqli','mssql', 'pgsql', 'oci8');
foreach ($modules as $key => $module) {
if ($module == 'mysql') {
$module = $supportedDrivers;
}
$modifiedModules[] = $module;
}
return $modifiedModules;
}
/**
* Hooks into Installer to let a non-MySQL database to be configured.
*
* @param array $markers
typo3/sysext/dbal/ext_localconf.php (working copy)
// Register a hook for the installer
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['stepOutput'][] = 'EXT:dbal/class.tx_dbal_installtool.php:tx_dbal_installtool';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['writeLocalconf'][] = 'EXT:dbal/class.tx_dbal_installtool.php:tx_dbal_installtool';
?>
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules'][] = 'EXT:dbal/class.tx_dbal_installtool.php:tx_dbal_installtool';
?>
typo3/sysext/install/mod/class.tx_install.php (working copy)
'logout' => 'Logout from Install Tool',
);
// PHP modules which are required. Can be changed by hook in getMissingPhpModules()
protected $requiredPhpModules = array(
'filter',
'gd',
'json',
'mysql',
'pcre',
'session',
'SPL',
'standard',
'xml',
'zlib'
);
......
header('Pragma: no-cache');
}
// Let DBAL decide whether to load itself
$dbalLoaderFile = $this->backPath . 'sysext/dbal/class.tx_dbal_autoloader.php';
if (@is_file($dbalLoaderFile)) {
include($dbalLoaderFile);
}
// ****************************
// Initializing incoming vars.
// ****************************
......
$this->mode = t3lib_div::_GP('mode');
if ($this->mode !== '123') {
$this->mode = '';
} else {
// Check for mandatory PHP modules
$missingPhpModules = $this->getMissingPhpModules();
if (count($missingPhpModules) > 0) {
t3lib_BEfunc::typo3PrintError(
'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.'
);
die();
}
}
if (t3lib_div::_GP('step') === 'go') {
$this->step = 'go';
......
@touch($enableInstallToolFile);
}
// 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->redirect_url) {
t3lib_utility_Http::redirect($this->redirect_url);
}
......
return (is_array($test) ? 1 : 0);
}
/**
* Checks if the essential PHP modules are loaded
*
* @return array list of modules which are missing
*/
protected function getMissingPhpModules() {
// Hook to adjust the required PHP modules in the 1-2-3 installer
$modules = $this->requiredPhpModules;
if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules'] as $classData) {
$hookObject = t3lib_div::getUserObj($classData);
$modules = $hookObject->setRequiredPhpModules($modules, $this);
}
}
$this->requiredPhpModules = $modules;
$result = array();
foreach ($this->requiredPhpModules as $module) {
if (is_array($module)) {
$detectedSubmodules = FALSE;
foreach ($module as $submodule) {
if (extension_loaded($submodule)) {
$detectedSubmodules = TRUE;
}
}
if ($detectedSubmodules === FALSE) {
$result[] = 'one of: (' . implode(', ', $module) . ')';
}
} else {
if (!extension_loaded($module)) {
$result[] = $module;
}
}
}
return $result;
}
/*****************************************
*
* ABOUT the isXXX functions.
(2-2/2)