Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6006445
TimestampType.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
TimestampType.php
View Options
<?php
namespace
Wikimedia\Rdbms
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\DBAL\Platforms\MySQLPlatform
;
use
Doctrine\DBAL\Platforms\PostgreSQLPlatform
;
use
Doctrine\DBAL\Platforms\SQLitePlatform
;
use
Doctrine\DBAL\Types\Type
;
/**
* Handling timestamp edge cases in mediawiki.
* https://www.mediawiki.org/wiki/Manual:Timestamp
*/
class
TimestampType
extends
Type
{
public
const
TIMESTAMP
=
'mwtimestamp'
;
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
):
string
{
if
(
$platform
instanceof
MySQLPlatform
)
{
// "infinite" (in expiry values has to be VARBINARY)
if
(
isset
(
$fieldDeclaration
[
'allowInfinite'
]
)
&&
$fieldDeclaration
[
'allowInfinite'
]
)
{
return
'VARBINARY(14)'
;
}
return
'BINARY(14)'
;
}
if
(
$platform
instanceof
SQLitePlatform
)
{
return
'BLOB'
;
}
if
(
$platform
instanceof
PostgreSQLPlatform
)
{
return
'TIMESTAMPTZ'
;
}
return
$platform
->
getDateTimeTzTypeDeclarationSQL
(
$fieldDeclaration
);
}
public
function
getName
():
string
{
return
self
::
TIMESTAMP
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 08:20 (8 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fc/f7/fdf311ca184f8c8f41932b08c393
Default Alt Text
TimestampType.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment