Raised DBAL version from 1.1.3 to 1.1.4
authorXavier Perseguers <typo3@perseguers.ch>
Sun, 2 May 2010 20:16:40 +0000 (20:16 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Sun, 2 May 2010 20:16:40 +0000 (20:16 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7516 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.tx_dbal_autoloader.php
typo3/sysext/dbal/class.tx_dbal_installtool.php
typo3/sysext/dbal/class.ux_t3lib_sqlparser.php
typo3/sysext/dbal/ext_emconf.php
typo3/sysext/dbal/last_synched_target
typo3/sysext/dbal/tests/sqlparser_general_testcase.php

index 1c05d0f..b0cb418 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-02  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Raised DBAL version from 1.1.3 to 1.1.4
+
 2010-05-02  Benjamin Mack  <benni@typo3.org>
 
        * Fixed bug #14276: tceforms: Title of a record does not use API call to limit the character
index a47043b..13d420a 100644 (file)
@@ -1,3 +1,13 @@
+2010-05-02  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Set version to 1.1.4 (TYPO3 4.4 beta2)
+
+2010-05-01  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Fixed bug #14274: Some exception are not caught when trying to install DBAL in 1-2-3 Install Tool process
+       * Fixed bug #2186: Error installing static_info_tables
+       * Fixed bug #14265: Driver dropdown in install tool should be hidden when only MySQL is available
+
 2010-04-30  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Set version to 1.1.3
index 799b8f0..e15305c 100644 (file)
@@ -54,7 +54,7 @@ class tx_dbal_autoloader {
                                break;
                        case 3:
                                $driver = $instObj->INSTALL['localconf.php']['typo_db_driver'];
-                               if ($driver === 'mysql' || $driver === 'mysqli') {
+                               if ($driver === 'mysql') {
                                        $this->deactivateDbal();
                                }
                                break;
@@ -121,16 +121,23 @@ class tx_dbal_autoloader {
                $instObj->allowUpdateLocalConf = 1;
                $instObj->updateIdentity = 'TYPO3 Core Update Manager';
 
-                       // Get lines from localconf file
-               $lines = $instObj->writeToLocalconf_control();
-               $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $newExtList);
-               $instObj->writeToLocalconf_control($lines);
+               try {
+                               // Get lines from localconf file
+                       $lines = $instObj->writeToLocalconf_control();
+                       $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $newExtList);
+                       $instObj->writeToLocalconf_control($lines);
 
-               $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = $newExtList;
-                       // Make sure to get cache file for backend, not frontend
-               $cacheFilePrefix = $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'];
-               $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'] = str_replace('temp_CACHED_FE', 'temp_CACHED', $cacheFilePrefix);
-               t3lib_extMgm::removeCacheFiles();
+                       $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = $newExtList;
+                               // Make sure to get cache file for backend, not frontend
+                       $cacheFilePrefix = $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'];
+                       $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'] = str_replace('temp_CACHED_FE', 'temp_CACHED', $cacheFilePrefix);
+                       t3lib_extMgm::removeCacheFiles();
+               } catch (Exception $e) {
+                       $header = 'Error';
+                       $message = $e->getMessage();
+                       t3lib_timeTrack::debug_typo3PrintError($header, $message, FALSE, t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
+                       exit; 
+               }
        }
 
 }
index 219386e..0c8cc91 100644 (file)
@@ -104,7 +104,6 @@ class tx_dbal_installtool {
                                                $driverConfig = '\'useNameQuote\' => TRUE';
                                                break;
                                        case 'mysql':
-                                       case 'mysqli':
                                                return;
                                }
                                $config = 'array(' .
@@ -130,6 +129,11 @@ class tx_dbal_installtool {
         * @return void
         */
        protected function createConnectionForm($driver, array &$markers, tx_install $instObj) {
+                       // Normalize current driver
+               if (!$driver) {  
+                       $driver = $this->getDefaultDriver();
+               }
+
                        // Get the template file
                $templateFile = @file_get_contents(
                        t3lib_extMgm::extPath('dbal') . $this->templateFilePath . 'install.html'
@@ -143,21 +147,25 @@ class tx_dbal_installtool {
                $formSubPart = t3lib_parsehtml::getSubpart(
                        $template, '###CONNECTION_FORM###'
                );
-               $driverTemplate = t3lib_parsehtml::getSubpart(
-                       $formSubPart, '###DATABASE_DRIVER###'
-               );
-               $driverSubPart = $this->prepareDatabaseDrivers($driverTemplate);
+               if ($this->getNumberOfAvailableDrivers() == 1 && $this->getDefaultDriver() === 'mysql') {
+                               // Only MySQL is actually available (PDO support may be compiled in
+                               // PHP itself and as such DBAL was activated, behaves as if DBAL were
+                               // not activated
+                       $driverSubPart = '';
+               } else {
+                       $driverTemplate = t3lib_parsehtml::getSubpart(
+                               $formSubPart, '###DATABASE_DRIVER###'
+                       );
+                       $driverSubPart = $this->prepareDatabaseDrivers($driverTemplate);
+               }
                $formSubPart = t3lib_parsehtml::substituteSubpart(
                        $formSubPart,
                        '###DATABASE_DRIVER###',
                        $driverSubPart
                );
 
-               if (!$driver) {  
-                       $driver = $this->getDefaultDriver();
-               }
                        // Get the subpart related to selected database driver
-               if ($driver === '' || $driver === 'mysql' || $driver === 'mysqli') {
+               if ($driver === '' || $driver === 'mysql') {
                        $driverOptionsSubPart = t3lib_parsehtml::getSubpart(
                                $template, '###DRIVER_MYSQL###'
                        );
@@ -385,6 +393,19 @@ class tx_dbal_installtool {
        }
 
        /**
+        * Returns the number of available drivers.
+        *
+        * @return boolean
+        */
+       protected function getNumberOfAvailableDrivers() {
+               $count = 0;
+               foreach ($this->availableDrivers as $drivers) {
+                       $count += count($drivers);
+               }
+               return $count;
+       }
+
+       /**
         * Returns the driver that is selected by default in the
         * Install Tool dropdown list.
         *
index 464e9d5..d10f87c 100644 (file)
@@ -298,6 +298,7 @@ class ux_t3lib_sqlparser extends t3lib_sqlparser {
                                                break;
                                        case 'ADDKEY':
                                        case 'ADDPRIMARYKEY':
+                                       case 'ADDUNIQUE':
                                                $query .= ' (' . implode(',', $components['fields']) . ')';
                                                break;
                                }
index 4953b46..b4684dd 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "dbal".
 #
-# Auto generated 30-04-2010 21:11
+# Auto generated 02-05-2010 22:06
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -32,13 +32,13 @@ $EM_CONF[$_EXTKEY] = array(
        'author_company' => '',
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
-       'version' => '1.1.3',
-       '_md5_values_when_last_written' => 'a:42:{s:9:"ChangeLog";s:4:"a252";s:28:"class.tx_dbal_autoloader.php";s:4:"bb38";s:29:"class.tx_dbal_installtool.php";s:4:"0564";s:26:"class.ux_db_list_extra.php";s:4:"60d9";s:21:"class.ux_t3lib_db.php";s:4:"1839";s:28:"class.ux_t3lib_sqlparser.php";s:4:"a9d4";s:16:"ext_autoload.php";s:4:"821a";s:21:"ext_conf_template.txt";s:4:"f5cf";s:12:"ext_icon.gif";s:4:"c9ba";s:17:"ext_localconf.php";s:4:"afdd";s:14:"ext_tables.php";s:4:"8414";s:14:"ext_tables.sql";s:4:"1f95";s:27:"doc/class.tslib_fe.php.diff";s:4:"0083";s:14:"doc/manual.sxw";s:4:"b022";s:45:"handlers/class.tx_dbal_handler_openoffice.php";s:4:"775f";s:43:"handlers/class.tx_dbal_handler_rawmysql.php";s:4:"2f1b";s:40:"handlers/class.tx_dbal_handler_xmldb.php";s:4:"e363";s:31:"lib/class.tx_dbal_sqlengine.php";s:4:"f1bb";s:33:"lib/class.tx_dbal_tsparserext.php";s:4:"862d";s:14:"mod1/clear.gif";s:4:"cc11";s:13:"mod1/conf.php";s:4:"6e63";s:14:"mod1/index.php";s:4:"4a5e";s:18:"mod1/locallang.xml";s:4:"0b57";s:22:"mod1/locallang_mod.xml";s:4:"86ef";s:19:"mod1/moduleicon.gif";s:4:"2b8f";s:10:"res/README";s:4:"be19";s:26:"res/Templates/install.html";s:4:"6a62";s:30:"res/oracle/indexed_search.diff";s:4:"ec81";s:23:"res/oracle/realurl.diff";s:4:"86da";s:25:"res/oracle/scheduler.diff";s:4:"7c06";s:27:"res/oracle/templavoila.diff";s:4:"1fd5";s:43:"res/postgresql/postgresql-compatibility.sql";s:4:"034c";s:22:"tests/BaseTestCase.php";s:4:"f736";s:26:"tests/FakeDbConnection.php";s:4:"7bab";s:29:"tests/db_general_testcase.php";s:4:"42f4";s:27:"tests/db_mssql_testcase.php";s:4:"5593";s:28:"tests/db_oracle_testcase.php";s:4:"4dfc";s:32:"tests/db_postgresql_testcase.php";s:4:"4851";s:36:"tests/sqlparser_general_testcase.php";s:4:"9c10";s:31:"tests/fixtures/mssql.config.php";s:4:"ff95";s:30:"tests/fixtures/oci8.config.php";s:4:"7179";s:36:"tests/fixtures/postgresql.config.php";s:4:"87a1";}',
+       'version' => '1.1.4',
+       '_md5_values_when_last_written' => 'a:42:{s:9:"ChangeLog";s:4:"5276";s:28:"class.tx_dbal_autoloader.php";s:4:"7e31";s:29:"class.tx_dbal_installtool.php";s:4:"73ec";s:26:"class.ux_db_list_extra.php";s:4:"60d9";s:21:"class.ux_t3lib_db.php";s:4:"1839";s:28:"class.ux_t3lib_sqlparser.php";s:4:"2c3f";s:16:"ext_autoload.php";s:4:"821a";s:21:"ext_conf_template.txt";s:4:"f5cf";s:12:"ext_icon.gif";s:4:"c9ba";s:17:"ext_localconf.php";s:4:"afdd";s:14:"ext_tables.php";s:4:"8414";s:14:"ext_tables.sql";s:4:"1f95";s:27:"doc/class.tslib_fe.php.diff";s:4:"0083";s:14:"doc/manual.sxw";s:4:"b022";s:45:"handlers/class.tx_dbal_handler_openoffice.php";s:4:"775f";s:43:"handlers/class.tx_dbal_handler_rawmysql.php";s:4:"2f1b";s:40:"handlers/class.tx_dbal_handler_xmldb.php";s:4:"e363";s:31:"lib/class.tx_dbal_sqlengine.php";s:4:"f1bb";s:33:"lib/class.tx_dbal_tsparserext.php";s:4:"862d";s:14:"mod1/clear.gif";s:4:"cc11";s:13:"mod1/conf.php";s:4:"6e63";s:14:"mod1/index.php";s:4:"4a5e";s:18:"mod1/locallang.xml";s:4:"0b57";s:22:"mod1/locallang_mod.xml";s:4:"86ef";s:19:"mod1/moduleicon.gif";s:4:"2b8f";s:10:"res/README";s:4:"be19";s:26:"res/Templates/install.html";s:4:"6a62";s:30:"res/oracle/indexed_search.diff";s:4:"ec81";s:23:"res/oracle/realurl.diff";s:4:"86da";s:25:"res/oracle/scheduler.diff";s:4:"7c06";s:27:"res/oracle/templavoila.diff";s:4:"1fd5";s:43:"res/postgresql/postgresql-compatibility.sql";s:4:"034c";s:22:"tests/BaseTestCase.php";s:4:"f736";s:26:"tests/FakeDbConnection.php";s:4:"7bab";s:29:"tests/db_general_testcase.php";s:4:"42f4";s:27:"tests/db_mssql_testcase.php";s:4:"5593";s:28:"tests/db_oracle_testcase.php";s:4:"4dfc";s:32:"tests/db_postgresql_testcase.php";s:4:"4851";s:36:"tests/sqlparser_general_testcase.php";s:4:"07a6";s:31:"tests/fixtures/mssql.config.php";s:4:"ff95";s:30:"tests/fixtures/oci8.config.php";s:4:"7179";s:36:"tests/fixtures/postgresql.config.php";s:4:"87a1";}',
        'constraints' => array(
                'depends' => array(
                        'adodb' => '5.10.0-',
                        'php' => '5.2.0-0.0.0',
-                       'typo3' => '4.4.0beta1-4.4.99',
+                       'typo3' => '4.4.0beta2-4.4.99',
                ),
                'conflicts' => array(
                ),
index b7d0814..7277a7b 100644 (file)
@@ -1 +1 @@
-https://svn.typo3.org/TYPO3v4/Extensions/dbal/tags/1.1.3/
+https://svn.typo3.org/TYPO3v4/Extensions/dbal/tags/1.1.4/
index 17ac9f8..0201c64 100644 (file)
@@ -486,6 +486,21 @@ class sqlparser_general_testcase extends BaseTestCase {
                $this->assertTrue(is_array($alterTables), $alterTables);
        }
 
+       /**
+        * @test
+        * @see http://bugs.typo3.org/view.php?id=2186
+        */
+       public function canParseUniqueIndexCreation() {
+               $sql = 'ALTER TABLE static_territories ADD UNIQUE uid (uid)';
+               $expected = $sql;
+               $alterTables = $this->fixture->_callRef('parseALTERTABLE', $sql);
+               $queries = $this->fixture->compileSQL($alterTables);
+
+               $this->assertTrue(is_array($queries), $queries);
+               $this->assertTrue(count($queries) == 1, $queries);
+               $this->assertEquals($expected, $queries[0]);
+       }
+
        ///////////////////////////////////////
        // Tests concerning subqueries
        ///////////////////////////////////////