[BUGFIX] Also check if cache files are not empty
authorJigal van Hemert <jigal@xs4all.nl>
Sat, 20 Aug 2011 14:36:05 +0000 (16:36 +0200)
committerJigal van Hemert <jigal@xs4all.nl>
Sun, 21 Aug 2011 13:10:55 +0000 (15:10 +0200)
If the temp_CACHED* files exist, but they are empty a lot of functions
produce incorrect result due to missing TCA data. Checking the fileSize
prevents the use of empty cache files.

Change-Id: I6c1ce468bfeec88bf8445e64e7b1bd6387f117f7
Resolves: #29075
Branches: 4.5
Reviewed-on: http://review.typo3.org/4435
Reviewed-by: Christian Kuhn
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
t3lib/class.t3lib_extmgm.php

index 9076ce1..cecf0d4 100644 (file)
@@ -1410,14 +1410,15 @@ $_EXTCONF = $TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][$_EXTKEY];
         * Returns true if both the localconf and tables cache file exists (with $cacheFilePrefix)
         * Usage: 2
         *
-        * @param       string          Prefix of the cache file to check
-        * @return      boolean
-        * @internal
+        * @param $cacheFilePrefix string Prefix of the cache file to check
+        * @return boolean
         */
        public static function isCacheFilesAvailable($cacheFilePrefix) {
                return
-                               @is_file(PATH_typo3conf . $cacheFilePrefix . '_ext_localconf.php') &&
-                                               @is_file(PATH_typo3conf . $cacheFilePrefix . '_ext_tables.php');
+                       @is_file(PATH_typo3conf . $cacheFilePrefix . '_ext_localconf.php') &&
+                               @is_file(PATH_typo3conf . $cacheFilePrefix . '_ext_tables.php') &&
+                               @filesize(PATH_typo3conf . $cacheFilePrefix . '_ext_localconf.php') > 0 &&
+                               @filesize(PATH_typo3conf . $cacheFilePrefix . '_ext_tables.php') > 0;
        }
 
        /**