MediaWiki  1.23.15
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 
158  protected function openConnectionWithParams( $user, $password, $dbName, $schema ) {
159  $status = Status::newGood();
160  try {
161  $db = Database::factory( 'postgres', array(
162  'host' => $this->getVar( 'wgDBserver' ),
163  'user' => $user,
164  'password' => $password,
165  'dbname' => $dbName,
166  'schema' => $schema ) );
167  $status->value = $db;
168  } catch ( DBConnectionError $e ) {
169  $status->fatal( 'config-connection-error', $e->getMessage() );
170  }
171 
172  return $status;
173  }
174 
180  protected function getPgConnection( $type ) {
181  if ( isset( $this->pgConns[$type] ) ) {
182  return Status::newGood( $this->pgConns[$type] );
183  }
184  $status = $this->openPgConnection( $type );
185 
186  if ( $status->isOK() ) {
190  $conn = $status->value;
191  $conn->clearFlag( DBO_TRX );
192  $conn->commit( __METHOD__ );
193  $this->pgConns[$type] = $conn;
194  }
195 
196  return $status;
197  }
198 
225  protected function openPgConnection( $type ) {
226  switch ( $type ) {
227  case 'create-db':
228  return $this->openConnectionToAnyDB(
229  $this->getVar( '_InstallUser' ),
230  $this->getVar( '_InstallPassword' ) );
231  case 'create-schema':
232  return $this->openConnectionWithParams(
233  $this->getVar( '_InstallUser' ),
234  $this->getVar( '_InstallPassword' ),
235  $this->getVar( 'wgDBname' ),
236  $this->getVar( 'wgDBmwschema' ) );
237  case 'create-tables':
238  $status = $this->openPgConnection( 'create-schema' );
239  if ( $status->isOK() ) {
243  $conn = $status->value;
244  $safeRole = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) );
245  $conn->query( "SET ROLE $safeRole" );
246  }
247 
248  return $status;
249  default:
250  throw new MWException( "Invalid special connection type: \"$type\"" );
251  }
252  }
253 
254  public function openConnectionToAnyDB( $user, $password ) {
255  $dbs = array(
256  'template1',
257  'postgres',
258  );
259  if ( !in_array( $this->getVar( 'wgDBname' ), $dbs ) ) {
260  array_unshift( $dbs, $this->getVar( 'wgDBname' ) );
261  }
262  $conn = false;
263  $status = Status::newGood();
264  foreach ( $dbs as $db ) {
265  try {
266  $conn = $this->openConnectionWithParams(
267  $user,
268  $password,
269  $db,
270  $this->getVar( 'wgDBmwschema' ) );
271  } catch ( DBConnectionError $error ) {
272  $conn = false;
273  $status->fatal( 'config-pg-test-error', $db,
274  $error->getMessage() );
275  }
276  if ( $conn !== false ) {
277  break;
278  }
279  }
280  if ( $conn !== false ) {
281  return Status::newGood( $conn );
282  } else {
283  return $status;
284  }
285  }
286 
287  protected function getInstallUserPermissions() {
288  $status = $this->getPgConnection( 'create-db' );
289  if ( !$status->isOK() ) {
290  return false;
291  }
295  $conn = $status->value;
296  $superuser = $this->getVar( '_InstallUser' );
297 
298  $row = $conn->selectRow( '"pg_catalog"."pg_roles"', '*',
299  array( 'rolname' => $superuser ), __METHOD__ );
300 
301  return $row;
302  }
303 
304  protected function canCreateAccounts() {
305  $perms = $this->getInstallUserPermissions();
306  if ( !$perms ) {
307  return false;
308  }
309 
310  return $perms->rolsuper === 't' || $perms->rolcreaterole === 't';
311  }
312 
313  protected function isSuperUser() {
314  $perms = $this->getInstallUserPermissions();
315  if ( !$perms ) {
316  return false;
317  }
318 
319  return $perms->rolsuper === 't';
320  }
321 
322  public function getSettingsForm() {
323  if ( $this->canCreateAccounts() ) {
324  $noCreateMsg = false;
325  } else {
326  $noCreateMsg = 'config-db-web-no-create-privs';
327  }
328  $s = $this->getWebUserBox( $noCreateMsg );
329 
330  return $s;
331  }
332 
333  public function submitSettingsForm() {
334  $status = $this->submitWebUserBox();
335  if ( !$status->isOK() ) {
336  return $status;
337  }
338 
339  $same = $this->getVar( 'wgDBuser' ) === $this->getVar( '_InstallUser' );
340 
341  if ( $same ) {
342  $exists = true;
343  } else {
344  // Check if the web user exists
345  // Connect to the database with the install user
346  $status = $this->getPgConnection( 'create-db' );
347  if ( !$status->isOK() ) {
348  return $status;
349  }
350  $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
351  }
352 
353  // Validate the create checkbox
354  if ( $this->canCreateAccounts() && !$same && !$exists ) {
355  $create = $this->getVar( '_CreateDBAccount' );
356  } else {
357  $this->setVar( '_CreateDBAccount', false );
358  $create = false;
359  }
360 
361  if ( !$create && !$exists ) {
362  if ( $this->canCreateAccounts() ) {
363  $msg = 'config-install-user-missing-create';
364  } else {
365  $msg = 'config-install-user-missing';
366  }
367 
368  return Status::newFatal( $msg, $this->getVar( 'wgDBuser' ) );
369  }
370 
371  if ( !$exists ) {
372  // No more checks to do
373  return Status::newGood();
374  }
375 
376  // Existing web account. Test the connection.
377  $status = $this->openConnectionToAnyDB(
378  $this->getVar( 'wgDBuser' ),
379  $this->getVar( 'wgDBpassword' ) );
380  if ( !$status->isOK() ) {
381  return $status;
382  }
383 
384  // The web user is conventionally the table owner in PostgreSQL
385  // installations. Make sure the install user is able to create
386  // objects on behalf of the web user.
387  if ( $same || $this->canCreateObjectsForWebUser() ) {
388  return Status::newGood();
389  } else {
390  return Status::newFatal( 'config-pg-not-in-role' );
391  }
392  }
393 
399  protected function canCreateObjectsForWebUser() {
400  if ( $this->isSuperUser() ) {
401  return true;
402  }
403 
404  $status = $this->getPgConnection( 'create-db' );
405  if ( !$status->isOK() ) {
406  return false;
407  }
408  $conn = $status->value;
409  $installerId = $conn->selectField( '"pg_catalog"."pg_roles"', 'oid',
410  array( 'rolname' => $this->getVar( '_InstallUser' ) ), __METHOD__ );
411  $webId = $conn->selectField( '"pg_catalog"."pg_roles"', 'oid',
412  array( 'rolname' => $this->getVar( 'wgDBuser' ) ), __METHOD__ );
413 
414  return $this->isRoleMember( $conn, $installerId, $webId, $this->maxRoleSearchDepth );
415  }
416 
425  protected function isRoleMember( $conn, $targetMember, $group, $maxDepth ) {
426  if ( $targetMember === $group ) {
427  // A role is always a member of itself
428  return true;
429  }
430  // Get all members of the given group
431  $res = $conn->select( '"pg_catalog"."pg_auth_members"', array( 'member' ),
432  array( 'roleid' => $group ), __METHOD__ );
433  foreach ( $res as $row ) {
434  if ( $row->member == $targetMember ) {
435  // Found target member
436  return true;
437  }
438  // Recursively search each member of the group to see if the target
439  // is a member of it, up to the given maximum depth.
440  if ( $maxDepth > 0 ) {
441  if ( $this->isRoleMember( $conn, $targetMember, $row->member, $maxDepth - 1 ) ) {
442  // Found member of member
443  return true;
444  }
445  }
446  }
447 
448  return false;
449  }
450 
451  public function preInstall() {
452  $createDbAccount = array(
453  'name' => 'user',
454  'callback' => array( $this, 'setupUser' ),
455  );
456  $commitCB = array(
457  'name' => 'pg-commit',
458  'callback' => array( $this, 'commitChanges' ),
459  );
460  $plpgCB = array(
461  'name' => 'pg-plpgsql',
462  'callback' => array( $this, 'setupPLpgSQL' ),
463  );
464  $schemaCB = array(
465  'name' => 'schema',
466  'callback' => array( $this, 'setupSchema' )
467  );
468 
469  if ( $this->getVar( '_CreateDBAccount' ) ) {
470  $this->parent->addInstallStep( $createDbAccount, 'database' );
471  }
472  $this->parent->addInstallStep( $commitCB, 'interwiki' );
473  $this->parent->addInstallStep( $plpgCB, 'database' );
474  $this->parent->addInstallStep( $schemaCB, 'database' );
475  }
476 
477  function setupDatabase() {
478  $status = $this->getPgConnection( 'create-db' );
479  if ( !$status->isOK() ) {
480  return $status;
481  }
482  $conn = $status->value;
483 
484  $dbName = $this->getVar( 'wgDBname' );
485 
486  $exists = $conn->selectField( '"pg_catalog"."pg_database"', '1',
487  array( 'datname' => $dbName ), __METHOD__ );
488  if ( !$exists ) {
489  $safedb = $conn->addIdentifierQuotes( $dbName );
490  $conn->query( "CREATE DATABASE $safedb", __METHOD__ );
491  }
492 
493  return Status::newGood();
494  }
495 
496  function setupSchema() {
497  // Get a connection to the target database
498  $status = $this->getPgConnection( 'create-schema' );
499  if ( !$status->isOK() ) {
500  return $status;
501  }
502  $conn = $status->value;
503 
504  // Create the schema if necessary
505  $schema = $this->getVar( 'wgDBmwschema' );
506  $safeschema = $conn->addIdentifierQuotes( $schema );
507  $safeuser = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) );
508  if ( !$conn->schemaExists( $schema ) ) {
509  try {
510  $conn->query( "CREATE SCHEMA $safeschema AUTHORIZATION $safeuser" );
511  } catch ( DBQueryError $e ) {
512  return Status::newFatal( 'config-install-pg-schema-failed',
513  $this->getVar( '_InstallUser' ), $schema );
514  }
515  }
516 
517  // Select the new schema in the current connection
518  $conn->determineCoreSchema( $schema );
519 
520  return Status::newGood();
521  }
522 
523  function commitChanges() {
524  $this->db->commit( __METHOD__ );
525 
526  return Status::newGood();
527  }
528 
529  function setupUser() {
530  if ( !$this->getVar( '_CreateDBAccount' ) ) {
531  return Status::newGood();
532  }
533 
534  $status = $this->getPgConnection( 'create-db' );
535  if ( !$status->isOK() ) {
536  return $status;
537  }
538  $conn = $status->value;
539 
540  $safeuser = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) );
541  $safepass = $conn->addQuotes( $this->getVar( 'wgDBpassword' ) );
542 
543  // Check if the user already exists
544  $userExists = $conn->roleExists( $this->getVar( 'wgDBuser' ) );
545  if ( !$userExists ) {
546  // Create the user
547  try {
548  $sql = "CREATE ROLE $safeuser NOCREATEDB LOGIN PASSWORD $safepass";
549 
550  // If the install user is not a superuser, we need to make the install
551  // user a member of the new user's group, so that the install user will
552  // be able to create a schema and other objects on behalf of the new user.
553  if ( !$this->isSuperUser() ) {
554  $sql .= ' ROLE' . $conn->addIdentifierQuotes( $this->getVar( '_InstallUser' ) );
555  }
556 
557  $conn->query( $sql, __METHOD__ );
558  } catch ( DBQueryError $e ) {
559  return Status::newFatal( 'config-install-user-create-failed',
560  $this->getVar( 'wgDBuser' ), $e->getMessage() );
561  }
562  }
563 
564  return Status::newGood();
565  }
566 
567  function getLocalSettings() {
568  $port = $this->getVar( 'wgDBport' );
569  $schema = $this->getVar( 'wgDBmwschema' );
570 
571  return "# Postgres specific settings
572 \$wgDBport = \"{$port}\";
573 \$wgDBmwschema = \"{$schema}\";";
574  }
575 
576  public function preUpgrade() {
577  global $wgDBuser, $wgDBpassword;
578 
579  # Normal user and password are selected after this step, so for now
580  # just copy these two
581  $wgDBuser = $this->getVar( '_InstallUser' );
582  $wgDBpassword = $this->getVar( '_InstallPassword' );
583  }
584 
585  public function createTables() {
586  $schema = $this->getVar( 'wgDBmwschema' );
587 
588  $status = $this->getConnection();
589  if ( !$status->isOK() ) {
590  return $status;
591  }
592 
596  $conn = $status->value;
597 
598  if ( $conn->tableExists( 'archive' ) ) {
599  $status->warning( 'config-install-tables-exist' );
600  $this->enableLB();
601 
602  return $status;
603  }
604 
605  $conn->begin( __METHOD__ );
606 
607  if ( !$conn->schemaExists( $schema ) ) {
608  $status->fatal( 'config-install-pg-schema-not-exist' );
609 
610  return $status;
611  }
612  $error = $conn->sourceFile( $conn->getSchemaPath() );
613  if ( $error !== true ) {
614  $conn->reportQueryError( $error, 0, '', __METHOD__ );
615  $conn->rollback( __METHOD__ );
616  $status->fatal( 'config-install-tables-failed', $error );
617  } else {
618  $conn->commit( __METHOD__ );
619  }
620  // Resume normal operations
621  if ( $status->isOk() ) {
622  $this->enableLB();
623  }
624 
625  return $status;
626  }
627 
628  public function getGlobalDefaults() {
629  // The default $wgDBmwschema is null, which breaks Postgres and other DBMSes that require
630  // the use of a schema, so we need to set it here
631  return array_merge( parent::getGlobalDefaults(), array(
632  'wgDBmwschema' => 'mediawiki',
633  ) );
634  }
635 
636  public function setupPLpgSQL() {
637  // Connect as the install user, since it owns the database and so is
638  // the user that needs to run "CREATE LANGAUGE"
639  $status = $this->getPgConnection( 'create-schema' );
640  if ( !$status->isOK() ) {
641  return $status;
642  }
646  $conn = $status->value;
647 
648  $exists = $conn->selectField( '"pg_catalog"."pg_language"', 1,
649  array( 'lanname' => 'plpgsql' ), __METHOD__ );
650  if ( $exists ) {
651  // Already exists, nothing to do
652  return Status::newGood();
653  }
654 
655  // plpgsql is not installed, but if we have a pg_pltemplate table, we
656  // should be able to create it
657  $exists = $conn->selectField(
658  array( '"pg_catalog"."pg_class"', '"pg_catalog"."pg_namespace"' ),
659  1,
660  array(
661  'pg_namespace.oid=relnamespace',
662  'nspname' => 'pg_catalog',
663  'relname' => 'pg_pltemplate',
664  ),
665  __METHOD__ );
666  if ( $exists ) {
667  try {
668  $conn->query( 'CREATE LANGUAGE plpgsql' );
669  } catch ( DBQueryError $e ) {
670  return Status::newFatal( 'config-pg-no-plpgsql', $this->getVar( 'wgDBname' ) );
671  }
672  } else {
673  return Status::newFatal( 'config-pg-no-plpgsql', $this->getVar( 'wgDBname' ) );
674  }
675 
676  return Status::newGood();
677  }
678 }
PostgresInstaller\isSuperUser
isSuperUser()
Definition: PostgresInstaller.php:313
PostgresInstaller\setupPLpgSQL
setupPLpgSQL()
Definition: PostgresInstaller.php:636
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:451
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:254
PostgresInstaller\submitSettingsForm
submitSettingsForm()
Set variables based on the request array, assuming it was submitted via the form return by getSetting...
Definition: PostgresInstaller.php:333
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\openConnectionWithParams
openConnectionWithParams( $user, $password, $dbName, $schema)
Open a PG connection with given parameters.
Definition: PostgresInstaller.php:158
PostgresInstaller\preUpgrade
preUpgrade()
Allow DB installers a chance to make checks before upgrade.
Definition: PostgresInstaller.php:576
PostgresInstaller\isRoleMember
isRoleMember( $conn, $targetMember, $group, $maxDepth)
Recursive helper for canCreateObjectsForWebUser().
Definition: PostgresInstaller.php:425
DatabaseInstaller\getTextBox
getTextBox( $var, $label, $attribs=array(), $helpData="")
Get a labelled text box to configure a local variable.
Definition: DatabaseInstaller.php:398
PostgresInstaller\commitChanges
commitChanges()
Definition: PostgresInstaller.php:523
PostgresInstaller\$pgConns
$pgConns
Definition: PostgresInstaller.php:48
PostgresInstaller\$internalDefaults
$internalDefaults
Definition: PostgresInstaller.php:41
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:218
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:159
PostgresInstaller\createTables
createTables()
Create database tables from scratch.
Definition: PostgresInstaller.php:585
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:141
DatabaseInstaller\submitWebUserBox
submitWebUserBox()
Submit the form from getWebUserBox().
Definition: DatabaseInstaller.php:587
PostgresInstaller\getInstallUserPermissions
getInstallUserPermissions()
Definition: PostgresInstaller.php:287
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:225
PostgresInstaller\getGlobalDefaults
getGlobalDefaults()
Get a name=>value map of MW configuration globals for the default values.
Definition: PostgresInstaller.php:628
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:560
PostgresInstaller\setupUser
setupUser()
Definition: PostgresInstaller.php:529
PostgresInstaller\getPgConnection
getPgConnection( $type)
Get a special type of connection.
Definition: PostgresInstaller.php:180
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:304
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:368
PostgresInstaller\getLocalSettings
getLocalSettings()
Get the DBMS-specific options for LocalSettings.php generation.
Definition: PostgresInstaller.php:567
DatabaseInstaller\submitInstallUserBox
submitInstallUserBox()
Submit a standard install user fieldset.
Definition: DatabaseInstaller.php:547
$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:477
PostgresInstaller\setupSchema
setupSchema()
Definition: PostgresInstaller.php:496
$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:2708
PostgresInstaller\canCreateObjectsForWebUser
canCreateObjectsForWebUser()
Returns true if the install user is able to create objects owned by the web user, false otherwise.
Definition: PostgresInstaller.php:399
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:322
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:385
DatabaseInstaller\getInstallUserBox
getInstallUserBox()
Get a standard install-user fieldset.
Definition: DatabaseInstaller.php:525
DatabaseInstaller\setVarsFromRequest
setVarsFromRequest( $varNames)
Convenience function to set variables based on form data.
Definition: DatabaseInstaller.php:492
$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:2584
PostgresInstaller
Class for setting up the MediaWiki database using Postgres.
Definition: PostgresInstaller.php:30
$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
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:1632
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