/**
* Activates DBAL if it is supported.
*
- * @param integer $step
+ * @param tx_install $instObj
* @return void
*/
- public function execute($step) {
- t3lib_div::debug($step, 'current step');
- switch ($step) {
+ public function execute(tx_install $instObj) {
+ switch ($instObj->step) {
case 1:
+ case 2:
if (!t3lib_extMgm::isLoaded('dbal') && $this->isDbalSupported()) {
- t3lib_div::debug('activated dbal');
$this->activateDbal();
}
break;
+ case 3:
+ $driver = $instObj->INSTALL['localconf.php']['typo_db_driver'];
+ if ($driver === 'mysql' || $driver === 'mysqli') {
+ $this->deactivateDbal();
+ }
+ break;
}
}
$this->updateExtensionList(implode(',', $extList));
}
+ /**
+ * Dectivates DBAL.
+ *
+ * @return void
+ */
+ protected function deactivateDbal() {
+ $extList = t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']);
+ $extList = array_flip($extList);
+
+ // Remove sysext dbal and adodb
+ if (isset($extList['dbal'])) {
+ unset($extList['dbal']);
+ }
+ if (isset($extList['adodb'])) {
+ unset($extList['adodb']);
+ }
+ $extList = array_flip($extList);
+
+ $this->updateExtensionList(implode(',', $extList));
+ }
+
/**
* Updates the list of extensions.
*
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/class.tx_dbal_autoloader.php']);
}
-$installStep = $this->step;
-
// Make instance:
$SOBE = t3lib_div::makeInstance('tx_dbal_autoloader');
-$SOBE->execute($installStep);
+$SOBE->execute($this);
?>
\ No newline at end of file
* @param tx_install $instObj
* @return void
*/
- public function executeLocalconf(array &$lines, $step, tx_install $instObj) {
+ public function executeWriteLocalconf(array &$lines, $step, tx_install $instObj) {
switch ($step) {
+ //case 2:
+ // if (isset($instObj->INSTALL['localconf.php']['typo_db_driver'])) {
+ // $instObj->setValueInLocalconfFile($lines, '$typo_db_driver', trim($this->INSTALL['localconf.php']['typo_db_driver']));
+ // }
+ // break;
case 3:
$driver = $instObj->INSTALL['localconf.php']['typo_db_driver'];
$driverConfig = '';
}
break;
case 'adodb':
- $sqlTables = $this->handlerInstance['_DEFAULT']->MetaTables('TABLES');
- while (list($k, $theTable) = each($sqlTables)) {
- if (preg_match('/BIN\$/', $theTable)) continue; // skip tables from the Oracle 10 Recycle Bin
- $whichTables[$theTable] = $theTable;
+ // check needed for install tool - otherwise it will just die because the call to
+ // MetaTables is done on a stdClass instance
+ if (method_exists($this->handlerInstance['_DEFAULT'], 'MetaTables')) {
+ $sqlTables = $this->handlerInstance['_DEFAULT']->MetaTables('TABLES');
+ while (list($k, $theTable) = each($sqlTables)) {
+ if (preg_match('/BIN\$/', $theTable)) continue; // skip tables from the Oracle 10 Recycle Bin
+ $whichTables[$theTable] = $theTable;
+ }
}
break;
case 'userdefined':
// 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']['localconf'][] = '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';
?>