Performance enhancement in t3lib/class.t3lib_div.php in function loadTCA
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 12 Jul 2007 11:36:08 +0000 (11:36 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 12 Jul 2007 11:36:08 +0000 (11:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2402 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 294490c..779cad0 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * TCEForms: allow to create many sections at once
        * Performance enhancement in t3lib/class.t3lib_extmgm.php in function addToAllTCAtypes
+       * Performance enhancement in t3lib/class.t3lib_div.php in function loadTCA
 
 2007-07-11  Oliver Hader  <oh@inpublica.de>
 
index 4d5c815..fd0e479 100755 (executable)
@@ -3812,13 +3812,20 @@ class t3lib_div {
         * @return      void
         */
        function loadTCA($table)        {
-               global $TCA,$LANG_GENERAL_LABELS;
-               if (isset($TCA[$table]) && !is_array($TCA[$table]['columns']) && $TCA[$table]['ctrl']['dynamicConfigFile'])     {
-                       if (!strcmp(substr($TCA[$table]['ctrl']['dynamicConfigFile'],0,6),'T3LIB:'))    {
-                               include(PATH_t3lib.'stddb/'.substr($TCA[$table]['ctrl']['dynamicConfigFile'],6));
-                       } elseif (t3lib_div::isAbsPath($TCA[$table]['ctrl']['dynamicConfigFile']) && @is_file($TCA[$table]['ctrl']['dynamicConfigFile']))       {       // Absolute path...
-                               include($TCA[$table]['ctrl']['dynamicConfigFile']);
-                       } else include(PATH_typo3conf.$TCA[$table]['ctrl']['dynamicConfigFile']);
+               global $TCA;
+
+               if (isset($TCA[$table])) {
+                       $tca = &$TCA[$table];
+                       if (!$tca['columns']) {
+                               $dcf = $tca['ctrl']['dynamicConfigFile'];
+                               if ($dcf) {
+                                       if (!strcmp(substr($dcf,0,6),'T3LIB:')) {
+                                               include(PATH_t3lib.'stddb/'.substr($dcf,6));
+                                       } elseif (t3lib_div::isAbsPath($dcf) && @is_file($dcf)) {       // Absolute path...
+                                               include($dcf);
+                                       } else include(PATH_typo3conf.$dcf);
+                               }
+                       }
                }
        }