Fixed bug #9925: Initialization of new caching framework breaks some eID scripts
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 16 Dec 2008 10:56:27 +0000 (10:56 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 16 Dec 2008 10:56:27 +0000 (10:56 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4555 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/index_ts.php

index c9a9252..62cd791 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-16  Dmitry Dulepov  <dmitry@typo3.org>
+
+       * Fixed bug #9925: Initialization of new caching framework breaks some eID scripts
+
 2008-12-15  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #9844: Filepermissons (RW) in filelist are hardcoded
index da8765b..9de59d9 100755 (executable)
@@ -465,6 +465,8 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
                                t3lib_div::callUserFunction($_funcRef,$_params,$this);
                        }
                }
+
+               $this->initCaches();
        }
 
        /**
@@ -577,13 +579,48 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
         *
         ********************************************/
 
+       /**
+        * Include files necessary for the TYPO3 caching framework. This method will
+        * go away when autoloading is implemented.
+        *
+        * @return      void
+        */
+       protected function includeCaches() {
+               $GLOBALS['TT']->push('Including the Caching System','');
+
+               t3lib_div::requireOnce(PATH_t3lib . 'class.t3lib_cache.php');
+
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/class.t3lib_cache_abstractbackend.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/class.t3lib_cache_abstractcache.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/class.t3lib_cache_exception.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/class.t3lib_cache_factory.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/class.t3lib_cache_manager.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/class.t3lib_cache_variablecache.php');
+
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_classalreadyloaded.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_duplicateidentifier.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidbackend.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidcache.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invaliddata.php');
+               t3lib_div::requireOnce(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_nosuchcache.php');
+
+               $GLOBALS['TT']->pull();
+       }
 
        /**
         * Initializes the caching system.
         *
         * @return      void
         */
-       public function initCaches() {
+       protected function initCaches() {
+               $this->includeCaches();
+
+               $GLOBALS['TT']->push('Initializing the Caching System','');
+
+               $GLOBALS['typo3CacheManager'] = t3lib_div::makeInstance('t3lib_cache_Manager');
+               $cacheFactoryClass = t3lib_div::makeInstanceClassName('t3lib_cache_Factory');
+               $GLOBALS['typo3CacheFactory'] = new $cacheFactoryClass($GLOBALS['typo3CacheManager']);
+
                try {
                        $this->pageCache = $GLOBALS['typo3CacheManager']->getCache(
                                'cache_pages'
@@ -598,6 +635,8 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
 
                t3lib_cache::initPageSectionCache();
                t3lib_cache::initContentHashCache();
+
+               $GLOBALS['TT']->pull();
        }
 
        /**
index c0450a4..7b914fb 100755 (executable)
@@ -151,35 +151,6 @@ $TT->push('Include Frontend libraries','');
 $TT->pull();
 
 // ***********************************
-// Initializing the Caching System
-// ***********************************
-
-$TT->push('Initializing the Caching System','');
-               // TODO implement autoloading so that we only require stuff we really need
-       require_once(PATH_t3lib . 'class.t3lib_cache.php');
-
-       require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractbackend.php');
-       require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractcache.php');
-       require_once(PATH_t3lib . 'cache/class.t3lib_cache_exception.php');
-       require_once(PATH_t3lib . 'cache/class.t3lib_cache_factory.php');
-       require_once(PATH_t3lib . 'cache/class.t3lib_cache_manager.php');
-       require_once(PATH_t3lib . 'cache/class.t3lib_cache_variablecache.php');
-
-       require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_classalreadyloaded.php');
-       require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_duplicateidentifier.php');
-       require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidbackend.php');
-       require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidcache.php');
-       require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invaliddata.php');
-       require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_nosuchcache.php');
-
-       $typo3CacheManager = t3lib_div::makeInstance('t3lib_cache_Manager');
-       $cacheFactoryClass = t3lib_div::makeInstanceClassName('t3lib_cache_Factory');
-       $typo3CacheFactory = new $cacheFactoryClass($typo3CacheManager);
-
-       unset($cacheFactoryClass);
-$TT->pull();
-
-// ***********************************
 // Create $TSFE object (TSFE = TypoScript Front End)
 // Connecting to database
 // ***********************************
@@ -195,7 +166,6 @@ $TSFE = new $temp_TSFEclassName(
        t3lib_div::_GP('MP'),
        t3lib_div::_GP('RDCT')
 );
-$TSFE->initCaches();
 
 if($TYPO3_CONF_VARS['FE']['pageUnavailable_force'] &&
    !t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $TYPO3_CONF_VARS['SYS']['devIPmask'])) {