Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6084549
PostgresPlTask.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
895 B
Referenced Files
None
Subscribers
None
PostgresPlTask.php
View Options
<?php
namespace
MediaWiki\Installer\Task
;
use
MediaWiki\MainConfigNames
;
use
MediaWiki\Status\Status
;
use
Wikimedia\Rdbms\DBQueryError
;
/**
* Enable PL/pgSQL in the wiki's database if necessary
*
* @internal For use by the installer
*/
class
PostgresPlTask
extends
Task
{
public
function
getName
()
{
return
'pg-plpgsql'
;
}
public
function
execute
():
Status
{
// Connect as the install user, since it owns the database and so is
// the user that needs to run "CREATE EXTENSION"
$status
=
$this
->
getConnection
(
ITaskContext
::
CONN_CREATE_SCHEMA
);
if
(
!
$status
->
isOK
()
)
{
return
$status
;
}
$conn
=
$status
->
getDB
();
try
{
$conn
->
query
(
'CREATE EXTENSION IF NOT EXISTS plpgsql'
,
__METHOD__
);
}
catch
(
DBQueryError
$e
)
{
return
Status
::
newFatal
(
'config-pg-no-plpgsql'
,
$this
->
getConfigVar
(
MainConfigNames
::
DBname
)
);
}
return
Status
::
newGood
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 5 2026, 13:08 (6 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d9/01/eb22e994395bc19a6b7ba722a8f9
Default Alt Text
PostgresPlTask.php (895 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment