Skip to content

Commit 566e652

Browse files
committed
php 8.1 compat
1 parent 93b959d commit 566e652

File tree

1 file changed

+2
-81
lines changed

1 file changed

+2
-81
lines changed

lib/log/sfFileLogger.class.php

Lines changed: 2 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -22,86 +22,7 @@ class sfFileLogger extends sfLogger
2222
$type = 'symfony',
2323
$format = '%time% %type% [%priority%] %message%%EOL%',
2424
$timeFormat = '%b %d %H:%M:%S',
25-
$fp = null,
26-
$formatMap = array(
27-
// abbreviated weekday name
28-
'%a' => 'D',
29-
// full weekday name
30-
'%A' => 'l',
31-
// abbreviated month name
32-
'%b' => 'M',
33-
// full month name
34-
'%B' => 'F',
35-
// preferred date and time representation
36-
// FIXME: How to get the preferred intl format?
37-
'%c' => 'Y-m-d H:i:s',
38-
// century number (the year divided by 100, range 00 to 99)
39-
// FIXME: format() does not support century.
40-
'%C' => '',
41-
// day of the month (01 to 31)
42-
'%d' => 'd',
43-
// same as %m/%d/%y
44-
'%D' => 'm/d/y',
45-
// day of the month (1 to 31)
46-
'%e' => 'j',
47-
// like %G, but without the century
48-
// FIXME: format() does not support the ISO week number without century.
49-
'%g' => '',
50-
// 4-digit year corresponding to the ISO week number (see %V).
51-
'%G' => 'o',
52-
// same as %b
53-
'%h' => 'M',
54-
// hour, using a 24-hour clock (00 to 23)
55-
'%H' => 'H',
56-
// hour, using a 12-hour clock (01 to 12)
57-
'%I' => 'h',
58-
// day of the year (001 to 366)
59-
// FIXME: format() starts at 0
60-
'%j' => 'z',
61-
// month (01 to 12)
62-
'%m' => 'm',
63-
// minute
64-
'%M' => 'i',
65-
// newline character
66-
'%n' => PHP_EOL,
67-
// either am or pm according to the given time value
68-
'%p' => 'a',
69-
// time in a.m. and p.m. notation
70-
'%r' => 'h:i:s A',
71-
// time in 24 hour notation
72-
'%R' => 'H:i:s',
73-
// second
74-
'%S' => 's',
75-
// tab character
76-
'%t' => "\t",
77-
// current time, equal to %H:%M:%S
78-
'%T' => '%H:i:s',
79-
// weekday as a number (1 to 7), Monday=1. Warning: In Sun Solaris Sunday=1
80-
'%u' => 'N',
81-
// week number of the current year, starting with the first Sunday as the first day of the first week
82-
// FIXME: format() does not support the week number starting on sunday.
83-
'%U' => '',
84-
// The ISO 8601 week number of the current year (01 to 53), where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week
85-
// FIXME: same as %W?
86-
'%V' => 'W',
87-
// week number of the current year, starting with the first Monday as the first day of the first week
88-
'%W' => 'W',
89-
// day of the week as a decimal, Sunday=0
90-
'%w' => 'w',
91-
// preferred date representation without the time
92-
'%x' => 'Y-m-d',
93-
// preferred time representation without the date
94-
'%X' => 'H:i:s',
95-
// year without a century (range 00 to 99)
96-
'%y' => 'y',
97-
// year including the century
98-
'%Y' => 'Y',
99-
// time zone or name or abbreviation
100-
'%Z' => 'Z',
101-
'%z' => 'Z',
102-
// a literal % character
103-
'%%' => '%',
104-
);
25+
$fp = null;
10526

10627
/**
10728
* Initializes this logger.
@@ -179,7 +100,7 @@ protected function doLog($message, $priority)
179100
fwrite($this->fp, strtr($this->format, array(
180101
'%type%' => $this->type,
181102
'%message%' => $message,
182-
'%time%' => date($this->convertStrftimeToDateFormat($this->timeFormat)),
103+
'%time%' => strftime($this->timeFormat),
183104
'%priority%' => $this->getPriority($priority),
184105
'%EOL%' => PHP_EOL,
185106
)));

0 commit comments

Comments
 (0)