Index: typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php =================================================================== --- typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php (revision 7928) +++ typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php (working copy) @@ -34,6 +34,13 @@ */ class tx_reports_reports_status_ConfigurationStatus implements tx_reports_StatusProvider { + // 10 MB + protected $deprecationLogFileSizeWarningThreshold = 10485760; + // 100 MB + protected $deprecationLogFileSizeErrorThreshold = 104857600; + + + /** * Determines the Install Tool's status, mainly concerning its protection. * @@ -43,6 +50,7 @@ public function getStatus() { $statuses = array( 'emptyReferenceIndex' => $this->getReferenceIndexStatus(), + 'deprecationLog' => $this->getDeprecationLogStatus() ); if ($this->isMemcachedUsed()) { @@ -64,7 +72,7 @@ $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'sys_refindex'); $registry = t3lib_div::makeInstance('t3lib_Registry'); - $lastRefIndexUpdate = $registry->get('core', 'sys_refindex_lastUpdate'); + $lastRefIndexUpdate = $registry->get('core', 'sys_refindex_lastUpdate'); if (!$count && $lastRefIndexUpdate) { $value = $GLOBALS['LANG']->getLL('status_empty'); @@ -179,6 +187,47 @@ ); } + /** + * Provides status information on the deprecation log, whether it's enabled + * and if so whether certain limits in file size are reached. + * + * @return tx_reports_reports_status_Status The deprecation log status. + */ + protected function getDeprecationLogStatus() { + $title = $GLOBALS['LANG']->getLL('status_configuration_DeprecationLog'); + $value = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:disabled'); + $message = ''; + $severity = tx_reports_reports_status_Status::OK; + + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) { + $value = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:enabled'); + $message = '

' . $GLOBALS['LANG']->getLL('status_configuration_DeprecationLogEnabled') . '

'; + $severity = tx_reports_reports_status_Status::NOTICE; + + $logFile = t3lib_div::getDeprecationLogFileName(); + $logFileSize = file_exists($logFile) ? filesize($logFile) : 0; + + if ($logFileSize > $this->deprecationLogFileSizeWarningThreshold) { + $severity = tx_reports_reports_status_Status::WARNING; + } + + if ($logFileSize > $this->deprecationLogFileSizeErrorThreshold) { + $severity = tx_reports_reports_status_Status::ERROR; + } + + if ($severity > tx_reports_reports_status_Status::OK) { + $message .= '

' . sprintf( + $GLOBALS['LANG']->getLL('status_configuration_DeprecationLogSize'), + t3lib_div::formatSize($logFileSize) + ) . '

'; + } + } + + return t3lib_div::makeInstance('tx_reports_reports_status_Status', + $title, $value, $message, $severity + ); + } + } Index: typo3/sysext/reports/reports/locallang.xml =================================================================== --- typo3/sysext/reports/reports/locallang.xml (revision 7928) +++ typo3/sysext/reports/reports/locallang.xml (working copy) @@ -45,6 +45,9 @@ + + + \ No newline at end of file Index: typo3/sysext/lang/locallang_common.xml =================================================================== --- typo3/sysext/lang/locallang_common.xml (revision 7928) +++ typo3/sysext/lang/locallang_common.xml (working copy) @@ -18,12 +18,14 @@ + + Index: t3lib/config_default.php =================================================================== --- t3lib/config_default.php (revision 7928) +++ t3lib/config_default.php (working copy) @@ -96,7 +96,7 @@ 'phpTimeZone' => '', // String: timezone to force for all date() and mktime() functions. A list of supported values can be found at http://php.net/manual/en/timezones.php. If this is not set, a valid fallback will be searched for by PHP (php.ini's date.timezone setting, server defaults, etc); and if no fallback is found, the value of "UTC" is used instead. 'systemLog' => '', // String, semi-colon separated list: Defines one or more logging methods. Possible methods: file,[,];mail,[/][,];syslog,,[,];error_log[,,]. "file" logs to a file, "mail" sends the log entries via mail, "syslog" uses the operating system's log, "error_log" uses the PHP error log. The level is the individual logging level (see [SYS][systemLogLevel]. Facility may be one of LOCAL0..LOCAL7, USER (on Windows USER is the only valid type). 'systemLogLevel' => 0, // Integer: Only messages with same or higher severity are logged; 0 is info, 1 is notice, 2 is warning, 3 is error, 4 is fatal error. - 'enableDeprecationLog' => '', // Commalist: Enables the logging of deprecated methods and functions. Default is empty for no logging. The following options are allowed: 'file': The log file will be written to typo3conf/deprecation_[hash-value].log 'devlog': The log file will be written to dev log 'console': The log will be displayed in the Backend's Debug Console. The logging options can be combined by comma-separating them. + 'enableDeprecationLog' => 'file', // Commalist: Enables the logging of deprecated methods and functions. Default is 'file'. The following options are allowed: 'file': The log file will be written to typo3conf/deprecation_[hash-value].log 'devlog': The log will be written to the development log 'console': The log will be displayed in the Backend's Debug Console. The logging options can be combined by comma-separating them. 'maxFileNameLength' => 60, // Integer, This is the maximum file name length. The value will be taken into account by basic file operations like renaming or creation of files and folders. 'UTF8filesystem' => FALSE, // Boolean: If true and [BE][forceCharset] is set to utf-8, then TYPO3 uses utf-8 to store file names. This allows for accented Latin letters as well as any other non-latin characters like Cyrillic and Chinese. 'lockingMode' => 'simple', // String: Define which locking mode is used to control requests to pages being generated. Can be one of either "disable" (no locking), "simple" (checks for file existance), "flock" (using PHPs flock() function), "semaphore" (using PHPs sem_acquire() function). Default is "disable". Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 7928) +++ t3lib/class.t3lib_div.php (working copy) @@ -5756,8 +5756,8 @@ } if (stripos($log, 'file') !== FALSE) { - // write a longer message to the deprecation log - $destination = PATH_typo3conf . '/deprecation_' . self::shortMD5(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) . '.log'; + // write a longer message to the deprecation log + $destination = self::getDeprecationLogFileName(); $file = @fopen($destination, 'a'); if ($file) { flock($file, LOCK_EX); // try locking, but ignore if not available (eg. on NFS and FAT) @@ -5778,6 +5778,20 @@ } /** + * Gets the absolute path to the deprecation log file. + * + * @return string absolute path to the deprecation log file + */ + public static function getDeprecationLogFileName() { + return PATH_typo3conf . + '/deprecation_' . + self::shortMD5( + PATH_site . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] + ) . + '.log'; + } + + /** * Logs a call to a deprecated function. * The log message will be taken from the annotation. * @return void