Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2753831
SqliteCreateSearchIndexTask.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
SqliteCreateSearchIndexTask.php
View Options
<?php
namespace
MediaWiki\Installer\Task
;
use
MediaWiki\Status\Status
;
use
Wikimedia\Rdbms\DatabaseSqlite
;
/**
* Create the SQLite search index
*
* @internal For use by the installer
*/
class
SqliteCreateSearchIndexTask
extends
Task
{
public
function
getName
()
{
return
'search'
;
}
/** @inheritDoc */
public
function
getDependencies
()
{
return
[
'tables'
];
}
public
function
execute
():
Status
{
$status
=
Status
::
newGood
();
$db
=
$this
->
definitelyGetConnection
(
ITaskContext
::
CONN_CREATE_TABLES
);
$module
=
DatabaseSqlite
::
getFulltextSearchModule
();
$searchIndexSql
=
(
string
)
$db
->
newSelectQueryBuilder
()
->
select
(
'sql'
)
->
from
(
'sqlite_master'
)
->
where
(
[
'tbl_name'
=>
$db
->
tableName
(
'searchindex'
,
'raw'
)
]
)
->
caller
(
__METHOD__
)->
fetchField
();
$fts3tTable
=
(
stristr
(
$searchIndexSql
,
'fts'
)
!==
false
);
if
(
$fts3tTable
&&
!
$module
)
{
$status
->
warning
(
'config-sqlite-fts3-downgrade'
);
$status
->
merge
(
$this
->
applySourceFile
(
$db
,
'searchindex-no-fts.sql'
)
);
}
elseif
(
!
$fts3tTable
&&
$module
==
'FTS3'
)
{
$status
->
merge
(
$this
->
applySourceFile
(
$db
,
'searchindex-fts3.sql'
)
);
}
return
$status
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 3, 21:47 (14 h, 9 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4c/5e/bbdd8a182d348ffcdd1a972c4eb3
Default Alt Text
SqliteCreateSearchIndexTask.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment