SpecialPageBeforeFormDisplay.
* (bug 65781) Removed block warning on included {{Special:Contributions}}
* Removed Skin::makeGlobalVariablesScript. (deprecated since 1.19)
+* Removed MWNamespace::isMain(). (deprecated since 1.19)
+* Removed Preferences::loadOldSearchNs(). (deprecated since 1.19)
+* Removed OutputPage::getStatusMessage(). (deprecated since 1.18)
+* Removed OutputPage::isUserJsAllowed(). (deprecated since 1.18)
+* Removed Title::updateTitleProtection(). (deprecated since 1.19)
==== Renamed classes ====
* CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
return !self::isTalk( $index );
}
- /**
- * @see self::isSubject
- * @deprecated since 1.19 Please use the more consistently named isSubject
- * @return bool
- */
- public static function isMain( $index ) {
- wfDeprecated( __METHOD__, '1.19' );
- return self::isSubject( $index );
- }
-
/**
* Is the given namespace a talk namespace?
*
);
}
- /**
- * Return whether user JavaScript is allowed for this page
- * @deprecated since 1.18 Load modules with ResourceLoader, and origin and
- * trustworthiness is identified and enforced automagically.
- * @return bool
- */
- public function isUserJsAllowed() {
- wfDeprecated( __METHOD__, '1.18' );
- return $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS ) >=
- ResourceLoaderModule::ORIGIN_USER_INDIVIDUAL;
- }
-
/**
* Show what level of JavaScript / CSS untrustworthiness is allowed on this page
* @see ResourceLoaderModule::$origin
}
}
- /**
- * Get the message associated with the HTTP response code $code
- *
- * @param int $code Status code
- * @return string|null Message or null if $code is not in the list of messages
- *
- * @deprecated since 1.18 Use HttpStatus::getMessage() instead.
- */
- public static function getStatusMessage( $code ) {
- wfDeprecated( __METHOD__, '1.18' );
- return HttpStatus::getMessage( $code );
- }
-
/**
* Finally, all the text has been munged and accumulated into
* the object, let's actually output it:
return array( $result, 'mailerror' );
}
}
-
- /**
- * @deprecated since 1.19
- * @param User $user
- * @return array
- */
- public static function loadOldSearchNs( $user ) {
- wfDeprecated( __METHOD__, '1.19' );
-
- $searchableNamespaces = SearchEngine::searchableNamespaces();
- // Back compat with old format
- $arr = array();
-
- foreach ( $searchableNamespaces as $ns => $name ) {
- if ( $user->getOption( 'searchNs' . $ns ) ) {
- $arr[] = $ns;
- }
- }
-
- return $arr;
- }
}
/** Some tweaks to allow js prefs to work */
return $this->mTitleProtection;
}
- /**
- * Update the title protection status
- *
- * @deprecated since 1.19; use WikiPage::doUpdateRestrictions() instead.
- * @param string $create_perm Permission required for creation
- * @param string $reason Reason for protection
- * @param string $expiry Expiry timestamp
- * @return bool
- */
- public function updateTitleProtection( $create_perm, $reason, $expiry ) {
- wfDeprecated( __METHOD__, '1.19' );
-
- global $wgUser;
-
- $limit = array( 'create' => $create_perm );
- $expiry = array( 'create' => $expiry );
-
- $page = WikiPage::factory( $this );
- $cascade = false;
- $status = $page->doUpdateRestrictions( $limit, $expiry, $cascade, $reason, $wgUser );
-
- return $status->isOK();
- }
-
/**
* Remove any title protection due to page existing
*/
return false;
}
+ if ( $schema === false ) {
+ global $wgDBmwschema;
+ $schema = $wgDBmwschema;
+ }
+
$res = $this->query( "SELECT 1 FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND TABLE_SCHEMA = '$schema' AND TABLE_NAME = '$table'" );
// Used internally, we want the schema split off from the table name and returned
// as a list with 3 elements (database, schema, table)
$table = explode( '.', $table );
- if ( count( $table ) == 2 ) {
+ while ( count( $table ) < 3 ) {
array_unshift( $table, false );
}
}
$this->settings[$var] = $GLOBALS[$var];
}
- $compiledDBs = array();
+ $this->compiledDBs = array();
foreach ( self::getDBTypes() as $type ) {
$installer = $this->getDBInstaller( $type );
if ( !$installer->isCompiled() ) {
continue;
}
- $compiledDBs[] = $type;
-
- $defaults = $installer->getGlobalDefaults();
-
- foreach ( $installer->getGlobalNames() as $var ) {
- if ( isset( $defaults[$var] ) ) {
- $this->settings[$var] = $defaults[$var];
- } else {
- $this->settings[$var] = $GLOBALS[$var];
- }
- }
+ $this->compiledDBs[] = $type;
}
- $this->compiledDBs = $compiledDBs;
$this->parserTitle = Title::newFromText( 'Installer' );
$this->parserOptions = new ParserOptions; // language will be wrong :(
'password' => $password,
'dbname' => false,
'flags' => 0,
+ 'schema' => $this->getVar( 'wgDBmwschema' ),
'tablePrefix' => $this->getVar( 'wgDBprefix' ) ) );
$db->prepareStatements( false );
$db->scrollableCursor( false );
return $status;
}
+ public function getGlobalDefaults() {
+ // The default $wgDBmwschema is null, which breaks Postgres and other DBMSes that require
+ // the use of a schema, so we need to set it here
+ return array(
+ 'wgDBmwschema' => 'mediawiki',
+ );
+ }
+
/**
* Try to see if the login exists
* @param string $user Username to check
* @param string $user User name
* @param string $password Password
* @param string $dbName Database name
+ * @param string $schema Database schema
* @return Status
*/
- protected function openConnectionWithParams( $user, $password, $dbName ) {
+ protected function openConnectionWithParams( $user, $password, $dbName, $schema ) {
$status = Status::newGood();
try {
- $db = new DatabasePostgres(
- $this->getVar( 'wgDBserver' ),
- $user,
- $password,
- $dbName
- );
+ $db = Database::factory( 'postgres', array(
+ 'host' => $this->getVar( 'wgDBserver' ),
+ 'user' => $user,
+ 'password' => $password,
+ 'dbname' => $dbName,
+ 'schema' => $schema ) );
$status->value = $db;
} catch ( DBConnectionError $e ) {
$status->fatal( 'config-connection-error', $e->getMessage() );
return $this->openConnectionWithParams(
$this->getVar( '_InstallUser' ),
$this->getVar( '_InstallPassword' ),
- $this->getVar( 'wgDBname' ) );
+ $this->getVar( 'wgDBname' ),
+ $this->getVar( 'wgDBmwschema' ) );
case 'create-tables':
$status = $this->openPgConnection( 'create-schema' );
if ( $status->isOK() ) {
$status = Status::newGood();
foreach ( $dbs as $db ) {
try {
- $conn = new DatabasePostgres(
- $this->getVar( 'wgDBserver' ),
+ $conn = $this->openConnectionWithParams(
$user,
$password,
- $db );
+ $db,
+ $this->getVar( 'wgDBmwschema' ) );
} catch ( DBConnectionError $error ) {
$conn = false;
$status->fatal( 'config-pg-test-error', $db,
return $status;
}
+ public function getGlobalDefaults() {
+ // The default $wgDBmwschema is null, which breaks Postgres and other DBMSes that require
+ // the use of a schema, so we need to set it here
+ return array(
+ 'wgDBmwschema' => 'mediawiki',
+ );
+ }
+
public function setupPLpgSQL() {
// Connect as the install user, since it owns the database and so is
// the user that needs to run "CREATE LANGAUGE"
/**
* Get the message associated with HTTP response code $code
*
- * Replace OutputPage::getStatusMessage( $code )
- *
* @param $code Integer: status code
* @return String or null: message or null if $code is not in the list of
* messages
);
$download = $this->msg( 'parentheses' )->rawParams( $download )->escaped();
+ // Add delete links if allowed
+ // From https://github.com/Wikia/app/pull/3859
+ if ( $filePage->userCan( 'delete', $this->getUser() ) ) {
+ $deleteMsg = $this->msg( 'listfiles-delete' )->escaped();
+
+ $delete = Linker::linkKnown(
+ $filePage, $deleteMsg, array(), array( 'action' => 'delete' )
+ );
+ $delete = $this->msg( 'parentheses' )->rawParams( $delete )->escaped();
+
+ return "$link $download $delete";
+ }
+
return "$link $download";
} else {
return htmlspecialchars( $value );
"license-nopreview": "(Preview not available)",
"upload_source_url": "(a valid, publicly accessible URL)",
"upload_source_file": "(a file on your computer)",
+ "listfiles-delete": "delete",
"listfiles-summary": "This special page shows all uploaded files.",
"listfiles_search_for": "Search for media name:",
"imgfile": "file",
"license-nopreview": "Error message when a certain license does not exist",
"upload_source_url": "Used in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|Sourcefilename|label}}\n* {{msg-mw|Sourceurl|label}}\n* {{msg-mw|Upload source file}}\n* {{msg-mw|Upload-maxfilesize}}",
"upload_source_file": "Used in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|Sourcefilename|label}}\n* {{msg-mw|Sourceurl|label}}\n* {{msg-mw|Upload source url}}\n* {{msg-mw|Upload-maxfilesize}}",
+ "listfiles-delete": "Text of the delete links next to the entries on [[Special:ListFiles]], surrounded by parentheses.",
"listfiles-summary": "This message is displayed at the top of [[Special:ImageList]] to explain how to use that special page.",
"listfiles_search_for": "Input label for the form displayed on [[Special:ListFiles]].",
"imgfile": "{{Identical|File}}",
true
);
$this->addOption( 'confpath', "Path to write LocalSettings.php to ($IP)", false, true );
+ $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in PostgreSQL/Microsoft SQL Server (mediawiki)', false, true );
/*
- $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in pg (mediawiki)', false, true );
$this->addOption( 'namespace', 'The project namespace (same as the "name" argument)', false, true );
*/
$this->addOption( 'env-checks', "Run environment checks only, don't change anything" );