* The default thumb size ($wgDefaultUserOptions['thumbsize']) is now 300px, up from
180px. If you have altered the number of entries in $wgThumbLimits for your wiki, you
may need to adjust your default user settings to compensate for the index change.
+* $wgDeferredUpdateList is now deprecated, you should use DeferredUpdates::addUpdate()
+ instead.
=== New features in 1.24 ===
* Added a new hook, "WhatLinksHereProps", to allow extensions to annotate
set of hooks has been removed and replaced by a single new hook
SpecialPageBeforeFormDisplay.
* (bug 65781) Removed block warning on included {{Special:Contributions}}
-* Removed Skin::makeGlobalVariablesScript. (deprecated since 1.19)
+* 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)
setPreloadedText() from EditPage.php. (deprecated since 1.21)
* Removed global functions wfArrayLookup(), wfArrayMerge(), wfDebugDieBacktrace()
and wfTime(). (deprecated since 1.22)
-* Microsoft Internet Explorer 6 is now a "grade C" browser, meaning that
- JavaScript is no longer executed in this browser. The IEFixes script, which
- existed purely to provide support for MSIE versions below 7 and which was
- conditionally loaded for those browsers, was also removed.
+* Browser support for Internet Explorer 6 lowered from Grade A to Grade C,
+ meaning that JavaScript is no longer executed in this browser.
+* Browser support for Opera 11 lowered from Grade A to Grade C.
+* Removed IEFixes module which existed purely to provide support for MSIE versions
+ below 7 (conditionally loaded only for those browsers).
* Action::checkCanExecute() no longer has a return value.
* Removed cleanupForIRC(), loadFromCurRow(), newFromCurRow(), notifyRC2UDP()
and sendToUDP() from RecentChange.php. (deprecated since 1.22)
* Removed EnhancedChangesList::arrow(), sideArrow(), downArrow(), spacerArrow().
* Removed Xml::namespaceSelector(). (deprecated since 1.19)
-* Removed WikiPage::estimateRevisionCount. (deprecated since 1.19)
+* Removed WikiPage::estimateRevisionCount(). (deprecated since 1.19)
+* MYSQL: Enum item added to "major MIME type" columns.
+ Running update.php on MySQL < v5.1 may result in heavy processing.
==== Renamed classes ====
* CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
&$opts: Options for the query.
&$join_conds: Join conditions for the query.
-'MonoBookTemplateToolboxEnd': DEPRECATED. Called by Monobook skin after toolbox
-links have been rendered (useful for adding more). Note: this is only run for
-the Monobook skin. To add items to the toolbox you should use the
-SkinTemplateToolboxEnd hook instead, which works for all "SkinTemplate"-type
-skins.
-$tools: array of tools
-
'BaseTemplateToolbox': Called by BaseTemplate when building the $toolbox array
and returning it for the skin to output. You can add items to the toolbox while
still letting the skin make final decisions on skin-specific markup conventions
*
* @param Block $block
* @param array &$blockIds
- * @return array Block IDs of retroactive autoblocks made
*/
protected static function defaultRetroactiveAutoblock( Block $block, array &$blockIds ) {
global $wgPutIPinRC;
* up top, or false if this is the comment summary
* down below the textarea
* @param string $summary The text of the summary to display
- * @return string
*/
protected function showSummaryInput( $isSubjectPreview, $summary = "" ) {
global $wgOut, $wgContLang;
* Get the copyright warning
*
* Renamed to getCopyrightWarning(), old name kept around for backwards compatibility
+ * @return string
*/
protected function getCopywarn() {
return self::getCopyrightWarning( $this->mTitle );
if ( !function_exists( 'mb_substr' ) ) {
/**
* @codeCoverageIgnore
+ * @see Fallback::mb_substr
* @return string
*/
function mb_substr( $str, $start, $count = 'end' ) {
/**
* @codeCoverageIgnore
+ * @see Fallback::mb_substr_split_unicode
* @return int
*/
function mb_substr_split_unicode( $str, $splitPos ) {
if ( !function_exists( 'mb_strlen' ) ) {
/**
* @codeCoverageIgnore
+ * @see Fallback::mb_strlen
* @return int
*/
function mb_strlen( $str, $enc = '' ) {
if ( !function_exists( 'mb_strpos' ) ) {
/**
* @codeCoverageIgnore
+ * @see Fallback::mb_strpos
* @return int
*/
function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
if ( !function_exists( 'mb_strrpos' ) ) {
/**
* @codeCoverageIgnore
+ * @see Fallback::mb_strrpos
* @return int
*/
function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
* @param string $name Name attribute
* @param bool $checked Whether the checkbox is checked or not
* @param array $attribs Array of additional attributes
+ * @return string
*/
public static function check( $name, $checked = false, array $attribs = array() ) {
if ( isset( $attribs['value'] ) ) {
* @param string $name Name attribute
* @param bool $checked Whether the checkbox is checked or not
* @param array $attribs Array of additional attributes
+ * @return string
*/
public static function radio( $name, $checked = false, array $attribs = array() ) {
if ( isset( $attribs['value'] ) ) {
* @param string $label Contents of the label
* @param string $id ID of the element being labeled
* @param array $attribs Additional attributes
+ * @return string
*/
public static function label( $label, $id, array $attribs = array() ) {
$attribs += array(
return true;
}
- /**
- * @return mixed
- */
function importLogItem() {
$dbw = wfGetDB( DB_MASTER );
# @todo FIXME: This will not record autoblocks
/**
* Identical to link(), except $options defaults to 'known'.
+ * @see Linker::link
* @return string
*/
public static function linkKnown(
/**
* Get a 2-d hashtable for this array
+ * @return array
*/
function getHash() {
if ( is_null( $this->hash ) ) {
/**
* Get the base regex
+ * @return array
*/
function getBaseRegex() {
if ( is_null( $this->baseRegex ) ) {
/**
* Get an unanchored regex that does not match parameters
+ * @return array
*/
function getRegex() {
if ( is_null( $this->regex ) ) {
* constituent messages or the resource itself is changed.
*/
class MessageBlobStore {
+ /**
+ * Get the singleton instance
+ *
+ * @since 1.24
+ * @return MessageBlobStore
+ */
+ public static function getInstance() {
+ static $instance = null;
+ if ( $instance === null ) {
+ $instance = new self;
+ }
+
+ return $instance;
+ }
+
/**
* Get the message blobs for a set of modules
*
* @param string $lang Language code
* @return array An array mapping module names to message blobs
*/
- public static function get( ResourceLoader $resourceLoader, $modules, $lang ) {
+ public function get( ResourceLoader $resourceLoader, $modules, $lang ) {
wfProfileIn( __METHOD__ );
if ( !count( $modules ) ) {
wfProfileOut( __METHOD__ );
return array();
}
// Try getting from the DB first
- $blobs = self::getFromDB( $resourceLoader, array_keys( $modules ), $lang );
+ $blobs = $this->getFromDB( $resourceLoader, array_keys( $modules ), $lang );
// Generate blobs for any missing modules and store them in the DB
$missing = array_diff( array_keys( $modules ), array_keys( $blobs ) );
foreach ( $missing as $name ) {
- $blob = self::insertMessageBlob( $name, $modules[$name], $lang );
+ $blob = $this->insertMessageBlob( $name, $modules[$name], $lang );
if ( $blob ) {
$blobs[$name] = $blob;
}
* @param string $lang Language code
* @return mixed Message blob or false if the module has no messages
*/
- public static function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
- $blob = self::generateMessageBlob( $module, $lang );
+ public function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
+ $blob = $this->generateMessageBlob( $module, $lang );
if ( !$blob ) {
return false;
* @return string Regenerated message blob, or null if there was no blob for
* the given module/language pair.
*/
- public static function updateModule( $name, ResourceLoaderModule $module, $lang ) {
+ public function updateModule( $name, ResourceLoaderModule $module, $lang ) {
$dbw = wfGetDB( DB_MASTER );
$row = $dbw->selectRow( 'msg_resource', 'mr_blob',
array( 'mr_resource' => $name, 'mr_lang' => $lang ),
// Save the old and new blobs for later
$oldBlob = $row->mr_blob;
- $newBlob = self::generateMessageBlob( $module, $lang );
+ $newBlob = $this->generateMessageBlob( $module, $lang );
try {
$newRow = array(
*
* @param string $key Message key
*/
- public static function updateMessage( $key ) {
+ public function updateMessage( $key ) {
try {
$dbw = wfGetDB( DB_MASTER );
// in one iteration.
$updates = null;
do {
- $updates = self::getUpdatesForMessage( $key, $updates );
+ $updates = $this->getUpdatesForMessage( $key, $updates );
foreach ( $updates as $k => $update ) {
// Update the row on the condition that it
}
}
- public static function clear() {
+ public function clear() {
// TODO: Give this some more thought
try {
// Not using TRUNCATE, because that needs extra permissions,
* @param array $prevUpdates Updates queue to refresh or null to build a fresh update queue
* @return array Updates queue
*/
- private static function getUpdatesForMessage( $key, $prevUpdates = null ) {
+ private function getUpdatesForMessage( $key, $prevUpdates = null ) {
$dbw = wfGetDB( DB_MASTER );
if ( is_null( $prevUpdates ) ) {
'resource' => $row->mr_resource,
'lang' => $row->mr_lang,
'timestamp' => $row->mr_timestamp,
- 'newBlob' => self::reencodeBlob( $row->mr_blob, $key, $row->mr_lang )
+ 'newBlob' => $this->reencodeBlob( $row->mr_blob, $key, $row->mr_lang )
);
}
* @param string $lang Language code
* @return string Message blob with $key replaced with its new value
*/
- private static function reencodeBlob( $blob, $key, $lang ) {
+ private function reencodeBlob( $blob, $key, $lang ) {
$decoded = FormatJson::decode( $blob, true );
$decoded[$key] = wfMessage( $key )->inLanguage( $lang )->plain();
* @throws MWException
* @return array Array mapping module names to blobs
*/
- private static function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) {
- global $wgCacheEpoch;
-
+ private function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) {
+ $config = $resourceLoader->getConfig();
$retval = array();
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'msg_resource',
}
// Update the module's blobs if the set of messages changed or if the blob is
- // older than $wgCacheEpoch
+ // older than the CacheEpoch setting
$keys = array_keys( FormatJson::decode( $row->mr_blob, true ) );
$values = array_values( array_unique( $module->getMessages() ) );
if ( $keys !== $values
- || wfTimestamp( TS_MW, $row->mr_timestamp ) <= $wgCacheEpoch
+ || wfTimestamp( TS_MW, $row->mr_timestamp ) <= $config->get( 'CacheEpoch' )
) {
- $retval[$row->mr_resource] = self::updateModule( $row->mr_resource, $module, $lang );
+ $retval[$row->mr_resource] = $this->updateModule( $row->mr_resource, $module, $lang );
} else {
$retval[$row->mr_resource] = $row->mr_blob;
}
* @param string $lang Language code
* @return string JSON object
*/
- private static function generateMessageBlob( ResourceLoaderModule $module, $lang ) {
+ private function generateMessageBlob( ResourceLoaderModule $module, $lang ) {
$messages = array();
foreach ( $module->getMessages() as $key ) {
* Regular expression to match HTML/XML attribute pairs within a tag.
* Allows some... latitude.
* Used in Sanitizer::fixTagAttributes and Sanitizer::decodeTagAttributes
+ * @return string
*/
static function getAttribsRegex() {
if ( self::$attribsRegex === null ) {
*/
$wgTitle = null;
+/**
+ * @deprecated 1.24 Use DeferredUpdates::addUpdate instead
+ * @var array
+ */
$wgDeferredUpdateList = array();
// Disable all other email settings automatically if $wgEnableEmail
/**
* Check if user is allowed to access a feature / make an action
*
- * @internal param \String $varargs permissions to test
+ * @param string $permissions,... Permissions to test
* @return bool True if user is allowed to perform *any* of the given actions
- *
- * @return bool
*/
public function isAllowedAny( /*...*/ ) {
$permissions = func_get_args();
/**
*
- * @internal param $varargs string
+ * @param string $permissions,... Permissions to test
* @return bool True if the user is allowed to perform *all* of the given actions
*/
public function isAllowedAll( /*...*/ ) {
/**
* Check permissions
* @param string $what 'viewmywatchlist' or 'editmywatchlist'
+ * @return bool
*/
private function isAllowed( $what ) {
return !$this->mCheckRights || $this->mUser->isAllowed( $what );
/**
* Get the contents of the buffer.
+ * @return string
*/
public function getBuffer() {
return $this->mBuffer;
/**
* @param Content $content
* @param string $what Identifies the content in error messages, e.g. page title.
+ * @return Content|bool
*/
private function getSectionContent( Content $content, $what ) {
// Not cached (save or load)
*
* @param string $code
* @param array $deps
+ * @return array
*/
protected function readSourceFilesAndRegisterDeps( $code, &$deps ) {
global $IP;
# HACK: If using a null (i.e. disabled) storage backend, we
# can't write to the MessageBlobStore either
if ( $purgeBlobs && !$this->store instanceof LCStoreNull ) {
- MessageBlobStore::clear();
+ MessageBlobStore::getInstance()->clear();
}
wfProfileOut( __METHOD__ );
// Update the message in the message blob store
global $wgContLang;
- MessageBlobStore::updateMessage( $wgContLang->lcfirst( $msg ) );
+ MessageBlobStore::getInstance()->updateMessage( $wgContLang->lcfirst( $msg ) );
wfRunHooks( 'MessageCacheReplace', array( $title, $text ) );
/**
* Generate the feed items given a row from the database.
* @param object $rows DatabaseBase resource with recentchanges rows
+ * @return array
*/
public static function buildItems( $rows ) {
wfProfileIn( __METHOD__ );
$e = new Exception;
wfDebugLog( 'recursion-guard', "Recursion detected:\n" . $e->getTraceAsString() );
- $code = $this->getConfig()->get( 'LanguageCode' ) ? : 'en';
+ $code = $this->getConfig()->get( 'LanguageCode' ) ?: 'en';
$this->lang = Language::factory( $code );
} elseif ( $this->lang === null ) {
$this->recursion = true;
}
/**
- * Return a path to the DBMS-specific schema file, otherwise default to tables.sql
+ * Return a path to the DBMS-specific SQL file if it exists,
+ * otherwise default SQL file
*
+ * @param string $filename
* @return string
*/
- public function getSchemaPath() {
+ private function getSqlFilePath( $filename ) {
global $IP;
- if ( file_exists( "$IP/maintenance/" . $this->getType() . "/tables.sql" ) ) {
- return "$IP/maintenance/" . $this->getType() . "/tables.sql";
+ $dbmsSpecificFilePath = "$IP/maintenance/" . $this->getType() . "/$filename";
+ if ( file_exists( $dbmsSpecificFilePath ) ) {
+ return $dbmsSpecificFilePath;
} else {
- return "$IP/maintenance/tables.sql";
+ return "$IP/maintenance/$filename";
}
}
+ /**
+ * Return a path to the DBMS-specific schema file,
+ * otherwise default to tables.sql
+ *
+ * @return string
+ */
+ public function getSchemaPath() {
+ return $this->getSqlFilePath( 'tables.sql' );
+ }
+
+ /**
+ * Return a path to the DBMS-specific update key file,
+ * otherwise default to update-keys.sql
+ *
+ * @return string
+ */
+ public function getUpdateKeysPath() {
+ return $this->getSqlFilePath( 'update-keys.sql' );
+ }
+
# ------------------------------------------------------------------------------
# Other functions
# ------------------------------------------------------------------------------
/**
* @since 1.19
+ * @return string
*/
public function __toString() {
return (string)$this->mConn;
/**
* @param bool $value
- * @return null|bool|ResultWrapper
*/
public function setBigSelects( $value = true ) {
if ( $value === 'default' ) {
* Give an id for the connection
*
* mysql driver used resource id, but mysqli objects cannot be cast to string.
+ * @return string
*/
public function __toString() {
if ( $this->mConn instanceof Mysqli ) {
/**
* @since 1.19
+ * @return bool|mixed
*/
function defaultValue() {
if ( $this->has_default ) {
* so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly.
*
* MySQL uses "ORDER BY NULL" as an optimization hint, but that syntax is illegal in PostgreSQL.
+ * @see DatabaseBase::selectSQLText
*/
function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__,
$options = array(), $join_conds = array()
* @param int $callerOffset How far up the callstack is the original
* caller. 2 = function that called the function that called
* MWDebug::deprecated() (Added in 1.20).
- * @return mixed
*/
public static function deprecated( $function, $version = false,
$component = false, $callerOffset = 2
* If you're using a real search engine, you'll probably want to override
* this behavior and do something nicer with the original wikitext.
* @param string $text
+ * @return string
*/
public static function updateText( $text ) {
global $wgContLang;
/**
* Create a repo class based on an info structure
* @param array $info
+ * @return FileRepo
*/
protected function newRepo( $info ) {
$class = $info['class'];
/**
* Returns the number of pages of a multipage document, or false for
* documents which aren't multipage documents
+ * @return bool|int
*/
function pageCount() {
if ( !isset( $this->pageCount ) ) {
/**
* Get last thumbnailing error.
* Largely obsolete.
+ * @return string
*/
function getLastError() {
return $this->lastError;
*
* @param string|bool $mode Mode to use. False to use the default
* @param IContextSource|null $context
+ * @return ImageGalleryBase
* @throws MWException
*/
static function factory( $mode = false, IContextSource $context = null ) {
/**
* Add javascript which auto-justifies the rows by manipulating the image sizes.
* Also ensures that the hover version of this degrades gracefully.
+ * @return array
*/
protected function getModules() {
return array( 'mediawiki.page.gallery' );
*/
class HTMLCheckField extends HTMLFormField {
function getInputHTML( $value ) {
+ global $wgUseMediaWikiUIEverywhere;
+
if ( !empty( $this->mParams['invert'] ) ) {
$value = !$value;
}
),
Xml::check( $this->mName, $value, $attr ) . $this->mLabel );
} else {
- return Xml::checkLabel( $this->mLabel, $this->mName, $this->mID, $value, $attr );
+ $chkLabel = Xml::check( $this->mName, $value, $attr )
+ . ' '
+ . Html::rawElement( 'label', array( 'for' => $this->mID ), $this->mLabel );
+
+ if ( $wgUseMediaWikiUIEverywhere ) {
+ $chkLabel = Html::rawElement(
+ 'div',
+ array( 'class' => 'mw-ui-checkbox' ),
+ $chkLabel
+ );
+ }
+
+ return $chkLabel;
}
}
* @return string
*/
function getInputHTML( $value ) {
- global $wgUseMediaWikiUIEverywhere;
-
$html = '';
$tableContents = '';
$rows = $this->mParams['rows'];
$thisAttribs['disabled'] = 1;
}
$chkBox = Xml::check( "{$this->mName}[]", $checked, $attribs + $thisAttribs );
- if ( $wgUseMediaWikiUIEverywhere ) {
+ if ( $this->mParent->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
$chkBox = Html::openElement( 'div', array( 'class' => 'mw-ui-checkbox' ) ) .
$chkBox .
Html::element( 'label', array( 'for' => $thisId ) ) .
* @return string
*/
public function getDisplayFormat() {
- global $wgHTMLFormAllowTableFormat;
$format = $this->displayFormat;
- if ( !$wgHTMLFormAllowTableFormat && $format === 'table' ) {
+ if ( !$this->getConfig()->get( 'HTMLFormAllowTableFormat' ) && $format === 'table' ) {
$format = 'div';
}
return $format;
* @return string HTML.
*/
function getHiddenFields() {
- global $wgArticlePath;
-
$html = '';
if ( $this->getMethod() == 'post' ) {
$html .= Html::hidden(
$html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
}
- if ( strpos( $wgArticlePath, '?' ) !== false && $this->getMethod() == 'get' ) {
+ $articlePath = $this->getConfig()->get( 'ArticlePath' );
+ if ( strpos( $articlePath, '?' ) !== false && $this->getMethod() == 'get' ) {
$html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
}
* @return string HTML.
*/
function getButtons() {
- global $wgUseMediaWikiUIEverywhere;
$buttons = '';
+ $useMediaWikiUIEverywhere = $this->getConfig()->get( 'UseMediaWikiUIEverywhere' );
if ( $this->mShowSubmit ) {
$attribs = array();
$attribs['class'] = array( 'mw-htmlform-submit' );
- if ( $this->isVForm() || $wgUseMediaWikiUIEverywhere ) {
+ if ( $this->isVForm() || $useMediaWikiUIEverywhere ) {
array_push( $attribs['class'], 'mw-ui-button', 'mw-ui-constructive' );
}
$attrs['id'] = $button['id'];
}
- if ( $wgUseMediaWikiUIEverywhere ) {
+ if ( $useMediaWikiUIEverywhere ) {
if ( isset( $attrs['class' ] ) ) {
$attrs['class'] .= ' mw-ui-button';
} else {
* @return string
*/
public function getAction() {
- global $wgScript, $wgArticlePath;
-
// If an action is alredy provided, return it
if ( $this->mAction !== false ) {
return $this->mAction;
}
- // Check whether we are in GET mode and $wgArticlePath contains a "?"
+ $articlePath = $this->getConfig()->get( 'ArticlePath' );
+ // Check whether we are in GET mode and the ArticlePath contains a "?"
// meaning that getLocalURL() would return something like "index.php?title=...".
// As browser remove the query string before submitting GET forms,
- // it means that the title would be lost. In such case use $wgScript instead
+ // it means that the title would be lost. In such case use wfScript() instead
// and put title in an hidden field (see getHiddenFields()).
- if ( strpos( $wgArticlePath, '?' ) !== false && $this->getMethod() === 'get' ) {
- return $wgScript;
+ if ( strpos( $articlePath, '?' ) !== false && $this->getMethod() === 'get' ) {
+ return wfScript();
}
return $this->getTitle()->getLocalURL();
$wrapperAttributes = array(
'class' => 'htmlform-tip',
);
+ if ( $this->mHelpClass !== false ) {
+ $wrapperAttributes['class'] .= " {$this->mHelpClass}";
+ }
if ( $this->mHideIf ) {
$wrapperAttributes['data-hide-if'] = FormatJson::encode( $this->mHideIf );
$wrapperAttributes['class'] .= ' mw-htmlform-hide-if';
}
/**
- * Create database tables from scratch.
+ * Apply a SQL source file to the database as part of running an installation step.
*
+ * @param string $sourceFileMethod
+ * @param string $stepName
+ * @param string $archiveTableMustNotExist
* @return Status
*/
- public function createTables() {
+ private function stepApplySourceFile(
+ $sourceFileMethod,
+ $stepName,
+ $archiveTableMustNotExist = false
+ ) {
$status = $this->getConnection();
if ( !$status->isOK() ) {
return $status;
}
$this->db->selectDB( $this->getVar( 'wgDBname' ) );
- if ( $this->db->tableExists( 'archive', __METHOD__ ) ) {
- $status->warning( 'config-install-tables-exist' );
+ if ( $archiveTableMustNotExist && $this->db->tableExists( 'archive', __METHOD__ ) ) {
+ $status->warning( "config-$stepName-tables-exist" );
$this->enableLB();
return $status;
$this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
$this->db->begin( __METHOD__ );
- $error = $this->db->sourceFile( $this->db->getSchemaPath() );
+ $error = $this->db->sourceFile(
+ call_user_func( array( $this->db, $sourceFileMethod ) )
+ );
if ( $error !== true ) {
$this->db->reportQueryError( $error, 0, '', __METHOD__ );
$this->db->rollback( __METHOD__ );
- $status->fatal( 'config-install-tables-failed', $error );
+ $status->fatal( "config-$stepName-tables-failed", $error );
} else {
$this->db->commit( __METHOD__ );
}
return $status;
}
+ /**
+ * Create database tables from scratch.
+ *
+ * @return Status
+ */
+ public function createTables() {
+ return $this->stepApplySourceFile( 'getSchemaPath', 'install', true );
+ }
+
+ /**
+ * Insert update keys into table to prevent running unneded updates.
+ *
+ * @return Status
+ */
+ public function insertUpdateKeys() {
+ return $this->stepApplySourceFile( 'getUpdateKeysPath', 'updates', false );
+ }
+
/**
* Create the tables for each extension the user enabled
* @return Status
if ( $wgLocalisationCacheConf['manualRecache'] ) {
$this->rebuildLocalisationCache();
}
- MessageBlobStore::clear();
+ MessageBlobStore::getInstance()->clear();
$this->output( "done.\n" );
}
/**
* Updates the timestamps in the transcache table
+ * @return bool
*/
protected function doUpdateTranscacheField() {
if ( $this->updateRowExists( 'convert transcache field' ) ) {
/**
* Environment check for register_globals.
* Prevent installation if enabled
+ * @return bool
*/
protected function envCheckRegisterGlobals() {
if ( wfIniGetBool( 'register_globals' ) ) {
array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ),
array( 'name' => 'stats', 'callback' => array( $this, 'populateSiteStats' ) ),
array( 'name' => 'keys', 'callback' => array( $this, 'generateKeys' ) ),
+ array( 'name' => 'updates', 'callback' => array( $installer, 'insertUpdateKeys' ) ),
array( 'name' => 'sysop', 'callback' => array( $this, 'createSysop' ) ),
array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ),
);
array( 'updateConstraints', 'media_type', 'image', 'img_media_type' ),
array( 'updateConstraints', 'media_type', 'uploadstash', 'us_media_type' ),
// END: Constraint updates
+
+ array( 'modifyField', 'image', 'img_major_mime',
+ 'patch-img_major_mime-chemical.sql' ),
+ array( 'modifyField', 'oldimage', 'oi_major_mime',
+ 'patch-oi_major_mime-chemical.sql' ),
+ array( 'modifyField', 'filearchive', 'fa_major_mime',
+ 'patch-fa_major_mime-chemical.sql' ),
);
}
// 1.24
array( 'addField', 'page_props', 'pp_sortkey', 'patch-pp_sortkey.sql' ),
array( 'dropField', 'recentchanges', 'rc_cur_time', 'patch-drop-rc_cur_time.sql' ),
- array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', 'patch-watchlist-user-notificationtimestamp-index.sql' ),
+ array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp',
+ 'patch-watchlist-user-notificationtimestamp-index.sql' ),
array( 'addField', 'page', 'page_lang', 'patch-page_lang.sql' ),
array( 'addField', 'pagelinks', 'pl_from_namespace', 'patch-pl_from_namespace.sql' ),
array( 'addField', 'templatelinks', 'tl_from_namespace', 'patch-tl_from_namespace.sql' ),
array( 'addField', 'imagelinks', 'il_from_namespace', 'patch-il_from_namespace.sql' ),
+ array( 'modifyField', 'image', 'img_major_mime',
+ 'patch-img_major_mime-chemical.sql' ),
+ array( 'modifyField', 'oldimage', 'oi_major_mime',
+ 'patch-oi_major_mime-chemical.sql' ),
+ array( 'modifyField', 'filearchive', 'fa_major_mime',
+ 'patch-fa_major_mime-chemical.sql' ),
);
}
"config-install-stats": "Initializing statistics",
"config-install-keys": "Generating secret keys",
"config-insecure-keys": "<strong>Warning:</strong> {{PLURAL:$2|A secure key|Secure keys}} ($1) generated during installation {{PLURAL:$2|is|are}} not completely safe. Consider changing {{PLURAL:$2|it|them}} manually.",
+ "config-install-updates": "Prevent running unneeded updates",
+ "config-install-updates-failed": "<strong>Error:</strong> Inserting update keys into tables failed with the following error: $1",
"config-install-sysop": "Creating administrator user account",
"config-install-subscribe-fail": "Unable to subscribe to mediawiki-announce: $1",
"config-install-subscribe-notpossible": "cURL is not installed and <code>allow_url_fopen</code> is not available.",
"config-install-stats": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
"config-install-keys": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
"config-insecure-keys": "Parameters:\n* $1 - A list of names of the secret keys that were generated.\n* $2 - the number of items in the list $1, to be used with PLURAL.",
+ "config-install-updates": "Message indicating that the updatelog table is filled with keys of updates that won't be run when running database updates.",
+ "config-install-updates-failed": "Used as error message. Parameters:\n* $1 - detailed error message",
"config-install-sysop": "Message indicates that the administrator user account is being created\n\nSee also:\n*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
"config-install-subscribe-fail": "{{doc-important|\"[[m:mail:mediawiki-announce|mediawiki-announce]]\" is the name of a mailing list and should not be translated.}}\nA message displayed if the MediaWiki installer encounters an error making a request to lists.wikimedia.org which hosts the mailing list.\n* $1 - the HTTP error encountered, reproduced as is (English string)",
"config-install-subscribe-notpossible": "Error shown when automatically subscribing to the MediaWiki announcements mailing list fails.",
$content = stream_get_contents( $handle );
flock( $handle, LOCK_UN );
fclose( $handle );
- $backoffs = json_decode( $content, true ) ? : array();
+ $backoffs = json_decode( $content, true ) ?: array();
}
return $backoffs;
$handle = fopen( $file, 'wb+' );
flock( $handle, LOCK_EX );
$content = stream_get_contents( $handle );
- $cBackoffs = json_decode( $content, true ) ? : array();
+ $cBackoffs = json_decode( $content, true ) ?: array();
foreach ( $backoffs as $type => $timestamp ) {
$cBackoffs[$type] = isset( $cBackoffs[$type] ) ? $cBackoffs[$type] : 0;
$cBackoffs[$type] = max( $cBackoffs[$type], $backoffs[$type] );
/**
* Get the comment from the last addEntry() call
+ * @return string
*/
public function getComment() {
return $this->comment;
/**
* Get $this->mFilteredExifData
+ * @return array
*/
function getFilteredData() {
return $this->mFilteredExifData;
* raw WikiPage fields for backwards compatibility.
*
* @param string $fname Field name
+ * @return mixed
*/
public function __get( $fname ) {
if ( property_exists( $this->mPage, $fname ) ) {
/**
* Save space for for serialization by removing useless values
+ * @return array
*/
public function __sleep() {
return array_diff(
// Pre-fetch blobs
if ( $context->shouldIncludeMessages() ) {
try {
- $blobs = MessageBlobStore::get( $this, $modules, $context->getLanguage() );
+ $blobs = MessageBlobStore::getInstance()->get( $this, $modules, $context->getLanguage() );
} catch ( Exception $e ) {
MWExceptionHandler::logException( $e );
wfDebugLog(
* Returns JS code which calls mw.loader.register with the given
* parameters. Has three calling conventions:
*
- * - ResourceLoader::makeLoaderRegisterScript( $name, $version, $dependencies, $group, $source, $skip ):
- * Register a single module.
+ * - ResourceLoader::makeLoaderRegisterScript( $name, $version,
+ * $dependencies, $group, $source, $skip
+ * ):
+ * Register a single module.
*
* - ResourceLoader::makeLoaderRegisterScript( array( $name1, $name2 ) ):
- * Register modules with the given names.
+ * Register modules with the given names.
*
* - ResourceLoader::makeLoaderRegisterScript( array(
* array( $name1, $version1, $dependencies1, $group1, $source1, $skip1 ),
* the target is category or image, leave it
*
* @param array $matches
+ * @return string
*/
function linkReplace( $matches ) {
$colon = strpos( $matches[1], ':' );
* However this version should be no more expensive then
* Special:MostLinked, which seems to get handled fine
* with however we are doing cached special pages.
+ * @return array
*/
function getQueryInfo() {
return array(
* @param int $offset
* @param int $limit
* @param bool $asc
+ * @return array
*/
function reallyDoQuery( $offset, $limit, $asc ) {
$prevTableName = $this->mTableName;
* that this report gives results in a logical order). As an aditional
* note, mysql seems to by default order things by img_name ASC, which
* is what we ideally want, so everything works out fine anyhow.
+ * @return array
*/
function getOrderFields() {
return array();
'video',
'message',
'model',
- 'multipart'
+ 'multipart',
+ 'chemical'
);
return in_array( $type, $types );
* Show a form for filtering namespace and username
*
* @param string $par
- * @return string
*/
public function execute( $par ) {
$out = $this->getOutput();
/**
*
* @param array $data
+ * @return bool
*/
public function onSubmit( array $data ) {
$title = Title::newFromText( $data['pagename'] );
/**
* Display appropriate message if there's nothing to do.
* The submit button is also suppressed in this case (see alterForm()).
+ * @return array
*/
protected function getFormFields() {
$user = $this->getUser();
}
$this->stash = new UploadStash( $this->repo, $this->user );
}
-
- return true;
}
/**
/**
* Are we running on Windows?
+ * @return bool
*/
protected function isWindows() {
return substr( php_uname(), 0, 7 ) == 'Windows';
/**
* Initialize an initial random state based off of whatever we can find
+ * @return string
*/
protected function initialRandomState() {
// $_SERVER contains a variety of unstable user and system specific information
"createacct-submit": "Submit button on vertical-layout create account form.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
"createacct-another-submit": "Submit button of [[Special:UserLogin/signup]] ([[Special:CreateAccount]]) when accessed by a registered user.\n\nThe original means \"create an account in addition to the one you already have\"; sometimes, but not always, it means you are going to \"Create the account on behalf of somebody else\" or \"Create account for another\".\n{{Identical|Create another account}}",
"createacct-benefit-heading": "In vertical-layout create account form, the heading for the section describing the benefits of creating an account. See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nIf in your language you need to know the gender of the name for the wiki (which is the subject of the English sentence), please adapt the sentence as much as you need for your translation to fit.",
- "createacct-benefit-icon1": "In vertical-layout create account form, the CSS style for the div next to the first benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
- "createacct-benefit-head1": "In vertical-layout create account form, the text in the heading for the first benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body1}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
+ "createacct-benefit-icon1": "In vertical-layout create account form, the CSS style for the div next to the first benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
+ "createacct-benefit-head1": "In vertical-layout create account form, the text in the heading for the first benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body1}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
"createacct-benefit-body1": "In vertical-layout create account form, the text for the first benefit.\n\nPreceded by the message {{msg-mw|Createacct-benefit-head1}} (number of edits).\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nParameters:\n* $1 - number of edits\n{{Identical|Edit}}",
- "createacct-benefit-icon2": "In vertical-layout create account form, the CSS style for the div next to the second benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
- "createacct-benefit-head2": "In vertical-layout create account form, the text in the heading for the second benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body2}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
+ "createacct-benefit-icon2": "In vertical-layout create account form, the CSS style for the div next to the second benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
+ "createacct-benefit-head2": "In vertical-layout create account form, the text in the heading for the second benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body2}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
"createacct-benefit-body2": "In vertical-layout create account form, the text for the second benefit.\n\nPreceded by the message {{msg-mw|Createacct-benefit-head2}} (number of pages).\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nParameters:\n* $1 - number of pages\n{{Identical|Page}}",
- "createacct-benefit-icon3": "In vertical-layout create account form, the CSS style for the div next to the third benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
- "createacct-benefit-head3": "In vertical-layout create account form, the text in the heading for the third benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body3}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
+ "createacct-benefit-icon3": "In vertical-layout create account form, the CSS style for the div next to the third benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
+ "createacct-benefit-head3": "In vertical-layout create account form, the text in the heading for the third benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body3}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
"createacct-benefit-body3": "In vertical-layout create account form, the text for the third benefit.\n\nPreceded by the message {{msg-mw|Createacct-benefit-head3}} (number of contributors).\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nParameters:\n* $1 - number of contributors (users)",
"badretype": "Used as error message when the new password and its retype do not match.",
"userexists": "Used as error message in creating a user account.",
--- /dev/null
+ALTER TABLE /*$wgDBprefix*/filearchive
+ CHANGE fa_major_mime fa_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical');
+
--- /dev/null
+ALTER TABLE /*$wgDBprefix*/image
+ CHANGE img_major_mime img_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical');
+
--- /dev/null
+ALTER TABLE /*$wgDBprefix*/oldimage
+ CHANGE oi_major_mime oi_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical');
+
* or pointless ?> closing tags at the end.
*
* @param string $file String Path to a file to check for errors
- * @return bool
*/
private function checkForMistakes( $file ) {
foreach ( $this->mNoStyleCheckPaths as $regex ) {
$IP . '/includes/revisiondelete/',
$IP . '/includes/search/',
$IP . '/includes/site/',
+ $IP . '/includes/skins/',
$IP . '/includes/specialpage/',
$IP . '/includes/specials/',
$IP . '/includes/upload/',
$IP . '/tests/',
$IP . '/tests/parser/',
$IP . '/tests/phpunit/suites/',
- $IP . '/skins/',
- $IP . '/skins/MonoBook/',
- $IP . '/skins/Vector/',
);
foreach ( $pathinc as $dir ) {
public function finalSetup() {
parent::finalSetup();
- $this->regex = $this->getOption( 'regex' ) ? : $this->getOption( 'iregex' );
+ $this->regex = $this->getOption( 'regex' ) ?: $this->getOption( 'iregex' );
if ( $this->regex ) {
$this->regex = '/' . $this->regex . '/';
if ( $this->hasOption( 'iregex' ) ) {
--- /dev/null
+ALTER TABLE /*_*/filearchive
+DROP CONSTRAINT fa_major_mime_ckc;
+ALTER TABLE /*_*/filearchive
+WITH NOCHECK ADD CONSTRAINT fa_major_mime_ckc CHECK (fa_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical'));
\ No newline at end of file
--- /dev/null
+ALTER TABLE /*_*/image
+DROP CONSTRAINT img_major_mime_ckc;
+ALTER TABLE /*_*/image
+WITH NOCHECK ADD CONSTRAINT img_major_mime_ckc CHECK (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical'));
\ No newline at end of file
--- /dev/null
+ALTER TABLE /*_*/oldimage
+DROP CONSTRAINT oi_major_mime_ckc;
+ALTER TABLE /*_*/oldimage
+WITH NOCHECK ADD CONSTRAINT oi_major_mime_ckc CHECK (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical'));
\ No newline at end of file
-- SHA-1 content hash in base-36
img_sha1 nvarchar(32) NOT NULL default '',
- CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')),
+ CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
CONSTRAINT img_media_type_ckc check (img_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
);
oi_deleted tinyint NOT NULL default 0,
oi_sha1 nvarchar(32) NOT NULL default '',
- CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')),
+ CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
CONSTRAINT oi_media_type_ckc check (oi_media_type IN('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
);
-- sha1 hash of file content
fa_sha1 nvarchar(32) NOT NULL default '',
- CONSTRAINT fa_major_mime_ckc check (fa_major_mime in('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')),
+ CONSTRAINT fa_major_mime_ckc check (fa_major_mime in('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
CONSTRAINT fa_media_type_ckc check (fa_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
);
--- /dev/null
+-- Update keys for Microsoft SQL Server
+-- SQL to insert update keys into the initial tables after a
+-- fresh installation of MediaWiki's database.
+-- This is read and executed by the install script; you should
+-- not have to run it by itself unless doing a manual install.
+-- Insert keys here if either the unnecessary would cause heavy
+-- processing or could potentially cause trouble by lowering field
+-- sizes, adding constraints, etc.
+-- When adjusting field sizes, it is recommended removing old
+-- patches but to play safe, update keys should also inserted here.
+
+--
+-- The /*_*/ comments in this and other files are
+-- replaced with the defined table prefix by the installer
+-- and updater scripts. If you are installing or running
+-- updates manually, you will need to manually insert the
+-- table prefix if any when running these scripts.
+--
+
+INSERT INTO /*_*/updatelog
+ SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value
+ UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null
+ UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null
+ UNION SELECT 'cl_type-category_types-ck', null
+ UNION SELECT 'fa_major_mime-major_mime-ck', null
+ UNION SELECT 'fa_media_type-media_type-ck', null
+ UNION SELECT 'img_major_mime-major_mime-ck', null
+ UNION SELECT 'img_media_type-media_type-ck', null
+ UNION SELECT 'oi_major_mime-major_mime-ck', null
+ UNION SELECT 'oi_media_type-media_type-ck', null
+ UNION SELECT 'us_media_type-media_type-ck', null;
\ No newline at end of file
}
public function execute() {
- $wiki = $this->getOption( 'wikidb' ) ? : false;
+ $wiki = $this->getOption( 'wikidb' ) ?: false;
// Get the appropriate load balancer (for this wiki)
if ( $this->hasOption( 'cluster' ) ) {
$lb = wfGetLBFactory()->getExternalLB( $this->getOption( 'cluster' ), $wiki );
-- major part of a MIME media type as defined by IANA
-- see http://www.iana.org/assignments/media-types/
- img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
+ -- for "chemical" cf. http://dx.doi.org/10.1021/ci9803233 by the ACS
+ img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") NOT NULL default "unknown",
-- minor part of a MIME media type as defined by IANA
-- the minor parts are not required to adher to any standard
oi_metadata mediumblob NOT NULL,
oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
- oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
+ oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") NOT NULL default "unknown",
oi_minor_mime varbinary(100) NOT NULL default "unknown",
oi_deleted tinyint unsigned NOT NULL default 0,
oi_sha1 varbinary(32) NOT NULL default ''
fa_metadata mediumblob,
fa_bits int default 0,
fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
- fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
+ fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") default "unknown",
fa_minor_mime varbinary(100) default "unknown",
fa_description tinyblob,
fa_user int unsigned default 0,
--- /dev/null
+-- SQL to insert update keys into the initial tables after a
+-- fresh installation of MediaWiki's database.
+-- This is read and executed by the install script; you should
+-- not have to run it by itself unless doing a manual install.
+-- Insert keys here if either the unnecessary would cause heavy
+-- processing or could potentially cause trouble by lowering field
+-- sizes, adding constraints, etc.
+-- When adjusting field sizes, it is recommended removing old
+-- patches but to play safe, update keys should also inserted here.
+
+-- This is a shared file used for both MySQL and SQLite installs.
+-- Therefore inserting multiple values is not possible using the
+-- INSERT INTO VALUES syntax.
+--
+--
+-- The /*_*/ comments in this and other files are
+-- replaced with the defined table prefix by the installer
+-- and updater scripts. If you are installing or running
+-- updates manually, you will need to manually insert the
+-- table prefix if any when running these scripts.
+--
+
+INSERT INTO /*_*/updatelog
+ SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value
+ UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null
+ UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null
+ UNION SELECT 'user_groups-ug_group-patch-ug_group-length-increase-255.sql', null
+ UNION SELECT 'user_former_groups-ufg_group-patch-ufg_group-length-increase-255.sql', null
+ UNION SELECT 'user_properties-up_property-patch-up_property.sql', null;
\ No newline at end of file
( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 7 ) ||
// Firefox < 3
( ua.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua.split( 'Firefox/' )[1] ) < 3 ) ||
+ // Opera < 12
+ ( ua.indexOf( 'Opera/' ) !== -1 && ( ua.indexOf( 'Version/' ) === -1 ?
+ // "Opera/x.y"
+ parseFloat( ua.split( 'Opera/' )[1] ) < 10 :
+ // "Opera/9.80 ... Version/x.y"
+ parseFloat( ua.split( 'Version/' )[1] ) < 12
+ ) ) ||
+ // "Mozilla/0.0 ... Opera x.y"
+ ( ua.indexOf( 'Opera ' ) !== -1 && parseFloat( ua.split( ' Opera ' )[1] ) < 10 ) ||
// BlackBerry < 6
ua.match( /BlackBerry[^\/]*\/[1-5]\./ ) ||
// Open WebOS < 1.5
'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1',
// Safari 5.0+
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru) AppleWebKit/534.31+ (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1',
- // Opera 11+
- 'Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.8.131 Version/11.10',
+ // Opera 12+ (Presto-based)
+ 'Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00',
+ 'Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.17',
+ // Opera 15+ (Chromium-based)
+ 'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36 OPR/15.0.1147.153',
+ 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36 OPR/16.0.1196.62',
+ 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 OPR/23.0.1522.75',
// Internet Explorer 7+
'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)',
'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;)',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)',
'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)',
- // Firefox < 3.6
+ // Firefox < 3
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2',
'Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.8.1.1) Gecko/20070311 Firefox/2.0.0.1',
+ // Opera < 12
+ 'Mozilla/5.0 (Windows NT 5.0; U) Opera 7.54 [en]',
+ 'Opera/7.54 (Windows NT 5.0; U) [en]',
+ 'Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.0',
+ 'Opera/8.0 (X11; Linux i686; U; cs)',
+ 'Opera/9.00 (X11; Linux i686; U; de)',
+ 'Opera/9.62 (X11; Linux i686; U; en) Presto/2.1.1',
+ 'Opera/9.80 (Windows NT 6.1; U; en) Presto/2.2.15 Version/10.00',
+ 'Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.8.131 Version/11.10',
+ 'Opera/9.80 (Windows NT 6.1; WOW64; U; pt) Presto/2.10.229 Version/11.62',
// BlackBerry < 6
'BlackBerry9300/5.0.0.716 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/133',
'BlackBerry7250/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1',