Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4105614
TimestampType.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
925 B
Referenced Files
None
Subscribers
None
TimestampType.php
View Options
<?php
namespace
Wikimedia\Rdbms
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
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
)
{
if
(
$platform
->
getName
()
==
'mysql'
)
{
// "infinite" (in expiry values has to be VARBINARY)
if
(
isset
(
$fieldDeclaration
[
'allowInfinite'
]
)
&&
$fieldDeclaration
[
'allowInfinite'
]
)
{
return
'VARBINARY(14)'
;
}
return
'BINARY(14)'
;
}
if
(
$platform
->
getName
()
==
'sqlite'
)
{
return
'BLOB'
;
}
if
(
$platform
->
getName
()
==
'postgresql'
)
{
return
'TIMESTAMPTZ'
;
}
return
$platform
->
getDateTimeTzTypeDeclarationSQL
(
$fieldDeclaration
);
}
public
function
getName
()
{
return
self
::
TIMESTAMP
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 19:04 (2 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1f/1d/1da88687e0d97954eccd5e74ac48
Default Alt Text
TimestampType.php (925 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment