Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7425578
Comparator.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
Comparator.php
View Options
<?php
namespace
Doctrine\DBAL\Platforms\SQLite
;
use
Doctrine\DBAL\Platforms\SqlitePlatform
;
use
Doctrine\DBAL\Schema\Comparator
as
BaseComparator
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
function
strcasecmp
;
/**
* Compares schemas in the context of SQLite platform.
*
* BINARY is the default column collation and should be ignored if specified explicitly.
*/
class
Comparator
extends
BaseComparator
{
/** @internal The comparator can be only instantiated by a schema manager. */
public
function
__construct
(
SqlitePlatform
$platform
)
{
parent
::
__construct
(
$platform
);
}
public
function
compareTables
(
Table
$fromTable
,
Table
$toTable
):
TableDiff
{
return
parent
::
compareTables
(
$this
->
normalizeColumns
(
$fromTable
),
$this
->
normalizeColumns
(
$toTable
),
);
}
/**
* {@inheritDoc}
*/
public
function
diffTable
(
Table
$fromTable
,
Table
$toTable
)
{
return
parent
::
diffTable
(
$this
->
normalizeColumns
(
$fromTable
),
$this
->
normalizeColumns
(
$toTable
),
);
}
private
function
normalizeColumns
(
Table
$table
):
Table
{
$table
=
clone
$table
;
foreach
(
$table
->
getColumns
()
as
$column
)
{
$options
=
$column
->
getPlatformOptions
();
if
(!
isset
(
$options
[
'collation'
])
||
strcasecmp
(
$options
[
'collation'
],
'binary'
)
!==
0
)
{
continue
;
}
unset
(
$options
[
'collation'
]);
$column
->
setPlatformOptions
(
$options
);
}
return
$table
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 07:59 (19 h, 40 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3e/53/97e73754876cb98e1ff58999793a
Default Alt Text
Comparator.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment