Index: typo3/sysext/dbal/class.tx_dbal_installtool.php =================================================================== --- typo3/sysext/dbal/class.tx_dbal_installtool.php (revision 8872) +++ typo3/sysext/dbal/class.tx_dbal_installtool.php (working copy) @@ -72,6 +72,25 @@ } /** + * 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 Index: typo3/sysext/dbal/ext_localconf.php =================================================================== --- typo3/sysext/dbal/ext_localconf.php (revision 8872) +++ typo3/sysext/dbal/ext_localconf.php (working copy) @@ -10,4 +10,5 @@ // 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'; -?> \ No newline at end of file +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules'][] = 'EXT:dbal/class.tx_dbal_installtool.php:tx_dbal_installtool'; +?> Index: typo3/sysext/install/mod/class.tx_install.php =================================================================== --- typo3/sysext/install/mod/class.tx_install.php (revision 8872) +++ typo3/sysext/install/mod/class.tx_install.php (working copy) @@ -231,6 +231,19 @@ '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' + ); @@ -254,6 +267,12 @@ 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. // **************************** @@ -261,6 +280,18 @@ $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: ' . + implode(', ', $missingPhpModules) . + '

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'; @@ -340,12 +371,6 @@ @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); } @@ -4115,16 +4140,44 @@ 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.