[TYPO3-core] RFC: #9318: Enhance and fix tslib_eidtools
Benjamin Mack
benni at typo3.org
Thu Sep 11 20:01:58 CEST 2008
Hey,
for this function, couldn't we put the three first lines of comment in
the beginning into the main comment structure?
+ /**
+ * Makes TCA available inside eID
+ *
+ * @return void
+ */
+ public static function initTCA() {
+ // It is possible that $TCA is an array but it was not loaded properly.
+ // This happens if some badly made extension attempts to manipulate
+ // $TCA in the ext_localconf.php.
+ if (!is_array($GLOBALS['TCA']) || !isset($GLOBALS['TCA']['pages'])) {
+ // Load TCA using TSFE
+ self::getTSFE()->includeTCA(false);
+ }
+ }
Also, what's the reason for putting the function as "final"? (maybe I
don't see it).
Other than that, +1 after reading.
Dmitry Dulepov [typo3] wrote:
> Hi!
>
> This is SVN patch request.
>
> Type: feature/bugfix
>
> Branches: trunk
>
> BT reference: http://bugs.typo3.org/view.php?id=9318
>
> Problem: Current implementation of tslib_eidtools has certain flows.
> Firsts, it misses a function to initialize $GLOBALS['LANG']. Thus every
> developer will have to do it manually. The solution is to add such
> function. The next problem is that TCA is not available by default in
> eID. So two new functions are added to include TCA for loaded extensions
> or include TCA for the particular extension (this will provide extra
> performance benefits). Next if eID script uses connectDB and
> initFeUsers, database connection will be initialized twice. The patch
> solves the problem. And finally there is a small performance enhancement
> by using cached instance of TSFE.
> Solution: the attached patch.
>
--
All the best,
benni.
-SDG-
More information about the TYPO3-team-core
mailing list