[TASK] Remove ext:dbal from installation steps 78/49578/7
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 24 Aug 2016 17:46:46 +0000 (19:46 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 30 Aug 2016 21:01:11 +0000 (23:01 +0200)
We don't want to still have fresh installations that
enable ext:dbal. The patch removes the ext:dbal specific
handling from the install tool steps.
With an active loaded ext:dbal, the install tool still
works fine and runs through the steps, only new
installations can no longer choose "i do not use mysql".

Change-Id: I4b694d377df41b8ce3bd6360c7f81c9e4cd28843
Resolves: #77622
Releases: master
Reviewed-on: https://review.typo3.org/49578
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/ConnectDetails.html
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/DbalDriverSelection.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/LoadDbal.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/UnloadDbal.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseConnect.html

index a78b6b9..5b69dcb 100644 (file)
@@ -172,21 +172,6 @@ abstract class AbstractAction implements ActionInterface
     }
 
     /**
-     * Return TRUE if dbal and adodb extension is loaded
-     *
-     * @return bool TRUE if dbal and adodb is loaded
-     */
-    protected function isDbalEnabled()
-    {
-        if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('adodb')
-            && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')
-        ) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
      * Context determines if the install tool is called within backend or standalone
      *
      * @return string Either 'standalone' or 'backend'
index 90dabfd..5fabed1 100644 (file)
@@ -14,7 +14,8 @@ namespace TYPO3\CMS\Install\Controller\Action\Step;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use Doctrine\DBAL\DBALException;
+use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -22,13 +23,11 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  * - Needs execution if database credentials are not set or fail to connect
  * - Renders fields for database connection fields
  * - Sets database credentials in LocalConfiguration
- * - Loads / unloads ext:dbal and ext:adodb if requested
  */
 class DatabaseConnect extends AbstractStepAction
 {
     /**
      * Execute database step:
-     * - Load / unload dbal & adodb
      * - Set database connect credentials in LocalConfiguration
      *
      * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
@@ -41,149 +40,101 @@ class DatabaseConnect extends AbstractStepAction
         $configurationManager = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class);
 
         $postValues = $this->postValues['values'];
-        if (isset($postValues['loadDbal'])) {
-            $result[] = $this->executeLoadDbalExtension();
-        } elseif ($postValues['unloadDbal']) {
-            $result[] = $this->executeUnloadDbalExtension();
-        } elseif ($postValues['setDbalDriver']) {
-            $driver = $postValues['setDbalDriver'];
-            switch ($driver) {
-                case 'mssql':
-                case 'odbc_mssql':
-                    $driverConfig = [
-                        'useNameQuote' => true,
-                        'quoteClob' => false,
-                    ];
-                    break;
-                case 'oci8':
-                    $driverConfig = [
-                        'driverOptions' => [
-                            'connectSID' => '',
-                        ],
-                    ];
-                    break;
-            }
-            $config = [
-                '_DEFAULT' => [
-                    'type' => 'adodb',
-                    'config' => [
-                        'driver' => $driver,
-                    ]
-                ]
-            ];
-            if (isset($driverConfig)) {
-                $config['_DEFAULT']['config'] = array_merge($config['_DEFAULT']['config'], $driverConfig);
-            }
-            $configurationManager->setLocalConfigurationValueByPath('EXTCONF/dbal/handlerCfg', $config);
-        } else {
-            $localConfigurationPathValuePairs = [];
-
-            if ($this->isDbalEnabled()) {
-                $config = $configurationManager->getConfigurationValueByPath('EXTCONF/dbal/handlerCfg');
-                $driver = $config['_DEFAULT']['config']['driver'];
-                if ($driver === 'oci8') {
-                    $config['_DEFAULT']['config']['driverOptions']['connectSID'] = ($postValues['type'] === 'sid');
-                    $localConfigurationPathValuePairs['EXTCONF/dbal/handlerCfg'] = $config;
-                }
-            }
 
-            if (isset($postValues['username'])) {
-                $value = $postValues['username'];
-                if (strlen($value) <= 50) {
-                    $localConfigurationPathValuePairs['DB/Connections/Default/user'] = $value;
-                } else {
-                    /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
-                    $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-                    $errorStatus->setTitle('Database username not valid');
-                    $errorStatus->setMessage('Given username must be shorter than fifty characters.');
-                    $result[] = $errorStatus;
-                }
+        $localConfigurationPathValuePairs = [];
+
+        if (isset($postValues['username'])) {
+            $value = $postValues['username'];
+            if (strlen($value) <= 50) {
+                $localConfigurationPathValuePairs['DB/Connections/Default/user'] = $value;
+            } else {
+                /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $errorStatus->setTitle('Database username not valid');
+                $errorStatus->setMessage('Given username must be shorter than fifty characters.');
+                $result[] = $errorStatus;
             }
+        }
 
-            if (isset($postValues['password'])) {
-                $value = $postValues['password'];
-                if (strlen($value) <= 50) {
-                    $localConfigurationPathValuePairs['DB/Connections/Default/password'] = $value;
-                } else {
-                    /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
-                    $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-                    $errorStatus->setTitle('Database password not valid');
-                    $errorStatus->setMessage('Given password must be shorter than fifty characters.');
-                    $result[] = $errorStatus;
-                }
+        if (isset($postValues['password'])) {
+            $value = $postValues['password'];
+            if (strlen($value) <= 50) {
+                $localConfigurationPathValuePairs['DB/Connections/Default/password'] = $value;
+            } else {
+                /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $errorStatus->setTitle('Database password not valid');
+                $errorStatus->setMessage('Given password must be shorter than fifty characters.');
+                $result[] = $errorStatus;
             }
+        }
 
-            if (isset($postValues['host'])) {
-                $value = $postValues['host'];
-                if (preg_match('/^[a-zA-Z0-9_\\.-]+(:.+)?$/', $value) && strlen($value) <= 255) {
-                    $localConfigurationPathValuePairs['DB/Connections/Default/host'] = $value;
-                } else {
-                    /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
-                    $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-                    $errorStatus->setTitle('Database host not valid');
-                    $errorStatus->setMessage('Given host is not alphanumeric (a-z, A-Z, 0-9 or _-.:) or longer than 255 characters.');
-                    $result[] = $errorStatus;
-                }
+        if (isset($postValues['host'])) {
+            $value = $postValues['host'];
+            if (preg_match('/^[a-zA-Z0-9_\\.-]+(:.+)?$/', $value) && strlen($value) <= 255) {
+                $localConfigurationPathValuePairs['DB/Connections/Default/host'] = $value;
+            } else {
+                /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $errorStatus->setTitle('Database host not valid');
+                $errorStatus->setMessage('Given host is not alphanumeric (a-z, A-Z, 0-9 or _-.:) or longer than 255 characters.');
+                $result[] = $errorStatus;
             }
+        }
 
-            if (isset($postValues['port']) && $postValues['host'] !== 'localhost') {
-                $value = $postValues['port'];
-                if (preg_match('/^[0-9]+(:.+)?$/', $value) && $value > 0 && $value <= 65535) {
-                    $localConfigurationPathValuePairs['DB/Connections/Default/port'] = (int)$value;
-                } else {
-                    /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
-                    $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-                    $errorStatus->setTitle('Database port not valid');
-                    $errorStatus->setMessage('Given port is not numeric or within range 1 to 65535.');
-                    $result[] = $errorStatus;
-                }
+        if (isset($postValues['port']) && $postValues['host'] !== 'localhost') {
+            $value = $postValues['port'];
+            if (preg_match('/^[0-9]+(:.+)?$/', $value) && $value > 0 && $value <= 65535) {
+                $localConfigurationPathValuePairs['DB/Connections/Default/port'] = (int)$value;
+            } else {
+                /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $errorStatus->setTitle('Database port not valid');
+                $errorStatus->setMessage('Given port is not numeric or within range 1 to 65535.');
+                $result[] = $errorStatus;
             }
+        }
 
-            if (isset($postValues['socket']) && $postValues['socket'] !== '') {
-                if (@file_exists($postValues['socket'])) {
-                    $localConfigurationPathValuePairs['DB/Connections/Default/unix_socket'] = $postValues['socket'];
-                } else {
-                    /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
-                    $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-                    $errorStatus->setTitle('Socket does not exist');
-                    $errorStatus->setMessage('Given socket location does not exist on server.');
-                    $result[] = $errorStatus;
-                }
+        if (isset($postValues['socket']) && $postValues['socket'] !== '') {
+            if (@file_exists($postValues['socket'])) {
+                $localConfigurationPathValuePairs['DB/Connections/Default/unix_socket'] = $postValues['socket'];
+            } else {
+                /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $errorStatus->setTitle('Socket does not exist');
+                $errorStatus->setMessage('Given socket location does not exist on server.');
+                $result[] = $errorStatus;
             }
+        }
 
-            if (isset($postValues['database'])) {
-                $value = $postValues['database'];
-                if (strlen($value) <= 50) {
-                    $localConfigurationPathValuePairs['DB/Connections/Default/dbname'] = $value;
-                } else {
-                    /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
-                    $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-                    $errorStatus->setTitle('Database name not valid');
-                    $errorStatus->setMessage('Given database name must be shorter than fifty characters.');
-                    $result[] = $errorStatus;
-                }
+        if (isset($postValues['database'])) {
+            $value = $postValues['database'];
+            if (strlen($value) <= 50) {
+                $localConfigurationPathValuePairs['DB/Connections/Default/dbname'] = $value;
+            } else {
+                /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $errorStatus->setTitle('Database name not valid');
+                $errorStatus->setMessage('Given database name must be shorter than fifty characters.');
+                $result[] = $errorStatus;
             }
+        }
 
-            if (!empty($localConfigurationPathValuePairs)) {
-                $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
-
-                // After setting new credentials, test again and create an error message if connect is not successful
-                // @TODO: This could be simplified, if isConnectSuccessful could be released from TYPO3_CONF_VARS
-                // and fed with connect values directly in order to obsolete the bootstrap reload.
-                \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-                    ->populateLocalConfiguration()
-                    ->disableCoreCache();
-                if ($this->isDbalEnabled()) {
-                    require(ExtensionManagementUtility::extPath('dbal') . 'ext_localconf.php');
-                    GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
-                }
-                if (!$this->isConnectSuccessful()) {
-                    /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
-                    $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-                    $errorStatus->setTitle('Database connect not successful');
-                    $errorStatus->setMessage('Connecting to the database with given settings failed. Please check.');
-                    $result[] = $errorStatus;
-                }
+        if (!empty($localConfigurationPathValuePairs)) {
+            $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
+
+            // After setting new credentials, test again and create an error message if connect is not successful
+            // @TODO: This could be simplified, if isConnectSuccessful could be released from TYPO3_CONF_VARS
+            // and fed with connect values directly in order to obsolete the bootstrap reload.
+            \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
+                ->populateLocalConfiguration()
+                ->disableCoreCache();
+            if (!$this->isConnectSuccessful()) {
+                /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                $errorStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
+                $errorStatus->setTitle('Database connect not successful');
+                $errorStatus->setMessage('Connecting to the database with given settings failed. Please check.');
+                $result[] = $errorStatus;
             }
         }
 
@@ -201,7 +152,7 @@ class DatabaseConnect extends AbstractStepAction
         if ($this->isConnectSuccessful() && $this->isConfigurationComplete()) {
             return false;
         }
-        if (!$this->isHostConfigured() && !$this->isDbalEnabled()) {
+        if (!$this->isHostConfigured()) {
             $this->useDefaultValuesForNotConfiguredOptions();
             throw new \TYPO3\CMS\Install\Controller\Exception\RedirectException(
                 'Wrote default settings to LocalConfiguration.php, redirect needed',
@@ -218,28 +169,19 @@ class DatabaseConnect extends AbstractStepAction
      */
     protected function executeAction()
     {
-        $isDbalEnabled = $this->isDbalEnabled();
         $this->view
-            ->assign('isDbalEnabled', $isDbalEnabled)
             ->assign('username', $this->getConfiguredUsername())
             ->assign('password', $this->getConfiguredPassword())
             ->assign('host', $this->getConfiguredHost())
             ->assign('port', $this->getConfiguredOrDefaultPort())
             ->assign('database', $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'] ?: '')
-            ->assign('socket', $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['unix_socket'] ?: '');
+            ->assign('socket', $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['unix_socket'] ?: '')
+            ->assign('renderConnectDetailsUsername', true)
+            ->assign('renderConnectDetailsPassword', true)
+            ->assign('renderConnectDetailsHost', true)
+            ->assign('renderConnectDetailsPort', true)
+            ->assign('renderConnectDetailsSocket', true);
 
-        if ($isDbalEnabled) {
-            $this->view->assign('selectedDbalDriver', $this->getSelectedDbalDriver());
-            $this->view->assign('dbalDrivers', $this->getAvailableDbalDrivers());
-            $this->setDbalInputFieldsToRender();
-        } else {
-            $this->view
-                ->assign('renderConnectDetailsUsername', true)
-                ->assign('renderConnectDetailsPassword', true)
-                ->assign('renderConnectDetailsHost', true)
-                ->assign('renderConnectDetailsPort', true)
-                ->assign('renderConnectDetailsSocket', true);
-        }
         $this->assignSteps();
 
         return $this->view->render();
@@ -254,25 +196,7 @@ class DatabaseConnect extends AbstractStepAction
     {
         $configuredPort = (int)$this->getConfiguredPort();
         if (!$configuredPort) {
-            if ($this->isDbalEnabled()) {
-                $driver = $this->getSelectedDbalDriver();
-                switch ($driver) {
-                    case 'postgres':
-                        $port = 5432;
-                        break;
-                    case 'mssql':
-                    case 'odbc_mssql':
-                        $port = 1433;
-                        break;
-                    case 'oci8':
-                        $port = 1521;
-                        break;
-                    default:
-                        $port = 3306;
-                }
-            } else {
-                $port = 3306;
-            }
+            $port = 3306;
         } else {
             $port = $configuredPort;
         }
@@ -286,26 +210,12 @@ class DatabaseConnect extends AbstractStepAction
      */
     protected function isConnectSuccessful()
     {
-        /** @var $databaseConnection \TYPO3\CMS\Core\Database\DatabaseConnection */
-        $databaseConnection = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
-
-        if ($this->isDbalEnabled()) {
-            // Set additional connect information based on dbal driver. postgres for example needs
-            // database name already for connect.
-            if (isset($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'])) {
-                $databaseConnection->setDatabaseName($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname']);
-            }
+        try {
+            GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionByName('Default')->ping();
+        } catch (DBALException $e) {
+            return false;
         }
-
-        $databaseConnection->setDatabaseUsername($this->getConfiguredUsername());
-        $databaseConnection->setDatabasePassword($this->getConfiguredPassword());
-        $databaseConnection->setDatabaseHost($this->getConfiguredHost());
-        $databaseConnection->setDatabasePort($this->getConfiguredPort());
-        $databaseConnection->setDatabaseSocket($this->getConfiguredSocket());
-
-        $databaseConnection->initialize();
-
-        return (bool)@$databaseConnection->sql_pconnect();
+        return true;
     }
 
     /**
@@ -432,172 +342,6 @@ class DatabaseConnect extends AbstractStepAction
     }
 
     /**
-     * Render fields required for successful connect based on dbal driver selection.
-     * Hint: There is a code duplication in handle() and this method. This
-     * is done by intention to keep this code area easy to maintain and understand.
-     *
-     * @return void
-     */
-    protected function setDbalInputFieldsToRender()
-    {
-        $driver = $this->getSelectedDbalDriver();
-        switch ($driver) {
-            case 'mssql':
-            case 'odbc_mssql':
-            case 'postgres':
-                $this->view
-                    ->assign('renderConnectDetailsUsername', true)
-                    ->assign('renderConnectDetailsPassword', true)
-                    ->assign('renderConnectDetailsHost', true)
-                    ->assign('renderConnectDetailsPort', true)
-                    ->assign('renderConnectDetailsDatabase', true);
-                break;
-            case 'oci8':
-                $this->view
-                    ->assign('renderConnectDetailsUsername', true)
-                    ->assign('renderConnectDetailsPassword', true)
-                    ->assign('renderConnectDetailsHost', true)
-                    ->assign('renderConnectDetailsPort', true)
-                    ->assign('renderConnectDetailsDatabase', true)
-                    ->assign('renderConnectDetailsOracleSidConnect', true);
-                $type = isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driverOptions']['connectSID'])
-                    ? $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driverOptions']['connectSID']
-                    : '';
-                if ($type === true) {
-                    $this->view->assign('oracleSidSelected', true);
-                }
-                break;
-        }
-    }
-
-    /**
-     * Returns a list of database drivers that are available on current server.
-     *
-     * @return array
-     */
-    protected function getAvailableDbalDrivers()
-    {
-        $supportedDrivers = $this->getSupportedDbalDrivers();
-        $availableDrivers = [];
-        $selectedDbalDriver = $this->getSelectedDbalDriver();
-        foreach ($supportedDrivers as $abstractionLayer => $drivers) {
-            foreach ($drivers as $driver => $info) {
-                if (isset($info['combine']) && $info['combine'] === 'OR') {
-                    $isAvailable = false;
-                } else {
-                    $isAvailable = true;
-                }
-                // Loop through each PHP module dependency to ensure it is loaded
-                foreach ($info['extensions'] as $extension) {
-                    if (isset($info['combine']) && $info['combine'] === 'OR') {
-                        $isAvailable |= extension_loaded($extension);
-                    } else {
-                        $isAvailable &= extension_loaded($extension);
-                    }
-                }
-                if ($isAvailable) {
-                    if (!isset($availableDrivers[$abstractionLayer])) {
-                        $availableDrivers[$abstractionLayer] = [];
-                    }
-                    $availableDrivers[$abstractionLayer][$driver] = [];
-                    $availableDrivers[$abstractionLayer][$driver]['driver'] = $driver;
-                    $availableDrivers[$abstractionLayer][$driver]['label'] = $info['label'];
-                    $availableDrivers[$abstractionLayer][$driver]['selected'] = false;
-                    if ($selectedDbalDriver === $driver) {
-                        $availableDrivers[$abstractionLayer][$driver]['selected'] = true;
-                    }
-                }
-            }
-        }
-        return $availableDrivers;
-    }
-
-    /**
-     * Returns a list of DBAL supported database drivers, with a
-     * user-friendly name and any PHP module dependency.
-     *
-     * @return array
-     */
-    protected function getSupportedDbalDrivers()
-    {
-        $supportedDrivers = [
-            'Native' => [
-                'mssql' => [
-                    'label' => 'Microsoft SQL Server',
-                    'extensions' => ['mssql']
-                ],
-                'oci8' => [
-                    'label' => 'Oracle OCI8',
-                    'extensions' => ['oci8']
-                ],
-                'postgres' => [
-                    'label' => 'PostgreSQL',
-                    'extensions' => ['pgsql']
-                ]
-            ],
-            'ODBC' => [
-                'odbc_mssql' => [
-                    'label' => 'Microsoft SQL Server',
-                    'extensions' => ['odbc', 'mssql']
-                ]
-            ]
-        ];
-        return $supportedDrivers;
-    }
-
-    /**
-     * Get selected dbal driver if any
-     *
-     * @return string Dbal driver or empty string if not yet selected
-     */
-    protected function getSelectedDbalDriver()
-    {
-        if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driver'])) {
-            return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driver'];
-        }
-        return '';
-    }
-
-    /**
-     * Adds dbal and adodb to list of loaded extensions
-     *
-     * @return \TYPO3\CMS\Install\Status\StatusInterface
-     */
-    protected function executeLoadDbalExtension()
-    {
-        if (!ExtensionManagementUtility::isLoaded('adodb')) {
-            ExtensionManagementUtility::loadExtension('adodb');
-        }
-        if (!ExtensionManagementUtility::isLoaded('dbal')) {
-            ExtensionManagementUtility::loadExtension('dbal');
-        }
-        /** @var $errorStatus \TYPO3\CMS\Install\Status\WarningStatus */
-        $warningStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\WarningStatus::class);
-        $warningStatus->setTitle('Loaded database abstraction layer');
-        return $warningStatus;
-    }
-
-    /**
-     * Remove dbal and adodb from list of loaded extensions
-     *
-     * @return \TYPO3\CMS\Install\Status\StatusInterface
-     */
-    protected function executeUnloadDbalExtension()
-    {
-        if (ExtensionManagementUtility::isLoaded('adodb')) {
-            ExtensionManagementUtility::unloadExtension('adodb');
-        }
-        if (ExtensionManagementUtility::isLoaded('dbal')) {
-            ExtensionManagementUtility::unloadExtension('dbal');
-        }
-        // @TODO: Remove configuration from TYPO3_CONF_VARS['EXTCONF']['dbal']
-        /** @var $errorStatus \TYPO3\CMS\Install\Status\WarningStatus */
-        $warningStatus = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\WarningStatus::class);
-        $warningStatus->setTitle('Removed database abstraction layer');
-        return $warningStatus;
-    }
-
-    /**
      * Returns configured username, if set
      *
      * @return string
index d955e18..0696932 100644 (file)
@@ -103,7 +103,10 @@ class DatabaseData extends AbstractStepAction
      */
     public function needsExecution()
     {
-        $existingTables = $this->getDatabaseConnection()->admin_get_tables();
+        $existingTables = GeneralUtility::makeInstance(ConnectionPool::class)
+            ->getConnectionByName('Default')
+            ->getSchemaManager()
+            ->listTableNames();
         if (empty($existingTables)) {
             $result = true;
         } else {
index 25cf4a6..cb7adb3 100644 (file)
@@ -24,8 +24,7 @@ use TYPO3\CMS\Install\Status\OkStatus;
 
 /**
  * Database select step.
- * This step is only rendered if database is mysql. With dbal,
- * database name is submitted by previous step already.
+ * This step is only rendered if database is mysql.
  */
 class DatabaseSelect extends AbstractStepAction
 {
index 7cebcbd..0321f48 100644 (file)
                                        </div>
                                </div>
                        </f:if>
-                       <f:if condition="{renderConnectDetailsDatabase}">
-                               <div class="form-group">
-                                       <label for="t3-install-step-database" class="control-label col-md-2">Database</label>
-                                       <div class="col-md-10">
-                                               <input id="t3-install-step-database" class="t3-install-form-input-text form-control" type="text" value="{database}" name="install[values][database]" />
-                                       </div>
-                               </div>
-                       </f:if>
-                       <f:if condition="{renderConnectDetailsOracleSidConnect}">
-                               <div class="form-group">
-                                       <label for="t3-install-form-type" class="control-label col-md-2">Oracle Sid</label>
-                                       <div class="col-md-10"><select id="t3-install-form-type" name="install[values][type]" class="form-control">
-                                               <option value="servicename">Service name</option>
-                                               <f:if condition="{oracleSidSelected}">
-                                                       <f:then>
-                                                               <option value="sid" selected="selected">SID</option>
-                                                       </f:then>
-                                                       <f:else>
-                                                               <option value="sid">SID</option>
-                                                       </f:else>
-                                               </f:if>
-                                       </select></div>
-                               </div>
-                       </f:if>
 
                        <button class="btn btn-success" type="submit">
                                Continue
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/DbalDriverSelection.html b/typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/DbalDriverSelection.html
deleted file mode 100644 (file)
index 13cd6b1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<form method="post">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <input type="hidden" value="execute" name="install[set]" />
-
-       <fieldset class="t3-install-form-label-width-7">
-               <ol>
-                       <li>
-                               <label>Driver</label>
-                               <select name="install[values][setDbalDriver]" onChange="this.form.submit();">
-                                       <f:if condition="{selectedDbalDriver}">
-                                               <f:then>
-                                               </f:then>
-                                               <f:else>
-                                                       <option></option>
-                                               </f:else>
-                                       </f:if>
-
-                                       <f:if condition="{dbalDrivers}">
-                                               <f:then>
-                                                       <f:for each="{dbalDrivers}" as="drivers" key="abstractionLayer">
-                                                               <optgroup label="{abstractionLayer}">
-                                                                       <f:for each="{drivers}" as="driver">
-                                                                               <f:if condition="{driver.selected}">
-                                                                                       <f:then>
-                                                                                               <option value="{driver.driver}" selected="selected">
-                                                                                                       {driver.label}
-                                                                                               </option>
-                                                                                       </f:then>
-                                                                                       <f:else>
-                                                                                               <option value="{driver.driver}">
-                                                                                                       {driver.label}
-                                                                                               </option>
-                                                                                       </f:else>
-                                                                               </f:if>
-                                                                       </f:for>
-                                                               </optgroup>
-                                                       </f:for>
-                                               </f:then>
-                                       </f:if>
-                               </select>
-                       </li>
-               </ol>
-       </fieldset>
-</form>
-<hr />
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/LoadDbal.html b/typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/LoadDbal.html
deleted file mode 100644 (file)
index 79c5915..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<p>
-       TYPO3 CMS native database implementation is based on MySQL. A database abstraction layer
-       allows to run TYPO3 CMS on different database engines like postgres. This is used rather seldom
-       and some core parts and extensions do not fully support this. Your TYPO3 CMS experience might suffer
-       if you choose to install the system on anything different than MySQL.
-</p>
-
-<form method="post">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <input type="hidden" value="execute" name="install[set]" />
-       <input type="hidden" value="1" name="install[values][loadDbal]" />
-       <button class="btn btn-warning" type="submit">
-               I do not use MySQL
-               <span class="t3-install-form-button-icon-negative">&nbsp;</span>
-       </button>
-</form>
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/UnloadDbal.html b/typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/UnloadDbal.html
deleted file mode 100644 (file)
index 6643164..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<form method="post">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <input type="hidden" value="execute" name="install[set]" />
-       <input type="hidden" value="1" name="install[values][unloadDbal]" />
-       <button class="btn btn-default" type="submit">
-               I use native MySQL
-       </button>
-</form>
\ No newline at end of file
index b05ae3e..c5c1afe 100644 (file)
                This can be done using tools provided by your host.
        </p>
 
-       <f:if condition="{isDbalEnabled}">
-               <f:then>
-                       <f:render partial="Action/Step/DatabaseConnect/DbalDriverSelection" arguments="{_all}" />
-                       <f:if condition="{selectedDbalDriver}">
-                               <f:render partial="Action/Step/DatabaseConnect/ConnectDetails" arguments="{_all}" />
-                       </f:if>
-                       <f:render partial="Action/Step/DatabaseConnect/UnloadDbal" arguments="{_all}" />
-               </f:then>
-
-               <f:else>
-                       <f:render partial="Action/Step/DatabaseConnect/ConnectDetails" arguments="{_all}" />
-                       <f:render partial="Action/Step/DatabaseConnect/LoadDbal" arguments="{_all}" />
-               </f:else>
-       </f:if>
+       <f:render partial="Action/Step/DatabaseConnect/ConnectDetails" arguments="{_all}" />
 </f:section>
\ No newline at end of file