MediaWiki  1.23.2
PostgresInstaller.php
Go to the documentation of this file.
1 <?php
31 
32  protected $globalNames = array(
33  'wgDBserver',
34  'wgDBport',
35  'wgDBname',
36  'wgDBuser',
37  'wgDBpassword',
38  'wgDBmwschema',
39  );
40 
41  protected $internalDefaults = array(
42  '_InstallUser' => 'postgres',
43  );
44 
45  public $minimumVersion = '8.3';
46  public $maxRoleSearchDepth = 5;
47 
48  protected $pgConns = array();
49 
50  function getName() {
51  return 'postgres';
52  }
53 
54  public function isCompiled() {
55  return self::checkExtension( 'pgsql' );
56  }
57 
58  function getConnectForm() {
59  return $this->getTextBox(
60  'wgDBserver',
61  'config-db-host',
62  array(),
63  $this->parent->getHelpBox( 'config-db-host-help' )
64  ) .
65  $this->getTextBox( 'wgDBport', 'config-db-port' ) .
66  Html::openElement( 'fieldset' ) .
67  Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
68  $this->getTextBox(
69  'wgDBname',
70  'config-db-name',
71  array(),
72  $this->parent->getHelpBox( 'config-db-name-help' )
73  ) .
74  $this->getTextBox(
75  'wgDBmwschema',
76  'config-db-schema',
77  array(),
78  $this->parent->getHelpBox( 'config-db-schema-help' )
79  ) .
80  Html::closeElement( 'fieldset' ) .
81  $this->getInstallUserBox();
82  }
83 
84  function submitConnectForm() {
85  // Get variables from the request
86  $newValues = $this->setVarsFromRequest( array(
87  'wgDBserver', 'wgDBport','wgDBname', 'wgDBmwschema',
88  '_InstallUser', '_InstallPassword'
89  ) );
90 
91  // Validate them
92  $status = Status::newGood();
93  if ( !strlen( $newValues['wgDBname'] ) ) {
94  $status->fatal( 'config-missing-db-name' );
95  } elseif ( !preg_match( '/^[a-zA-Z0-9_]+$/', $newValues['wgDBname'] ) ) {
96  $status->fatal( 'config-invalid-db-name', $newValues['wgDBname'] );
97  }
98  if ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBmwschema'] ) ) {
99  $status->fatal( 'config-invalid-schema', $newValues['wgDBmwschema'] );
100  }
101  if ( !strlen( $newValues['_InstallUser'] ) ) {
102  $status->fatal( 'config-db-username-empty' );
103  }
104  if ( !strlen( $newValues['_InstallPassword'] ) ) {
105  $status->fatal( 'config-db-password-empty', $newValues['_InstallUser'] );
106  }
107 
108  // Submit user box
109  if ( $status->isOK() ) {
110  $status->merge( $this->submitInstallUserBox() );
111  }
112  if ( !$status->isOK() ) {
113  return $status;
114  }
115 
116  $status = $this->getPgConnection( 'create-db' );
117  if ( !$status->isOK() ) {
118  return $status;
119  }
123  $conn = $status->value;
124 
125  // Check version
126  $version = $conn->getServerVersion();
127  if ( version_compare( $version, $this->minimumVersion ) < 0 ) {
128  return Status::newFatal( 'config-postgres-old', $this->minimumVersion, $version );
129  }
130 
131  $this->setVar( 'wgDBuser', $this->getVar( '_InstallUser' ) );
132  $this->setVar( 'wgDBpassword', $this->getVar( '_InstallPassword' ) );
133 
134  return Status::newGood();
135  }
136 
137  public function getConnection() {
138  $status = $this->getPgConnection( 'create-tables' );
139  if ( $status->isOK() ) {
140  $this->db = $status->value;
141  }
142 
143  return $status;
144  }
145 
146  public function openConnection() {
147  return $this->openPgConnection( 'create-tables' );
148  }
149 
157  protected function openConnectionWithParams( $user, $password, $dbName ) {
158  $status = Status::newGood();
159  try {
160  $db = new DatabasePostgres(
161  $this->getVar( 'wgDBserver' ),
162  $user,
163  $password,
164  $dbName
165  );
166  $status->value = $db;
167  } catch ( DBConnectionError $e ) {
168  $status->fatal( 'config-connection-error', $e->getMessage() );
169  }
170 
171  return $status;
172  }
173 
179  protected function getPgConnection( $type ) {
180  if ( isset( $this->pgConns[$type] ) ) {
181  return Status::newGood( $this->pgConns[$type] );
182  }
183  $status = $this->openPgConnection( $type );
184 
185  if ( $status->isOK() ) {
189  $conn = $status->value;
190  $conn->clearFlag( DBO_TRX );
191  $conn->commit( __METHOD__ );
192  $this->pgConns[$type] = $conn;
193  }
194 
195  return $status;
196  }
197 
224  protected function openPgConnection( $type ) {
225  switch ( $type ) {
226  case 'create-db':
227  return $this->openConnectionToAnyDB(
228  $this->getVar( '_InstallUser' ),
229  $this->getVar( '_InstallPassword' ) );
230  case 'create-schema':
231  return $this->openConnectionWithParams(
232  $this->getVar( '_InstallUser' ),
233  $this->getVar( '_InstallPassword' ),
234  $this->getVar( 'wgDBname' ) );
235  case 'create-tables':
236  $status = $this->openPgConnection( 'create-schema' );
237  if ( $status->isOK() ) {
241  $conn = $status->value;
242  $safeRole = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) );
243  $conn->query( "SET ROLE $safeRole" );
244  }
245 
246  return $status;
247  default:
248  throw new MWException( "Invalid special connection type: \"$type\"" );
249  }
250  }
251 
252  public function openConnectionToAnyDB( $user, $password ) {
253  $dbs = array(
254  'template1',
255  'postgres',
256  );
257  if ( !in_array( $this->getVar( 'wgDBname' ), $dbs ) ) {
258  array_unshift( $dbs, $this->getVar( 'wgDBname' ) );
259  }
260  $conn = false;
261  $status = Status::newGood();
262  foreach ( $dbs as $db ) {
263  try {
264  $conn = new DatabasePostgres(
265  $this->getVar( 'wgDBserver' ),
266  $user,
267  $password,
268  $db );
269  } catch ( DBConnectionError $error ) {
270  $conn = false;
271  $status->fatal( 'config-pg-test-error', $db,
272  $error->getMessage() );
273  }
274  if ( $conn !== false ) {
275  break;
276  }
277  }
278  if ( $conn !== false ) {
279  return Status::newGood( $conn );
280  } else {
281  return $status;
282  }
283  }
284 
285  protected function getInstallUserPermissions() {
286  $status = $this->getPgConnection( 'create-db' );
287  if ( !$status->isOK() ) {
288  return false;
289  }
293  $conn = $status->value;
294  $superuser = $this->getVar( '_InstallUser' );
295 
296  $row = $conn->selectRow( '"pg_catalog"."pg_roles"', '*',
297  array( 'rolname' => $superuser ), __METHOD__ );
298 
299  return $row;
300  }
301 
302  protected function canCreateAccounts() {
303  $perms = $this->getInstallUserPermissions();
304  if ( !$perms ) {
305  return false;
306  }
307 
308  return $perms->rolsuper === 't' || $perms->rolcreaterole === 't';
309  }
310 
311  protected function isSuperUser() {
312  $perms = $this->getInstallUserPermissions();
313  if ( !$perms ) {
314  return false;
315  }
316 
317  return $perms->rolsuper === 't';
318  }
319 
320  public function getSettingsForm() {
321  if ( $this->canCreateAccounts() ) {
322  $noCreateMsg = false;
323  } else {
324  $noCreateMsg = 'config-db-web-no-create-privs';
325  }
326  $s = $this->getWebUserBox( $noCreateMsg );
327 
328  return $s;
329  }
330 
331  public function submitSettingsForm() {
332  $status = $this->submitWebUserBox();
333  if ( !$status->isOK() ) {
334  return $status;
335  }
336 
337  $same = $this->getVar( 'wgDBuser' ) === $this->getVar( '_InstallUser' );
338 
339  if ( $same ) {
340  $exists = true;
341  } else {
342  // Check if the web user exists
343  // Connect to the database with the install user
344  $status = $this->getPgConnection( 'create-db' );
345  if ( !$status->isOK() ) {
346  return $status;
347  }
348  $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
349  }
350 
351  // Validate the create checkbox
352  if ( $this->canCreateAccounts() && !$same && !$exists ) {
353  $create = $this->getVar( '_CreateDBAccount' );
354  } else {
355  $this->setVar( '_CreateDBAccount', false );
356  $create = false;
357  }
358 
359  if ( !$create && !$exists ) {
360  if ( $this->canCreateAccounts() ) {
361  $msg = 'config-install-user-missing-create';
362  } else {
363  $msg = 'config-install-user-missing';
364  }
365 
366  return Status::newFatal( $msg, $this->getVar( 'wgDBuser' ) );
367  }
368 
369  if ( !$exists ) {
370  // No more checks to do
371  return Status::newGood();
372  }
373 
374  // Existing web account. Test the connection.
375  $status = $this->openConnectionToAnyDB(
376  $this->getVar( 'wgDBuser' ),
377  $this->getVar( 'wgDBpassword' ) );
378  if ( !$status->isOK() ) {
379  return $status;
380  }
381 
382  // The web user is conventionally the table owner in PostgreSQL
383  // installations. Make sure the install user is able to create
384  // objects on behalf of the web user.
385  if ( $same || $this->canCreateObjectsForWebUser() ) {
386  return Status::newGood();
387  } else {
388  return Status::newFatal( 'config-pg-not-in-role' );
389  }
390  }
391 
397  protected function canCreateObjectsForWebUser() {
398  if ( $this->isSuperUser() ) {
399  return true;
400  }
401 
402  $status = $this->getPgConnection( 'create-db' );
403  if ( !$status->isOK() ) {
404  return false;
405  }
406  $conn = $status->value;
407  $installerId = $conn->selectField( '"pg_catalog"."pg_roles"', 'oid',
408  array( 'rolname' => $this->getVar( '_InstallUser' ) ), __METHOD__ );
409  $webId = $conn->selectField( '"pg_catalog"."pg_roles"', 'oid',
410  array( 'rolname' => $this->getVar( 'wgDBuser' ) ), __METHOD__ );
411 
412  return $this->isRoleMember( $conn, $installerId, $webId, $this->maxRoleSearchDepth );
413  }
414 
423  protected function isRoleMember( $conn, $targetMember, $group, $maxDepth ) {
424  if ( $targetMember === $group ) {
425  // A role is always a member of itself
426  return true;
427  }
428  // Get all members of the given group
429  $res = $conn->select( '"pg_catalog"."pg_auth_members"', array( 'member' ),
430  array( 'roleid' => $group ), __METHOD__ );
431  foreach ( $res as $row ) {
432  if ( $row->member == $targetMember ) {
433  // Found target member
434  return true;
435  }
436  // Recursively search each member of the group to see if the target
437  // is a member of it, up to the given maximum depth.
438  if ( $maxDepth > 0 ) {
439  if ( $this->isRoleMember( $conn, $targetMember, $row->member, $maxDepth - 1 ) ) {
440  // Found member of member
441  return true;
442  }
443  }
444  }
445 
446  return false;
447  }
448 
449  public function preInstall() {
450  $createDbAccount = array(
451  'name' => 'user',
452  'callback' => array( $this, 'setupUser' ),
453  );
454  $commitCB = array(
455  'name' => 'pg-commit',
456  'callback' => array( $this, 'commitChanges' ),
457  );
458  $plpgCB = array(
459  'name' => 'pg-plpgsql',
460  'callback' => array( $this, 'setupPLpgSQL' ),
461  );
462  $schemaCB = array(
463  'name' => 'schema',
464  'callback' => array( $this, 'setupSchema' )
465  );
466 
467  if ( $this->getVar( '_CreateDBAccount' ) ) {
468  $this->parent->addInstallStep( $createDbAccount, 'database' );
469  }
470  $this->parent->addInstallStep( $commitCB, 'interwiki' );
471  $this->parent->addInstallStep( $plpgCB, 'database' );
472  $this->parent->addInstallStep( $schemaCB, 'database' );
473  }
474 
475  function setupDatabase() {
476  $status = $this->getPgConnection( 'create-db' );
477  if ( !$status->isOK() ) {
478  return $status;
479  }
480  $conn = $status->value;
481 
482  $dbName = $this->getVar( 'wgDBname' );
483 
484  $exists = $conn->selectField( '"pg_catalog"."pg_database"', '1',
485  array( 'datname' => $dbName ), __METHOD__ );
486  if ( !$exists ) {
487  $safedb = $conn->addIdentifierQuotes( $dbName );
488  $conn->query( "CREATE DATABASE $safedb", __METHOD__ );
489  }
490 
491  return Status::newGood();
492  }
493 
494  function setupSchema() {
495  // Get a connection to the target database
496  $status = $this->getPgConnection( 'create-schema' );
497  if ( !$status->isOK() ) {
498  return $status;
499  }
500  $conn = $status->value;
501 
502  // Create the schema if necessary
503  $schema = $this->getVar( 'wgDBmwschema' );
504  $safeschema = $conn->addIdentifierQuotes( $schema );
505  $safeuser = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) );
506  if ( !$conn->schemaExists( $schema ) ) {
507  try {
508  $conn->query( "CREATE SCHEMA $safeschema AUTHORIZATION $safeuser" );
509  } catch ( DBQueryError $e ) {
510  return Status::newFatal( 'config-install-pg-schema-failed',
511  $this->getVar( '_InstallUser' ), $schema );
512  }
513  }
514 
515  // Select the new schema in the current connection
516  $conn->determineCoreSchema( $schema );
517 
518  return Status::newGood();
519  }
520 
521  function commitChanges() {
522  $this->db->commit( __METHOD__ );
523 
524  return Status::newGood();
525  }
526 
527  function setupUser() {
528  if ( !$this->getVar( '_CreateDBAccount' ) ) {
529  return Status::newGood();
530  }
531 
532  $status = $this->getPgConnection( 'create-db' );
533  if ( !$status->isOK() ) {
534  return $status;
535  }
536  $conn = $status->value;
537 
538  $safeuser = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) );
539  $safepass = $conn->addQuotes( $this->getVar( 'wgDBpassword' ) );
540 
541  // Check if the user already exists
542  $userExists = $conn->roleExists( $this->getVar( 'wgDBuser' ) );
543  if ( !$userExists ) {
544  // Create the user
545  try {
546  $sql = "CREATE ROLE $safeuser NOCREATEDB LOGIN PASSWORD $safepass";
547 
548  // If the install user is not a superuser, we need to make the install
549  // user a member of the new user's group, so that the install user will
550  // be able to create a schema and other objects on behalf of the new user.
551  if ( !$this->isSuperUser() ) {
552  $sql .= ' ROLE' . $conn->addIdentifierQuotes( $this->getVar( '_InstallUser' ) );
553  }
554 
555  $conn->query( $sql, __METHOD__ );
556  } catch ( DBQueryError $e ) {
557  return Status::newFatal( 'config-install-user-create-failed',
558  $this->getVar( 'wgDBuser' ), $e->getMessage() );
559  }
560  }
561 
562  return Status::newGood();
563  }
564 
565  function getLocalSettings() {
566  $port = $this->getVar( 'wgDBport' );
567  $schema = $this->getVar( 'wgDBmwschema' );
568 
569  return "# Postgres specific settings
570 \$wgDBport = \"{$port}\";
571 \$wgDBmwschema = \"{$schema}\";";
572  }
573 
574  public function preUpgrade() {
575  global $wgDBuser, $wgDBpassword;
576 
577  # Normal user and password are selected after this step, so for now
578  # just copy these two
579  $wgDBuser = $this->getVar( '_InstallUser' );
580  $wgDBpassword = $this->getVar( '_InstallPassword' );
581  }
582 
583  public function createTables() {
584  $schema = $this->getVar( 'wgDBmwschema' );
585 
586  $status = $this->getConnection();
587  if ( !$status->isOK() ) {
588  return $status;
589  }
590 
594  $conn = $status->value;
595 
596  if ( $conn->tableExists( 'archive' ) ) {
597  $status->warning( 'config-install-tables-exist' );
598  $this->enableLB();
599 
600  return $status;
601  }
602 
603  $conn->begin( __METHOD__ );
604 
605  if ( !$conn->schemaExists( $schema ) ) {
606  $status->fatal( 'config-install-pg-schema-not-exist' );
607 
608  return $status;
609  }
610  $error = $conn->sourceFile( $conn->getSchemaPath() );
611  if ( $error !== true ) {
612  $conn->reportQueryError( $error, 0, '', __METHOD__ );
613  $conn->rollback( __METHOD__ );
614  $status->fatal( 'config-install-tables-failed', $error );
615  } else {
616  $conn->commit( __METHOD__ );
617  }
618  // Resume normal operations
619  if ( $status->isOk() ) {
620  $this->enableLB();
621  }
622 
623  return $status;
624  }
625 
626  public function setupPLpgSQL() {
627  // Connect as the install user, since it owns the database and so is
628  // the user that needs to run "CREATE LANGAUGE"
629  $status = $this->getPgConnection( 'create-schema' );
630  if ( !$status->isOK() ) {
631  return $status;
632  }
636  $conn = $status->value;
637 
638  $exists = $conn->selectField( '"pg_catalog"."pg_language"', 1,
639  array( 'lanname' => 'plpgsql' ), __METHOD__ );
640  if ( $exists ) {
641  // Already exists, nothing to do
642  return Status::newGood();
643  }
644 
645  // plpgsql is not installed, but if we have a pg_pltemplate table, we
646  // should be able to create it
647  $exists = $conn->selectField(
648  array( '"pg_catalog"."pg_class"', '"pg_catalog"."pg_namespace"' ),
649  1,
650  array(
651  'pg_namespace.oid=relnamespace',
652  'nspname' => 'pg_catalog',
653  'relname' => 'pg_pltemplate',
654  ),
655  __METHOD__ );
656  if ( $exists ) {
657  try {
658  $conn->query( 'CREATE LANGUAGE plpgsql' );
659  } catch ( DBQueryError $e ) {
660  return Status::newFatal( 'config-pg-no-plpgsql', $this->getVar( 'wgDBname' ) );
661  }
662  } else {
663  return Status::newFatal( 'config-pg-no-plpgsql', $this->getVar( 'wgDBname' ) );
664  }
665 
666  return Status::newGood();
667  }
668 }
PostgresInstaller\isSuperUser
isSuperUser()
Definition: PostgresInstaller.php:311
PostgresInstaller\setupPLpgSQL
setupPLpgSQL()
Definition: PostgresInstaller.php:626
PostgresInstaller\$minimumVersion
$minimumVersion
Definition: PostgresInstaller.php:45
PostgresInstaller\preInstall
preInstall()
Allow DB installers a chance to make last-minute changes before installation occurs.
Definition: PostgresInstaller.php:449
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
DatabaseInstaller\checkExtension
static checkExtension( $name)
Convenience function.
Definition: DatabaseInstaller.php:326
PostgresInstaller\isCompiled
isCompiled()
Definition: PostgresInstaller.php:54
text
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition: design.txt:12
PostgresInstaller\openConnectionToAnyDB
openConnectionToAnyDB( $user, $password)
Definition: PostgresInstaller.php:252
PostgresInstaller\submitSettingsForm
submitSettingsForm()
Set variables based on the request array, assuming it was submitted via the form return by getSetting...
Definition: PostgresInstaller.php:331
Status\newGood
static newGood( $value=null)
Factory function for good results.
Definition: Status.php:77
PostgresInstaller\$globalNames
$globalNames
Definition: PostgresInstaller.php:32
$s
$s
Definition: mergeMessageFileList.php:156
PostgresInstaller\preUpgrade
preUpgrade()
Allow DB installers a chance to make checks before upgrade.
Definition: PostgresInstaller.php:574
DatabasePostgres
Definition: DatabasePostgres.php:268
PostgresInstaller\isRoleMember
isRoleMember( $conn, $targetMember, $group, $maxDepth)
Recursive helper for canCreateObjectsForWebUser().
Definition: PostgresInstaller.php:423
DatabaseInstaller\getTextBox
getTextBox( $var, $label, $attribs=array(), $helpData="")
Get a labelled text box to configure a local variable.
Definition: DatabaseInstaller.php:393
PostgresInstaller\commitChanges
commitChanges()
Definition: PostgresInstaller.php:521
PostgresInstaller\$pgConns
$pgConns
Definition: PostgresInstaller.php:48
PostgresInstaller\$internalDefaults
$internalDefaults
Definition: PostgresInstaller.php:41
Html\closeElement
static closeElement( $element)
Returns "</$element>", except if $wgWellFormedXml is off, in which case it returns the empty string w...
Definition: Html.php:235
Html\openElement
static openElement( $element, $attribs=array())
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:166
PostgresInstaller\openConnectionWithParams
openConnectionWithParams( $user, $password, $dbName)
Open a PG connection with given parameters.
Definition: PostgresInstaller.php:157
PostgresInstaller\createTables
createTables()
Create database tables from scratch.
Definition: PostgresInstaller.php:583
MWException
MediaWiki exception.
Definition: MWException.php:26
DBQueryError
Definition: DatabaseError.php:306
Html\element
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:148
DatabaseInstaller\submitWebUserBox
submitWebUserBox()
Submit the form from getWebUserBox().
Definition: DatabaseInstaller.php:582
PostgresInstaller\getInstallUserPermissions
getInstallUserPermissions()
Definition: PostgresInstaller.php:285
wfMessage
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
PostgresInstaller\openPgConnection
openPgConnection( $type)
Get a connection of a specific PostgreSQL-specific type.
Definition: PostgresInstaller.php:224
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
DBConnectionError
Definition: DatabaseError.php:98
DatabaseInstaller\getWebUserBox
getWebUserBox( $noCreateMsg=false)
Get a standard web-user fieldset.
Definition: DatabaseInstaller.php:555
PostgresInstaller\setupUser
setupUser()
Definition: PostgresInstaller.php:527
PostgresInstaller\getPgConnection
getPgConnection( $type)
Get a special type of connection.
Definition: PostgresInstaller.php:179
PostgresInstaller\submitConnectForm
submitConnectForm()
Set variables based on the request array, assuming it was submitted via the form returned by getConne...
Definition: PostgresInstaller.php:84
DatabaseInstaller\$db
DatabaseBase $db
The database connection.
Definition: DatabaseInstaller.php:44
PostgresInstaller\canCreateAccounts
canCreateAccounts()
Definition: PostgresInstaller.php:302
PostgresInstaller\getConnection
getConnection()
Connect to the database using the administrative user/password currently defined in the session.
Definition: PostgresInstaller.php:137
DatabaseInstaller\getVar
getVar( $var, $default=null)
Get a variable, taking local defaults into account.
Definition: DatabaseInstaller.php:363
PostgresInstaller\getLocalSettings
getLocalSettings()
Get the DBMS-specific options for LocalSettings.php generation.
Definition: PostgresInstaller.php:565
DatabaseInstaller\submitInstallUserBox
submitInstallUserBox()
Submit a standard install user fieldset.
Definition: DatabaseInstaller.php:542
$version
$version
Definition: parserTests.php:86
DatabaseInstaller
Base class for DBMS-specific installation helper classes.
Definition: DatabaseInstaller.php:30
PostgresInstaller\$maxRoleSearchDepth
$maxRoleSearchDepth
Definition: PostgresInstaller.php:46
PostgresInstaller\setupDatabase
setupDatabase()
Create the database and return a Status object indicating success or failure.
Definition: PostgresInstaller.php:475
PostgresInstaller\setupSchema
setupSchema()
Definition: PostgresInstaller.php:494
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
$password
return false to override stock group addition can be modified try getUserPermissionsErrors userCan checks are continued by internal code can override on output return false to not delete it return false to override the default password checks this Boolean value will be checked to determine if the password was valid return false to implement your own hashing method & $password
Definition: hooks.txt:2697
PostgresInstaller\canCreateObjectsForWebUser
canCreateObjectsForWebUser()
Returns true if the install user is able to create objects owned by the web user, false otherwise.
Definition: PostgresInstaller.php:397
PostgresInstaller\openConnection
openConnection()
Open a connection to the database using the administrative user/password currently defined in the ses...
Definition: PostgresInstaller.php:146
DatabaseInstaller\enableLB
enableLB()
Set up LBFactory so that wfGetDB() etc.
Definition: DatabaseInstaller.php:254
PostgresInstaller\getSettingsForm
getSettingsForm()
Get HTML for a web form that retrieves settings used for installation.
Definition: PostgresInstaller.php:320
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
DatabaseInstaller\setVar
setVar( $name, $value)
Convenience alias for $this->parent->setVar()
Definition: DatabaseInstaller.php:380
DatabaseInstaller\getInstallUserBox
getInstallUserBox()
Get a standard install-user fieldset.
Definition: DatabaseInstaller.php:520
DatabaseInstaller\setVarsFromRequest
setVarsFromRequest( $varNames)
Convenience function to set variables based on form data.
Definition: DatabaseInstaller.php:487
$error
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string as detected by MediaWiki Handlers will typically only apply for specific mime types object & $error
Definition: hooks.txt:2573
PostgresInstaller
Class for setting up the MediaWiki database using Postgres.
Definition: PostgresInstaller.php:30
$e
if( $useReadline) $e
Definition: eval.php:66
$res
$res
Definition: database.txt:21
PostgresInstaller\getConnectForm
getConnectForm()
Get HTML for a web form that configures this database.
Definition: PostgresInstaller.php:58
DBO_TRX
const DBO_TRX
Definition: Defines.php:42
PostgresInstaller\getName
getName()
Return the internal name, e.g.
Definition: PostgresInstaller.php:50
Status\newFatal
static newFatal( $message)
Factory function for fatal errors.
Definition: Status.php:63
$type
$type
Definition: testCompression.php:46