[TASK] Store legacy deprecation file in generic log folder 60/57160/3
authorBenni Mack <benni@typo3.org>
Sat, 9 Jun 2018 15:10:34 +0000 (17:10 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 9 Jun 2018 16:01:36 +0000 (18:01 +0200)
The deprecation log file that was used prior to v9.0, was previously
stored in typo3conf/deprecation_* which is still used for extensions
still using the old API, is now put into var/log/ where all other
log files reside.

For installations using the environment concept with
"$_ENV['TYPO3_PATH_APP']" - e.g. all installations in composer mode -
the file is now created at that place, for installations having
everything in the public web root, the file is now in
"typo3temp/var/log/deprecation_...log".

Resolves: #85198
Releases: master
Change-Id: I0fc23d9fec6cfa45241c041f64333deb90d44950
Reviewed-on: https://review.typo3.org/57160
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index fc184f7..e122e67 100644 (file)
@@ -4012,7 +4012,7 @@ class GeneralUtility
     public static function getDeprecationLogFileName()
     {
         static::writeDeprecationLogFileEntry(__METHOD__ . ' is deprecated since TYPO3 v9.0, will be removed in TYPO3 v10.0');
-        return PATH_typo3conf . 'deprecation_' . self::shortMD5(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '.log';
+        return Environment::getVarPath() . '/log/deprecation_' . self::shortMD5(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '.log';
     }
 
     /**
@@ -4179,7 +4179,7 @@ class GeneralUtility
     {
         $date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': ');
         // Write a longer message to the deprecation log
-        $destination = PATH_typo3conf . 'deprecation_' . self::shortMD5(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '.log';
+        $destination = Environment::getVarPath() . '/log/deprecation_' . self::shortMD5(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '.log';
         $file = @fopen($destination, 'a');
         if ($file) {
             @fwrite($file, $date . $msg . LF);