* Rename t3lib_install::getFieldDefinitions_sqlContent() to t3lib_install::getFieldDe...
authorMichael Stucki <michael.stucki@typo3.org>
Tue, 26 Feb 2008 13:47:03 +0000 (13:47 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Tue, 26 Feb 2008 13:47:03 +0000 (13:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3290 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_install.php
typo3/mod/tools/em/class.em_index.php
typo3/sysext/dbal/class.ux_t3lib_db.php
typo3/sysext/install/mod/class.tx_install.php

index 46e62f0..96411f9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-26  Michael Stucki  <michael@typo3.org>
+
+       * Rename t3lib_install::getFieldDefinitions_sqlContent() to t3lib_install::getFieldDefinitions_fileContent() and provide a wrapper for backwards compatibility
+
 2008-02-26  Oliver Hader  <oh@inpublica.de>
 
        * Fixed bug #7637: Page tree fails to reload properly if page was manipulated
index fcbf0bb..d990a69 100755 (executable)
@@ -46,7 +46,7 @@
  *  266:     function slashValueForSingleDashes($value)
  *
  *              SECTION: SQL
- *  291:     function getFieldDefinitions_sqlContent($sqlContent)
+ *  291:     function getFieldDefinitions_fileContent($fileContent)
  *  359:     function getFieldDefinitions_sqlContent_parseTypes(&$total)
  *  406:     function getFieldDefinitions_database()
  *  450:     function getDatabaseExtra($FDsrc, $FDcomp, $onlyTableList='')
@@ -291,8 +291,8 @@ class t3lib_install {
         * @param       string          $sqlContent: Should be a string read from an sql-file made with 'mysqldump [database_name] -d'
         * @return      array           Array with information about table.
         */
-       function getFieldDefinitions_sqlContent($sqlContent)    {
-               $lines = t3lib_div::trimExplode(chr(10), $sqlContent,1);
+       function getFieldDefinitions_fileContent($fileContent)  {
+               $lines = t3lib_div::trimExplode(chr(10), $fileContent,1);
                $isTable = '';
                $total = Array();
 
@@ -355,10 +355,10 @@ class t3lib_install {
         * Multiplies varchars/tinytext fields in size according to $this->multiplySize
         * Useful if you want to use UTF-8 in the database and needs to extend the field sizes in the database so UTF-8 chars are not discarded. For most charsets available as single byte sets, multiplication with 2 should be enough. For chinese, use 3.
         *
-        * @param       array           Total array (from getFieldDefinitions_sqlContent())
+        * @param       array           Total array (from getFieldDefinitions_fileContent())
         * @return      void
         * @access private
-        * @see getFieldDefinitions_sqlContent()
+        * @see getFieldDefinitions_fileContent()
         */
        function getFieldDefinitions_sqlContent_parseTypes(&$total)     {
 
@@ -475,7 +475,7 @@ class t3lib_install {
         * Compares two arrays with field information and returns information about fields that are MISSING and fields that have CHANGED.
         * FDsrc and FDcomp can be switched if you want the list of stuff to remove rather than update.
         *
-        * @param       array           Field definitions, source (from getFieldDefinitions_sqlContent())
+        * @param       array           Field definitions, source (from getFieldDefinitions_fileContent())
         * @param       array           Field definitions, comparison. (from getFieldDefinitions_database())
         * @param       string          Table names (in list) which is the ONLY one observed.
         * @param       boolean         If set, this function ignores NOT NULL statements of the sql file field definition when comparing current field definition from database with field definition from sql file. This way, NOT NULL statements will be executed when the field is initially created, but the sql parser will never complain about missing NOT NULL statements afterwards.
@@ -818,6 +818,17 @@ class t3lib_install {
 
                return $content;
        }
+
+       /**
+        * Reads the field definitions for the input sql-file string
+        *
+        * @param       string          $sqlContent: Should be a string read from an sql-file made with 'mysqldump [database_name] -d'
+        * @return      array           Array with information about table.
+        * @deprecated
+        */
+       function getFieldDefinitions_sqlContent($sqlContent)    {
+               return $this->getFieldDefinitions_fileContent($sqlContent);
+       }
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_install.php'])  {
index ba9dc7e..df921b4 100644 (file)
@@ -4528,7 +4528,7 @@ $EM_CONF[$_EXTKEY] = '.$this->arrayToCode($EM_CONF, 0).';
                if (is_array($extInfo['files']) && in_array('ext_tables.sql',$extInfo['files']))        {
                        $fileContent = t3lib_div::getUrl($this->getExtPath($extKey,$extInfo['type']).'ext_tables.sql');
 
-                       $FDfile = $instObj->getFieldDefinitions_sqlContent($fileContent);
+                       $FDfile = $instObj->getFieldDefinitions_fileContent($fileContent);
                        if (count($FDfile))     {
                                $FDdb = $instObj->getFieldDefinitions_database(TYPO3_db);
                                $diff = $instObj->getDatabaseExtra($FDfile, $FDdb);
@@ -4621,7 +4621,7 @@ $EM_CONF[$_EXTKEY] = '.$this->arrayToCode($EM_CONF, 0).';
                if (is_array($extInfo['files']) && in_array('ext_tables.sql',$extInfo['files']))        {
                        $fileContent = t3lib_div::getUrl($this->getExtPath($extKey,$extInfo['type']).'ext_tables.sql');
 
-                       $FDfile = $instObj->getFieldDefinitions_sqlContent($fileContent);
+                       $FDfile = $instObj->getFieldDefinitions_fileContent($fileContent);
                        if (count($FDfile))     {
                                $FDdb = $instObj->getFieldDefinitions_database(TYPO3_db);
                                $diff = $instObj->getDatabaseExtra($FDfile, $FDdb);
index d4130db..4980023 100644 (file)
@@ -234,7 +234,7 @@ class ux_t3lib_DB extends t3lib_DB {
                else {
                                // handle stddb.sql, parse and analyze
                        $extSQL = t3lib_div::getUrl(PATH_site.'t3lib/stddb/tables.sql');
-                       $parsedExtSQL = $this->Installer->getFieldDefinitions_sqlContent($extSQL);
+                       $parsedExtSQL = $this->Installer->getFieldDefinitions_fileContent($extSQL);
                        $this->analyzeFields($parsedExtSQL);
 
                                // loop over all installed extensions
@@ -244,7 +244,7 @@ class ux_t3lib_DB extends t3lib_DB {
 
                                        // fetch db dump (if any) and parse it, then analyze
                                $extSQL = t3lib_div::getUrl($v['ext_tables.sql']);
-                               $parsedExtSQL = $this->Installer->getFieldDefinitions_sqlContent($extSQL);
+                               $parsedExtSQL = $this->Installer->getFieldDefinitions_fileContent($extSQL);
                                $this->analyzeFields($parsedExtSQL);
                        }
 
@@ -263,9 +263,9 @@ class ux_t3lib_DB extends t3lib_DB {
        /**
         * Analyzes fields and adds the extracted information to the field type, auto increment and primary key info caches.
         *
-        * @param array $parsedExtSQL The output produced by t3lib_install::getFieldDefinitions_sqlContent()
+        * @param array $parsedExtSQL The output produced by t3lib_install::getFieldDefinitions_fileContent()
         * @return void
-        * @see t3lib_install::getFieldDefinitions_sqlContent()
+        * @see t3lib_install::getFieldDefinitions_fileContent()
         */
        function analyzeFields($parsedExtSQL) {
                foreach($parsedExtSQL as $table => $tdef) {
index 8ade8db..98b8da7 100755 (executable)
@@ -3438,7 +3438,7 @@ From sub-directory:
                                                        $this->getStatementArray($tblFileContent,1,'^CREATE TABLE '),
                                                        chr(10)
                                                );
-                                               $FDfile = $this->getFieldDefinitions_sqlContent($fileContent);
+                                               $FDfile = $this->getFieldDefinitions_fileContent($fileContent);
                                                if (!count($FDfile))    {
                                                        die ("Error: There were no 'CREATE TABLE' definitions in the provided file");
                                                }
@@ -3624,7 +3624,7 @@ From sub-directory:
                                                                $this->getStatementArray($tblFileContent,1,'^CREATE TABLE '),
                                                                chr(10)
                                                        );
-                                                       $FDfile = $this->getFieldDefinitions_sqlContent($fileContent);
+                                                       $FDfile = $this->getFieldDefinitions_fileContent($fileContent);
                                                        $FDdb = $this->getFieldDefinitions_database();
                                                        $diff = $this->getDatabaseExtra($FDfile, $FDdb);
                                                        $update_statements = $this->getUpdateSuggestions($diff);