Project

General

Profile

Bug #22613 ยป 14339.diff

Administrator Admin, 2010-05-09 14:07

View differences:

t3lib/class.t3lib_div.php (working copy)
if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) {
return;
}
$log = $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'];
$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';
$file = @fopen($destination, 'a');
if ($file) {
$date = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ': ');
flock($file, LOCK_EX); // try locking, but ignore if not available (eg. on NFS and FAT)
@fwrite($file, $date.$msg.LF);
flock($file, LOCK_UN); // release the lock
@fclose($file);
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';
$file = @fopen($destination, 'a');
if ($file) {
flock($file, LOCK_EX); // try locking, but ignore if not available (eg. on NFS and FAT)
@fwrite($file, $date.$msg.LF);
flock($file, LOCK_UN); // release the lock
@fclose($file);
}
}
// copy message also to the developer log
self::devLog($msg, 'Core', self::SYSLOG_SEVERITY_WARNING);
if (stripos($log, 'log') !== FALSE) {
// copy message also to the developer log
self::devLog($msg, 'Core', self::SYSLOG_SEVERITY_WARNING);
}
if (stripos($log, 'console') !== FALSE) {
$script = '
var TYPO3ViewportInstance = null, deprecationLogTab;
var errorMsg = "' . addslashes($date . $msg) . '<br />";
if (top && top.TYPO3 && typeof top.TYPO3.Backend === "object") {
TYPO3ViewportInstance = top.TYPO3.Backend;
deprecationLogTab = top.Ext.getCmp("deprecationLog");
} else if (TYPO3 && typeof TYPO3.Backend === "object") {
TYPO3ViewportInstance = TYPO3.Backend;
deprecationLogTab = Ext.getCmp("deprecationLog");
}
if (TYPO3ViewportInstance !== null) {
if (TYPO3ViewportInstance.DebugConsole.hidden) {
TYPO3ViewportInstance.DebugConsole.show();
} else if (TYPO3ViewportInstance.DebugConsole.collapsed) {
TYPO3ViewportInstance.DebugConsole.expand();
}
if (deprecationLogTab) {
deprecationLogTab.update(errorMsg + deprecationLogTab.body.dom.innerHTML);
} else {
deprecationLogTab = TYPO3ViewportInstance.DebugConsole.add({
title: "Deprecation Log",
id: "deprecationLog",
bodyCfg: {style:"background-color:#fff;padding: 3px 10px;"},
html: errorMsg,
border: false,
closable: true,
autoScroll: true,
listeners: {
close: function(tab) {
if (tab.ownerCt.items.getCount() === 1) {
tab.ownerCt.hide();
}
}
}
});
}
TYPO3ViewportInstance.DebugConsole.setActiveTab(deprecationLogTab);
TYPO3ViewportInstance.doLayout();
}
';
echo self::wrapJS($script);
}
}
/**
t3lib/config_default.php (working copy)
'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,<abs-path-to-file>[,<level>];mail,<to>[/<from>][,<level>];syslog,<facility>,[,<level>];error_log[,,<level>]. "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' => TRUE, // Boolean: Enables the logging of deprecated methods and functions. The log file will be written to typo3conf/deprecation_[hash-value].log
'enableDeprecationLog' => 0, // Commalist: Enables the logging of deprecated methods and functions. Default is empty for no log, these strings are allowed: 'file': The log file will be written to typo3conf/deprecation_[hash-value].log 'log': The log file will be written to dev log 'console': The log will be displayed in Debug Console
'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".
    (1-1/1)