16 $t = gmmktime( 12, 34, 56, 1, 15, 2001 );
20 [
$t,
TS_MW,
'20010115123456',
'TS_UNIX to TS_MW' ],
21 [ -30281104,
TS_MW,
'19690115123456',
'Negative TS_UNIX to TS_MW' ],
22 [
$t,
TS_UNIX, 979562096,
'TS_UNIX to TS_UNIX' ],
23 [
$t,
TS_DB,
'2001-01-15 12:34:56',
'TS_UNIX to TS_DB' ],
24 [
$t + .01,
TS_MW,
'20010115123456',
'TS_UNIX float to TS_MW' ],
29 [
'20010115123456',
TS_MW,
'20010115123456',
'TS_MW to TS_MW' ],
30 [
'20010115123456',
TS_UNIX, 979562096,
'TS_MW to TS_UNIX' ],
31 [
'20010115123456',
TS_DB,
'2001-01-15 12:34:56',
'TS_MW to TS_DB' ],
32 [
'20010115123456',
TS_ISO_8601_BASIC,
'20010115T123456Z',
'TS_MW to TS_ISO_8601_BASIC' ],
35 [
'2001-01-15 12:34:56',
TS_MW,
'20010115123456',
'TS_DB to TS_MW' ],
36 [
'2001-01-15 12:34:56',
TS_UNIX, 979562096,
'TS_DB to TS_UNIX' ],
37 [
'2001-01-15 12:34:56',
TS_DB,
'2001-01-15 12:34:56',
'TS_DB to TS_DB' ],
39 '2001-01-15 12:34:56',
42 'TS_DB to TS_ISO_8601_BASIC'
46 [
'20010115123456',
TS_RFC2822,
'Mon, 15 Jan 2001 12:34:56 GMT',
'TS_MW to TS_RFC2822' ],
47 [
'Mon, 15 Jan 2001 12:34:56 GMT',
TS_MW,
'20010115123456',
'TS_RFC2822 to TS_MW' ],
49 ' Mon, 15 Jan 2001 12:34:56 GMT',
52 'TS_RFC2822 with leading space to TS_MW'
55 '15 Jan 2001 12:34:56 GMT',
58 'TS_RFC2822 without optional day-of-week to TS_MW'
61 # FWS = ([*WSP CRLF] 1*WSP) / obs-FWS ; Folding white space
62 # obs-FWS = 1*WSP *(CRLF 1*WSP) ; Section 4.2
63 [
'Mon, 15 Jan 2001 12:34:56 GMT',
TS_MW,
'20010115123456',
'TS_RFC2822 to TS_MW' ],
65 # WSP = SP / HTAB ; rfc2234
67 "Mon, 15 Jan\x092001 12:34:56 GMT",
70 'TS_RFC2822 with HTAB to TS_MW'
73 "Mon, 15 Jan\x09 \x09 2001 12:34:56 GMT",
76 'TS_RFC2822 with HTAB and SP to TS_MW'
79 'Sun, 6 Nov 94 08:49:37 GMT',
82 'TS_RFC2822 with obsolete year to TS_MW'
95 if ( substr(
$output, 0, 1 ) ===
'/' ) {
109 'Fri, 13 Dec 1901 20:45:54 GMT',
110 'Earliest time according to PHP documentation'
112 [
'20380119031407',
TS_RFC2822,
'Tue, 19 Jan 2038 03:14:07 GMT',
'Latest 32 bit time' ],
113 [
'19011213204552',
TS_UNIX,
'-2147483648',
'Earliest 32 bit unix time' ],
114 [
'20380119031407',
TS_UNIX,
'2147483647',
'Latest 32 bit unix time' ],
115 [
'19011213204552',
TS_RFC2822,
'Fri, 13 Dec 1901 20:45:52 GMT',
'Earliest 32 bit time' ],
119 'Fri, 13 Dec 1901 20:45:51 GMT',
'Earliest 32 bit time - 1'
121 [
'20380119031408',
TS_RFC2822,
'Tue, 19 Jan 2038 03:14:08 GMT',
'Latest 32 bit time + 1' ],
122 [
'19011212000000',
TS_MW,
'19011212000000',
'Convert to itself r74778#c10645' ],
123 [
'19011213204551',
TS_UNIX,
'-2147483649',
'Earliest 32 bit unix time - 1' ],
124 [
'20380119031408',
TS_UNIX,
'2147483648',
'Latest 32 bit unix time + 1' ],
125 [
'-2147483649',
TS_MW,
'19011213204551',
'1901 negative unix time to MediaWiki' ],
126 [
'-5331871504',
TS_MW,
'18010115123456',
'1801 negative unix time to MediaWiki' ],
128 '0117-08-09 12:34:56',
130 '/, 09 Aug 0117 12:34:56 GMT$/',
131 'Death of Roman Emperor [[Trajan]]'
135 [
'-58979923200',
TS_RFC2822,
'/, 01 Jan 0101 00:00:00 GMT$/',
'1/1/101' ],
136 [
'-62135596800',
TS_RFC2822,
'Mon, 01 Jan 0001 00:00:00 GMT',
'Year 1' ],
145 'Wed, 18 Oct 0000 00:00:00 GMT',
146 'ISO 8601:2004 [[year 0]], also called [[1 BC]]'
161 [
'Sun, 06 Nov 1994 08:49:37 GMT',
'19941106084937',
'RFC 822 date' ],
162 [
'Sunday, 06-Nov-94 08:49:37 GMT',
'19941106084937',
'RFC 850 date' ],
163 [
'Sun Nov 6 08:49:37 1994',
'19941106084937',
"ANSI C's asctime() format" ],
166 'Mon, 22 Nov 2010 14:12:42 GMT; length=52626',
168 'Netscape extension to HTTP/1.0'
183 $this->assertNotEquals(
false, $zero );
184 $this->assertLessThan( 5, $zero - $now );
187 $this->assertNotEquals(
false, $empty );
188 $this->assertLessThan( 5, $empty - $now );
191 $this->assertNotEquals(
false, $null );
192 $this->assertLessThan( 5, $null - $now );
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
GlobalFunctions wfTimestamp.
static provideOldTimestamps()
testNormalTimestamps( $input, $format, $output, $desc)
provideNormalTimestamps
static provideHttpDates()
testHttpDate( $input, $output, $desc)
static provideNormalTimestamps()
testOldTimestamps( $input, $outputType, $output, $message)
This test checks wfTimestamp() with values outside.
testTimestampParameter()
There are a number of assumptions in our codebase where wfTimestamp() should give the current date bu...
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object & $output
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
const TS_DB
MySQL DATETIME (YYYY-MM-DD HH:MM:SS)
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
const TS_RFC2822
RFC 2822 format, for E-mail and HTTP headers.
const TS_ISO_8601_BASIC
ISO 8601 basic format with no timezone: 19860209T200000Z.