[BUGFIX] Fatal error 't3lib_lock' does not exist
authorOliver Hader <oliver@typo3.org>
Wed, 14 Mar 2012 09:28:12 +0000 (10:28 +0100)
committerOliver Hader <oliver@typo3.org>
Fri, 16 Mar 2012 21:32:23 +0000 (22:32 +0100)
The PHP fatal error occurs for the following settings:
$TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] is enabled
$TYPO3_CONF_VARS['BE']['forceCharset'] is not "utf-8" (or empty)
$TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] is set to "file"

Change-Id: Ic4815ab40e60b8bb0d18b0f15261cb09c9d44280
Fixes: #34662
Releases: 4.5, 4.6, 4.7, 4.8
Reviewed-on: http://review.typo3.org/9639
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Klee
Reviewed-by: Sebastian Michaelsen
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
t3lib/class.t3lib_div.php

index fa7a2c0..3bc6c08 100644 (file)
@@ -6043,6 +6043,10 @@ final class t3lib_div {
                }
 
                if (stripos($log, 'file') !== FALSE) {
+                               // In case lock is acquired before autoloader was defined:
+                       if (class_exists('t3lib_lock') === FALSE) {
+                               require_once PATH_t3lib . 'class.t3lib_lock.php';
+                       }
                                // write a longer message to the deprecation log
                        $destination = self::getDeprecationLogFileName();
                        $lockObject = t3lib_div::makeInstance('t3lib_lock', $destination, $GLOBALS['TYPO3_CONF_VARS']['SYS']['lockingMode']);