* (bug 39273) Added AJAX support for "Show changes" (diff) in LivePreview.
* Added ResourceLoader module "jquery.badge".
* mw.util.$content now points to the overall content area in the skin rather than just
- page text content area. If you need the old behaviour please use $( '#mw-content-text').
+ page text content area. If you need the old behavior please use $( '#mw-content-text').
* jsMessage has been replaced with a floating bubble notification system complete
with auto-hide, multi-message support, and message replacement tags.
* jquery.messageBox which appears to be unused by both core and extensions has
* New maintenance script to refresh image metadata (maintenance/refreshImageMetadata.php).
* (bug 16428) Include permalink in printable version.
* (bug 30722) Add an identity collation that sorts things based on what the
- unicode code point is (aka pre-1.17 behaviour).
+ unicode code point is (aka pre-1.17 behavior).
* (bug 30940) Add a hook in User:getDefaultOptions.
To give extensions a better and more flexible way of providing default
values for preferences a hook has been introdiced in User:getDefaultOptions().
make wfTempDir() return a sane value for Windows on worst-case.
* (bug 24824) Support ImageMagick 6.5.6-2+ JPEG decoder size hint, to reduce
memory usage when such an ImageMagick is used for scaling.
-* Disable multithreaded behaviour in recent ImageMagick, to avoid a deadlock
+* Disable multithreaded behavior in recent ImageMagick, to avoid a deadlock
when a resource limit such as $wgMaxShellMemory is hit.
* (bug 24981) Allow extensions to access SpecialUpload variables again.
* (bug 20744) Wiki forgets about an uploaded file.
exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to
it as appropriate.
* If $wgLocaltimezone is null, use the server's timezone as the default for
- signatures. This was always the behaviour documented in DefaultSettings.php
- but has not been the actual behaviour for some time: instead, UTC was used
+ signatures. This was always the behavior documented in DefaultSettings.php
+ but has not been the actual behavior for some time: instead, UTC was used
by default.
* Added $wgExtensionAssetsPath, to decouple assets serving from $wgScriptPath.
If not specified it will default to $wgScriptPath/extensions
* (bug 12644) Template list on edit page now sorted on preview
* (bug 14058) Support pipe trick for namespaces and interwikis with "-"
* Message name filter on Special:Allmessages now case-insensitive
-* (bug 13943) Fix image redirect behaviour on image pages
+* (bug 13943) Fix image redirect behavior on image pages
* (bug 14093) Do 'sysop' => 'protect' magic in Title::isValidMoveOperation
* (bug 14063) Power search form missing <label> for redirects check
* (bug 14111) Similar filename warning links now lead to correct page
to not check and assume they are always up to date)
* The rollback permission can now be rate-limited using the normal mechanism.
* New configuration variable $wgExtraLanguageNames
-* Behaviour of $wgAddGroups and $wgRemoveGroups changed. New behaviour:
+* Behavior of $wgAddGroups and $wgRemoveGroups changed. New behavior:
* * Granting the userrights privilege allows arbitrary changing of rights.
* * Without the userrights privilege, a user will be able to add and/or
remove the groups specified in $wgAddGroups and $wgRemoveGroups for
Message transformation mode has been removed, and replaced with "preprocess"
mode. This means that some MediaWiki namespace messages may need to be updated,
-especially ones which took advantage of the terribly counterintuitive behaviour
+especially ones which took advantage of the terribly counterintuitive behavior
of the former message mode.
The header identification routines for section edit and for numbering section
entry in the TOC, but will not have a section edit link. HTML-style headings
will also not have a section edit link. Valid wikitext headings present in the
template source text will get a template section edit link. This is a major
-break from previous behaviour, but I believe the effects are almost entirely
+break from previous behavior, but I believe the effects are almost entirely
beneficial.
The main motivation for making these changes was performance. The new two-pass
enabled by default.
* Added option to install to MyISAM
* (bug 9250) Remove hardcoded minimum image name length of three characters
-* Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the
+* Fixed DISPLAYTITLE behavior to reject titles which don't normalise to the
same title as the current page, and enabled per default
* Wrap site CSS and JavaScript in a <pre> tag, like user JS/CSS
* (bug 10196) Add classes and dir="ltr" to the <pre>s on CSS and JS pages (new
* Fix upload form display in right-to-left languages
* Fixed regression in blocking of username '0'
* (bug 9437) Don't overwrite edit form submission handler when setting up
- edit box scroll position preserve/restore behaviour
+ edit box scroll position preserve/restore behavior
* (bug 10805) Fix "undo" link when viewing the diff of the most recent
change to a page using "diff=0"
* (bug 10765) img_auth.php will now refuse logged-out requests where
to image/svg+xml after loading from the database.
* Workaround for djvutoxml bug #1704049 (poor performance). Use djvudump
instead.
-* Fixed odd behaviour in ImagePage on DjVu thumbnailing errors
+* Fixed odd behavior in ImagePage on DjVu thumbnailing errors
* (bug 5439) "Go" title search will now jump to shared/foreign Image: and
MediaWiki: pages that have not been locally edited.
* (bug 9630) Limits links in Whatlinkshere forgot about namespace filter
* New maintenance script to show the cached statistics : showStats.php.
* Count deleted edits when regenerating total edits in maintenance/initStats.php
* (bug 3706) Allow users to be exempted from IP blocks. The ipblock-exempt permission
- key has been added to enable this behaviour, by default assigned to sysops.
+ key has been added to enable this behavior, by default assigned to sysops.
* (bug 7948) importDump.php now warn that Recentchanges need to be rebuild.
* (bug 7667) allow XHTML namespaces customization
* (bug 8531) Correct local name of Lingála (patch by Raymond)
* (bug 6642) Don't offer to unlock the database when it isn't locked
* cleanupTitles.php changed from --dry-run option to --fix, so default
behavior is now a non-invasive check as with namespaceDupes.php
-* (bug 6660) Fix behaviour of EditPage::blockedPage() when the article does
+* (bug 6660) Fix behavior of EditPage::blockedPage() when the article does
not exist; now doesn't show the source box if the user hasn't provided it
(blocked mid-edit) and the page doesn't exist
* Improve default value of "blockedtext"
* (bug 6023) Fixed mismatch of 0/NULL for wl_notificationtimestamp; now notification
mails are working after 'Mark all pages visited' button on Special:Watchlist is clicked
* Made {{INT:}} a core parser function instead of a special case. The syntax
- and behaviour is largely unchanged.
+ and behavior is largely unchanged.
* (bug 7448) Fixing the native name for Ewe (ee)
* (bug 6864) Replace message 'editing' with new message 'editinguser' in Special:Userrights
to allow better localisation
* (bug 1283) Use underlining and borders to highlight additions/deletions
in diff-view
* Use user's local timezone in Special:Log display
-* Show filename for images in gallery by default (restore beta 3 behaviour)
+* Show filename for images in gallery by default (restore beta 3 behavior)
* (bug 1201) Double-escaping in brokenlinks, imagelinks, categorylinks, searchindex
* When using squid reverse proxy, cache the redirect to the Main_Page
* (bug 1302) Fix Norwegian language file
* (bug 5346) Categories that are redirects will be displayed italic in
the category links section at the bottom of a page.
* (bug 43915) New maintenance script deleteEqualMessages.php.
+* You can now create checkbox option matrixes through the HTMLCheckMatrix
+ subclass in HTMLForm.
* WikiText now permits the use of WAI-ARIA's role="presentation" inside of
html elements and tables. This allows presentational markup, especially
tables. To be marked up as such.
gl, hr, hsb, hu, is, it, kk, kl, ku, ky, la, lb, lt, lv, mk, mo, mt, nl, no,
oc, pl, pt, rm, ro, ru, rup, sco, sk, sl, smn, sq, sr, sv, tk, tl, tr, tt, uk,
uz, vi.
+* Added 'CategoryAfterPageAdded' and 'CategoryAfterPageRemoved' hooks.
=== Bug fixes in 1.21 ===
* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
"password mismatch" error.
* (bug 44599) On Special:Version, HEADs for submodule checkouts (e.g. for
extensions) performed using Git 1.7.8+ should now appear.
+* (bug 42184) $wgUploadSizeWarning missing second variable
+* (bug 40326) Check if files exist with a different extension during uploading
=== API changes in 1.21 ===
* prop=revisions can now report the contentmodel and contentformat.
an error during parameter validation if the parameter is given but not
recognized as an uploaded file.
* (bug 44244) prop=info may now return the number of people watching each page.
+* (bug 33304) list=allpages will no longer return duplicate entries when
+ querying protection.
=== API internal changes in 1.21 ===
* For debugging only, a new global $wgDebugAPI removes many API restrictions when true.
Vector extension (and possibly disable its features using config settings if
you don't want them).
* Experimental IBM DB2 support was removed due to lack of interest and maintainership
+* BREAKING CHANGE: Filenames of maintenance scripts were standardized into lowerCamelCase
+ format, and made more explicit: clear_stats.php -> clearCacheStats.php;
+ clear_interwiki_cache.php -> clearInterwikiCache.php; initStats.php -> initSiteStats.php;
+ proxy_check.php -> proxyCheck.php; stats.php -> showCacheStats.php;
+ showStats.php -> showSiteStats.php. Class names were renamed accordingly:
+ clear_stats -> ClearCacheStats; InitStats -> InitSiteStats; CacheStats -> ShowCacheStats
+ ShowStats -> ShowSiteStats.
== Compatibility ==
can change between release branches, e.g. $wgDisableUploads in 1.4 is replaced
with $wgEnableUploads in later versions. When upgrading, consult the release
notes to check for configuration changes which would alter the expected
-behaviour of MediaWiki.
+behavior of MediaWiki.
=== Check installed extensions ===
the defaults.
&$namespaces: Array of namespace numbers with corresponding canonical names
+'CategoryAfterPageAdded': After a page is added to a category.
+$category: Category that page was added to
+$wikiPage: WikiPage that was added
+
+'CategoryAfterPageRemoved': After a page is removed from a category.
+$category: Category that page was removed from
+$wikiPage: WikiPage that was removed
+
'CategoryPageView': Before viewing a categorypage in CategoryPage::view.
$catpage: CategoryPage instance
Title::isCssOrJsPage().
'TitleIsAlwaysKnown': Called when determining if a page exists. Allows
-overriding default behaviour for determining if a page exists. If $isKnown is
+overriding default behavior for determining if a page exists. If $isKnown is
kept as null, regular checks happen. If it's a boolean, this value is returned
by the isKnown method.
$title: Title object that is being checked
level /maintenance directory.
Example:
- php clear_stats.php
+ php clearCacheStats.php
The following parameters are available to all maintenance scripts
--help : Print a help message
controlled by: $wgStatsMethod
key: $wgDBname:stats:$key
ex: wikibd:stats:request_with_session
- stores: counter for statistics (see maintenance/stats.php script)
+ stores: counter for statistics (see maintenance/showCacheStats.php script)
expiry: none (?)
- cleared by: maintenance/clear_stats.php script
+ cleared by: maintenance/clearCacheStats.php script
User:
key: $wgDBname:user:id:$sId
protected function alterForm( HTMLForm $form ) {}
/**
- * Get the HTMLForm to control behaviour
+ * Get the HTMLForm to control behavior
* @return HTMLForm|null
*/
protected function getForm() {
* some stuff underneath (history etc); to do some processing on submission of that
* form (delete, protect, etc) and to do something exciting on 'success', be that
* display something new or redirect to somewhere. Some actions have more exotic
- * behaviour, but that's what subclassing is for :D
+ * behavior, but that's what subclassing is for :D
*/
public function show() {
$this->setHeaders();
* various consistent hash implementations that existed before this
* function was introduced.
*/
- static function consistentHashSort( &$array, $key, $separator = "\000" ) {
+ public static function consistentHashSort( &$array, $key, $separator = "\000" ) {
$hashes = array();
foreach ( $array as $elt ) {
$hashes[$elt] = md5( $elt . $separator . $key );
return strcmp( $hashes[$a], $hashes[$b] );
} );
}
+
+ /**
+ * Given an array of non-normalised probabilities, this function will select
+ * an element and return the appropriate key
+ *
+ * @param $weights array
+ *
+ * @return bool|int|string
+ */
+ public static function pickRandom( $weights ){
+ if ( !is_array( $weights ) || count( $weights ) == 0 ) {
+ return false;
+ }
+
+ $sum = array_sum( $weights );
+ if ( $sum == 0 ) {
+ # No loads on any of them
+ # In previous versions, this triggered an unweighted random selection,
+ # but this feature has been removed as of April 2006 to allow for strict
+ # separation of query groups.
+ return false;
+ }
+ $max = mt_getrandmax();
+ $rand = mt_rand( 0, $max ) / $max * $sum;
+
+ $sum = 0;
+ foreach ( $weights as $i => $w ) {
+ $sum += $w;
+ # Do not return keys if they have 0 weight.
+ # Note that the "all 0 weight" case is handed above
+ if ( $w > 0 && $sum >= $rand ) {
+ break;
+ }
+ }
+ return $i;
+ }
}
'Html' => 'includes/Html.php',
'HTMLApiField' => 'includes/HTMLForm.php',
'HTMLCheckField' => 'includes/HTMLForm.php',
+ 'HTMLCheckMatrix' => 'includes/HTMLForm.php',
'HTMLEditTools' => 'includes/HTMLForm.php',
'HTMLFloatField' => 'includes/HTMLForm.php',
'HTMLForm' => 'includes/HTMLForm.php',
# the collation in the database differs from the one
# set in $wgCategoryCollation, pagination might go totally haywire.
$extraConds = array( 'cl_type' => $type );
- if ( $this->from[$type] !== null ) {
+ if ( isset( $this->from[$type] ) && $this->from[$type] !== null ) {
$extraConds[] = 'cl_sortkey >= '
. $dbr->addQuotes( $this->collation->getSortKey( $this->from[$type] ) );
- } elseif ( $this->until[$type] !== null ) {
+ } elseif ( isset( $this->until[$type] ) && $this->until[$type] !== null ) {
$extraConds[] = 'cl_sortkey < '
. $dbr->addQuotes( $this->collation->getSortKey( $this->until[$type] ) );
$this->flip[$type] = true;
* @return String: HTML output, possibly empty if there are no other pages
*/
private function getSectionPagingLinks( $type ) {
- if ( $this->until[$type] !== null ) {
+ if ( isset( $this->until[$type] ) && $this->until[$type] !== null ) {
return $this->pagingLinks( $this->nextPage[$type], $this->until[$type], $type );
- } elseif ( $this->nextPage[$type] !== null || $this->from[$type] !== null ) {
+ } elseif ( $this->nextPage[$type] !== null || ( isset( $this->from[$type] ) && $this->from[$type] !== null ) ) {
return $this->pagingLinks( $this->from[$type], $this->nextPage[$type], $type );
} else {
return '';
}
$fromOrUntil = false;
- if ( $this->from[$pagingType] !== null || $this->until[$pagingType] !== null ) {
+ if ( ( isset( $this->from[$pagingType] ) && $this->from[$pagingType] !== null ) ||
+ ( isset( $this->until[$pagingType] ) && $this->until[$pagingType] !== null )
+ ) {
$fromOrUntil = true;
}
/**
* Store sessions in an object cache, configured by $wgSessionCacheType. This
- * can be useful to improve performance, or to avoid the locking behaviour of
+ * can be useful to improve performance, or to avoid the locking behavior of
* PHP's default session handler, which tends to prevent multiple requests for
* the same user from acting concurrently.
*/
* change it in their preferences.
*
* This also defines the language of pages in the wiki. The content is wrapped
- * in a html element with lang=XX attribute. This behaviour can be overriden
+ * in a html element with lang=XX attribute. This behavior can be overriden
* via hooks, see Title::getPageLanguage.
*/
$wgLanguageCode = 'en';
/** Port we want to scan for a proxy */
$wgProxyPorts = array( 80, 81, 1080, 3128, 6588, 8000, 8080, 8888, 65506 );
/** Script used to scan */
-$wgProxyScriptPath = "$IP/maintenance/proxy_check.php";
+$wgProxyScriptPath = "$IP/maintenance/proxyCheck.php";
/** */
$wgProxyMemcExpiry = 86400;
/** This should always be customised in LocalSettings.php */
/**
* Path to the GNU diff3 utility. If the file doesn't exist, edit conflicts will
- * fall back to the old behaviour (no merging).
+ * fall back to the old behavior (no merging).
*/
$wgDiff3 = '/usr/bin/diff3';
/**
* Map of job types to configuration arrays.
+ * This determines which queue class and storage system is used for each job type.
+ * Job types that do not have explicit configuration will use the 'default' config.
* These settings should be global to all wikis.
*/
$wgJobTypeConf = array(
// Nothing *to* preview for new sections
return false;
} elseif ( ( $wgRequest->getVal( 'preload' ) !== null || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
- // Standard preference behaviour
+ // Standard preference behavior
return true;
} elseif ( !$this->mTitle->exists() &&
isset( $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] ) &&
return substr( $str, 0, $length );
}
-/**
- * Given an array of non-normalised probabilities, this function will select
- * an element and return the appropriate key
- *
- * @param $weights array
- *
- * @return bool|int|string
- */
-function wfPickRandom( $weights ){
- if ( !is_array( $weights ) || count( $weights ) == 0 ) {
- return false;
- }
-
- $sum = array_sum( $weights );
- if ( $sum == 0 ) {
- # No loads on any of them
- # In previous versions, this triggered an unweighted random selection,
- # but this feature has been removed as of April 2006 to allow for strict
- # separation of query groups.
- return false;
- }
- $max = mt_getrandmax();
- $rand = mt_rand( 0, $max ) / $max * $sum;
-
- $sum = 0;
- foreach ( $weights as $i => $w ) {
- $sum += $w;
- if ( $sum >= $rand ) {
- break;
- }
- }
- return $i;
-}
-
/**
* We want some things to be included as literal characters in our title URLs
* for prettiness, which urlencode encodes by default. According to RFC 1738,
'submit' => 'HTMLSubmitField',
'hidden' => 'HTMLHiddenField',
'edittools' => 'HTMLEditTools',
+ 'checkmatrix' => 'HTMLCheckMatrix',
// HTMLTextField will output the correct type="" attribute automagically.
// There are about four zillion other HTML5 input types, like url, but
$hasLabel = true;
}
} elseif ( is_array( $value ) ) {
- $section = $this->displaySection( $value, $key );
+ $section = $this->displaySection( $value, $key, "$fieldsetIDPrefix$key-" );
$legend = $this->getLegend( $key );
if ( isset( $this->mSectionHeaders[$key] ) ) {
$section = $this->mSectionHeaders[$key] . $section;
}
}
+/**
+ * A checkbox matrix
+ * Operates similarly to HTMLMultiSelectField, but instead of using an array of
+ * options, uses an array of rows and an array of columns to dynamically
+ * construct a matrix of options.
+ */
+class HTMLCheckMatrix extends HTMLFormField {
+
+ function validate( $value, $alldata ) {
+ $rows = $this->mParams['rows'];
+ $columns = $this->mParams['columns'];
+
+ // Make sure user-defined validation callback is run
+ $p = parent::validate( $value, $alldata );
+ if ( $p !== true ) {
+ return $p;
+ }
+
+ // Make sure submitted value is an array
+ if ( !is_array( $value ) ) {
+ return false;
+ }
+
+ // If all options are valid, array_intersect of the valid options
+ // and the provided options will return the provided options.
+ $validOptions = array();
+ foreach ( $rows as $rowTag ) {
+ foreach ( $columns as $columnTag ) {
+ $validOptions[] = $columnTag . '-' . $rowTag;
+ }
+ }
+ $validValues = array_intersect( $value, $validOptions );
+ if ( count( $validValues ) == count( $value ) ) {
+ return true;
+ } else {
+ return $this->msg( 'htmlform-select-badoption' )->parse();
+ }
+ }
+
+ /**
+ * Build a table containing a matrix of checkbox options.
+ * The value of each option is a combination of the row tag and column tag.
+ * mParams['rows'] is an array with row labels as keys and row tags as values.
+ * mParams['columns'] is an array with column labels as keys and column tags as values.
+ * @param $value Array of the options that should be checked
+ * @return String
+ */
+ function getInputHTML( $value ) {
+ $html = '';
+ $tableContents = '';
+ $attribs = array();
+ $rows = $this->mParams['rows'];
+ $columns = $this->mParams['columns'];
+
+ // If the disabled param is set, disable all the options
+ if ( !empty( $this->mParams['disabled'] ) ) {
+ $attribs['disabled'] = 'disabled';
+ }
+
+ // Build the column headers
+ $headerContents = Html::rawElement( 'td', array(), ' ' );
+ foreach ( $columns as $columnLabel => $columnTag ) {
+ $headerContents .= Html::rawElement( 'td', array(), $columnLabel );
+ }
+ $tableContents .= Html::rawElement( 'tr', array(), "\n$headerContents\n" );
+
+ // Build the options matrix
+ foreach ( $rows as $rowLabel => $rowTag ) {
+ $rowContents = Html::rawElement( 'td', array(), $rowLabel );
+ foreach ( $columns as $columnTag ) {
+ // Knock out any options that are not wanted
+ if ( isset( $this->mParams['remove-options'] )
+ && in_array( "$columnTag-$rowTag", $this->mParams['remove-options'] ) )
+ {
+ $rowContents .= Html::rawElement( 'td', array(), ' ' );
+ } else {
+ // Construct the checkbox
+ $thisAttribs = array(
+ 'id' => "{$this->mID}-$columnTag-$rowTag",
+ 'value' => $columnTag . '-' . $rowTag
+ );
+ $checkbox = Xml::check(
+ $this->mName . '[]',
+ in_array( $columnTag . '-' . $rowTag, (array)$value, true ),
+ $attribs + $thisAttribs );
+ $rowContents .= Html::rawElement( 'td', array(), $checkbox );
+ }
+ }
+ $tableContents .= Html::rawElement( 'tr', array(), "\n$rowContents\n" );
+ }
+
+ // Put it all in a table
+ $html .= Html::rawElement( 'table', array( 'class' => 'mw-htmlform-matrix' ),
+ Html::rawElement( 'tbody', array(), "\n$tableContents\n" ) ) . "\n";
+
+ return $html;
+ }
+
+ /**
+ * Get the complete table row for the input, including help text,
+ * labels, and whatever.
+ * We override this function since the label should always be on a separate
+ * line above the options in the case of a checkbox matrix, i.e. it's always
+ * a "vertical-label".
+ * @param $value String the value to set the input to
+ * @return String complete HTML table row
+ */
+ function getTableRow( $value ) {
+ list( $errors, $errorClass ) = $this->getErrorsAndErrorClass( $value );
+ $inputHtml = $this->getInputHTML( $value );
+ $fieldType = get_class( $this );
+ $helptext = $this->getHelpTextHtmlTable( $this->getHelpText() );
+ $cellAttributes = array( 'colspan' => 2 );
+
+ $label = $this->getLabelHtml( $cellAttributes );
+
+ $field = Html::rawElement(
+ 'td',
+ array( 'class' => 'mw-input' ) + $cellAttributes,
+ $inputHtml . "\n$errors"
+ );
+
+ $html = Html::rawElement( 'tr',
+ array( 'class' => 'mw-htmlform-vertical-label' ), $label );
+ $html .= Html::rawElement( 'tr',
+ array( 'class' => "mw-htmlform-field-$fieldType {$this->mClass} $errorClass" ),
+ $field );
+
+ return $html . $helptext;
+ }
+
+ /**
+ * @param $request WebRequest
+ * @return Array
+ */
+ function loadDataFromRequest( $request ) {
+ if ( $this->mParent->getMethod() == 'post' ) {
+ if ( $request->wasPosted() ) {
+ // Checkboxes are not added to the request arrays if they're not checked,
+ // so it's perfectly possible for there not to be an entry at all
+ return $request->getArray( $this->mName, array() );
+ } else {
+ // That's ok, the user has not yet submitted the form, so show the defaults
+ return $this->getDefault();
+ }
+ } else {
+ // This is the impossible case: if we look at $_GET and see no data for our
+ // field, is it because the user has not yet submitted the form, or that they
+ // have submitted it with all the options unchecked. We will have to assume the
+ // latter, which basically means that you can't specify 'positive' defaults
+ // for GET forms.
+ return $request->getArray( $this->mName, array() );
+ }
+ }
+
+ function getDefault() {
+ if ( isset( $this->mDefault ) ) {
+ return $this->mDefault;
+ } else {
+ return array();
+ }
+ }
+}
+
/**
* A select dropdown field. Basically a wrapper for Xmlselect class
*/
if ( $file && isset( $fp['frameless'] ) ) {
$srcWidth = $file->getWidth( $page );
# For "frameless" option: do not present an image bigger than the source (for bitmap-style images)
- # This is the same behaviour as the "thumb" option does it already.
+ # This is the same behavior as the "thumb" option does it already.
if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) {
$hp['width'] = $srcWidth;
}
$noscale = true;
} else {
# Do not present an image bigger than the source, for bitmap-style images
- # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour
+ # This is a hack to maintain compatibility with arbitrary pre-1.10 behavior
$srcWidth = $file->getWidth( $page );
if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) {
$hp['width'] = $srcWidth;
static function getOptionFromUser( $name, $info, $user ) {
$val = $user->getOption( $name );
- // Handling for array-type preferences
+ // Handling for multiselect preferences
if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) {
$options = HTMLFormField::flattenOptions( $info['options'] );
}
}
+ // Handling for checkmatrix preferences
+ if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) ||
+ ( isset( $info['class'] ) && $info['class'] == 'HTMLCheckMatrix' ) ) {
+ $columns = HTMLFormField::flattenOptions( $info['columns'] );
+ $rows = HTMLFormField::flattenOptions( $info['rows'] );
+ $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
+ $val = array();
+
+ foreach ( $columns as $column ) {
+ foreach ( $rows as $row ) {
+ if ( $user->getOption( "$prefix-$column-$row" ) ) {
+ $val[] = "$column-$row";
+ }
+ }
+ }
+ }
+
return $val;
}
* @return array
*/
function filterDataForSubmit( $data ) {
- // Support for separating MultiSelect preferences into multiple preferences
+ // Support for separating multi-option preferences into multiple preferences
// Due to lack of array support.
foreach ( $this->mFlatFields as $fieldname => $field ) {
$info = $field->mParams;
+
if ( $field instanceof HTMLMultiSelectField ) {
$options = HTMLFormField::flattenOptions( $info['options'] );
$prefix = isset( $info['prefix'] ) ? $info['prefix'] : $fieldname;
$data["$prefix$opt"] = in_array( $opt, $data[$fieldname] );
}
+ unset( $data[$fieldname] );
+
+ } elseif ( $field instanceof HTMLCheckMatrix ) {
+ $columns = HTMLFormField::flattenOptions( $info['columns'] );
+ $rows = HTMLFormField::flattenOptions( $info['rows'] );
+ $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $fieldname;
+ foreach ( $columns as $column ) {
+ foreach ( $rows as $row ) {
+ // Make sure option hasn't been removed
+ if ( !isset( $info['remove-options'] )
+ || !in_array( "$column-$row", $info['remove-options'] ) )
+ {
+ $data["$prefix-$column-$row"] = in_array( "$column-$row", $data[$fieldname] );
+ }
+ }
+ }
+
unset( $data[$fieldname] );
}
}
if ( $wgContentHandlerUseDB ) {
//NOTE: Store null for the default model and format, to save space.
- //XXX: Makes the DB sensitive to changed defaults. Make this behaviour optional? Only in miser mode?
+ //XXX: Makes the DB sensitive to changed defaults. Make this behavior optional? Only in miser mode?
$model = $this->getContentModel();
$format = $this->getContentFormat();
return '';
}
- # __NEWSECTIONLINK___ changes behaviour here
+ # __NEWSECTIONLINK___ changes behavior here
# If it is present, the link points to this page, otherwise
# it points to the talk page
if ( !$title->isTalkPage() && !$wgOut->showNewSectionLink() ) {
* be displayed by the default execute() method, without the global function ever
* being called.
*
- * If you override execute(), you can recover the default behaviour with userCanExecute()
+ * If you override execute(), you can recover the default behavior with userCanExecute()
* and displayRestrictionError()
*
* @param $name String: name of the special page, as seen in links and URLs
* also the name that will be listed in Special:Specialpages
*
* Derived classes can override this, but usually it is easier to keep the
- * default behaviour. Messages can be added at run-time, see
+ * default behavior. Messages can be added at run-time, see
* MessageCache.php.
*
* @return String
}
/**
- * Get the HTMLForm to control behaviour
+ * Get the HTMLForm to control behavior
* @return HTMLForm|null
*/
protected function getForm() {
* memory. The delimiters are literal strings, not regular expressions.
*
* If the start delimiter ends with an initial substring of the end delimiter,
- * e.g. in the case of C-style comments, the behaviour differs from the model
+ * e.g. in the case of C-style comments, the behavior differs from the model
* regex. In this implementation, the end must share no characters with the
* start, so e.g. /*\/ is not considered to be both the start and end of a
* comment. /*\/xy/*\/ is considered to be a single comment with contents /xy/.
$isKnown = null;
/**
- * Allows overriding default behaviour for determining if a page exists.
+ * Allows overriding default behavior for determining if a page exists.
* If $isKnown is kept as null, regular checks happen. If it's
* a boolean, this value is returned by the isKnown method.
*
* - 'registered' - preferences which are registered in core MediaWiki or
* by extensions using the UserGetDefaultOptions hook.
* - 'registered-multiselect' - as above, using the 'multiselect' type.
+ * - 'registered-checkmatrix' - as above, using the 'checkmatrix' type.
* - 'userjs' - preferences with names starting with 'userjs-', intended to
* be used by user scripts.
* - 'unused' - preferences about which MediaWiki doesn't know anything.
return array(
'registered',
'registered-multiselect',
+ 'registered-checkmatrix',
'userjs',
'unused'
);
$prefs = Preferences::getPreferences( $this, $context );
$mapping = array();
- // Multiselect options are stored in the database with one key per
- // option, each having a boolean value. Extract those keys.
+ // Multiselect and checkmatrix options are stored in the database with
+ // one key per option, each having a boolean value. Extract those keys.
$multiselectOptions = array();
foreach ( $prefs as $name => $info ) {
if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
unset( $prefs[$name] );
}
}
+ $checkmatrixOptions = array();
+ foreach ( $prefs as $name => $info ) {
+ if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) ||
+ ( isset( $info['class'] ) && $info['class'] == 'HTMLCheckMatrix' ) ) {
+ $columns = HTMLFormField::flattenOptions( $info['columns'] );
+ $rows = HTMLFormField::flattenOptions( $info['rows'] );
+ $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
+
+ foreach ( $columns as $column ) {
+ foreach ( $rows as $row ) {
+ $checkmatrixOptions["$prefix-$column-$row"] = true;
+ }
+ }
+
+ unset( $prefs[$name] );
+ }
+ }
// $value is ignored
foreach ( $options as $key => $value ) {
$mapping[$key] = 'registered';
} elseif( isset( $multiselectOptions[$key] ) ) {
$mapping[$key] = 'registered-multiselect';
+ } elseif( isset( $checkmatrixOptions[$key] ) ) {
+ $mapping[$key] = 'registered-checkmatrix';
} elseif ( substr( $key, 0, 7 ) === 'userjs-' ) {
$mapping[$key] = 'userjs';
} else {
* and 'all', which forces a reset of *all* preferences and overrides everything else.
*
* @param $resetKinds array|string which kinds of preferences to reset. Defaults to
- * array( 'registered', 'registered-multiselect', 'unused' )
- * for backwards-compatibility.
+ * array( 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' )
+ * for backwards-compatibility.
* @param $context IContextSource|null context source used when $resetKinds
- * does not contain 'all', passed to getOptionKinds().
- * Defaults to RequestContext::getMain() when null.
+ * does not contain 'all', passed to getOptionKinds().
+ * Defaults to RequestContext::getMain() when null.
*/
public function resetOptions(
- $resetKinds = array( 'registered', 'registered-multiselect', 'unused' ),
+ $resetKinds = array( 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' ),
IContextSource $context = null
) {
$this->load();
$success = true;
}
- # the following code compensates the new behaviour, introduced by the
+ # the following code compensates the new behavior, introduced by the
# enotif patch, that every single watched page needs now to be listed
# in watchlist namespace:page and namespace_talk:page had separate
# entries: clear them
__METHOD__
);
}
+
+ foreach( $added as $catName ) {
+ $cat = Category::newFromName( $catName );
+ wfRunHooks( 'CategoryAfterPageAdded', array( $cat, $this ) );
+ }
+ foreach( $deleted as $catName ) {
+ $cat = Category::newFromName( $catName );
+ wfRunHooks( 'CategoryAfterPageRemoved', array( $cat, $this ) );
+ }
}
/**
*
* Because this class is aimed at verification, an error is raised on
* suspicious or ambiguous input, instead of emulating some standard
- * behaviour.
+ * behavior.
*
* @param $fileName string The archive file name
* @param $callback Array The callback function. It will be called for each file
private $mFakePageId = -1;
private $mCacheMode = 'public';
private $mRequestedPageFields = array();
+ private $mDefaultNamespace = NS_MAIN;
/**
* Constructor
* @param $dbSource ApiBase Module implementing getDB().
* Allows PageSet to reuse existing db connection from the shared state like ApiQuery.
* @param $flags int Zero or more flags like DISABLE_GENERATORS
+ * @param $defaultNamespace int the namespace to use if none is specified by a prefix.
* @since 1.21 accepts $flags instead of two boolean values
*/
- public function __construct( ApiBase $dbSource, $flags = 0 ) {
+ public function __construct( ApiBase $dbSource, $flags = 0, $defaultNamespace = NS_MAIN ) {
parent::__construct( $dbSource->getMain(), $dbSource->getModuleName() );
$this->mDbSource = $dbSource;
$this->mAllowGenerator = ( $flags & ApiPageSet::DISABLE_GENERATORS ) == 0;
+ $this->mDefaultNamespace = $defaultNamespace;
$this->profileIn();
$this->mParams = $this->extractRequestParams();
* @return LinkBatch
*/
private function processTitlesArray( $titles ) {
- $genderCache = GenderCache::singleton();
- $genderCache->doTitlesArray( $titles, __METHOD__ );
-
+ $usernames = array();
$linkBatch = new LinkBatch();
foreach ( $titles as $title ) {
- $titleObj = is_string( $title ) ? Title::newFromText( $title ) : $title;
+ if ( is_string( $title ) ) {
+ $titleObj = Title::newFromText( $title, $this->mDefaultNamespace );
+ } else {
+ $titleObj = $title;
+ }
if ( !$titleObj ) {
// Handle invalid titles gracefully
$this->mAllpages[0][$title] = $this->mFakePageId;
}
$unconvertedTitle = $titleObj->getPrefixedText();
$titleWasConverted = false;
- $iw = $titleObj->getInterwiki();
- if ( strval( $iw ) !== '' ) {
+ if ( $titleObj->isExternal() ) {
// This title is an interwiki link.
- $this->mInterwikiTitles[$titleObj->getPrefixedText()] = $iw;
+ $this->mInterwikiTitles[$unconvertedTitle] = $titleObj->getInterwiki();
} else {
// Variants checking
global $wgContLang;
} elseif ( is_string( $title ) && $title !== $titleObj->getPrefixedText() ) {
$this->mNormalizedTitles[$title] = $titleObj->getPrefixedText();
}
+
+ // Need gender information
+ if ( MWNamespace::hasGenderDistinction( $titleObj->getNamespace() ) ) {
+ $usernames[] = $titleObj->getText();
+ }
}
+ // Get gender information
+ $genderCache = GenderCache::singleton();
+ $genderCache->doQuery( $usernames, __METHOD__ );
return $linkBatch;
}
// TODO: Does this still need $wgTitle?
global $wgParser, $wgTitle;
- // Currently unnecessary, code to act as a safeguard against any change in current behaviour of uselang
+ // Currently unnecessary, code to act as a safeguard against any change in current behavior of uselang
$oldLang = null;
if ( isset( $params['uselang'] ) && $params['uselang'] != $this->getContext()->getLanguage()->getCode() ) {
$oldLang = $this->getContext()->getLanguage(); // Backup language
} elseif ( $params['prfiltercascade'] == 'noncascading' ) {
$this->addWhereFld( 'pr_cascade', 0 );
}
-
- $this->addOption( 'DISTINCT' );
}
$forceNameTitleIndex = false;
$this->addWhere( "pr_expiry != {$db->addQuotes( $db->getInfinity() )}" );
}
+ $this->addOption( 'DISTINCT' );
+
} elseif ( isset( $params['prlevel'] ) ) {
$this->dieUsage( 'prlevel may not be used without prtype', 'params' );
}
if ( $mode == 'revs' || $mode == 'user' ) {
// Ignore namespace and unique due to inability to know whether they were purposely set
- foreach( array( 'from', 'to', 'prefix', /*'namespace',*/ 'continue', /*'unique'*/ ) as $p ) {
+ foreach( array( 'from', 'to', 'prefix', /*'namespace', 'unique'*/ ) as $p ) {
if ( !is_null( $params[$p] ) ) {
$this->dieUsage( "The '{$p}' parameter cannot be used in modes 1 or 2", 'badparams' );
}
'namespace' => 'Only list pages in this namespace (3)',
'user' => 'Only list revisions by this user',
'excludeuser' => 'Don\'t list revisions by this user',
- 'continue' => 'When more results are available, use this to continue (3)',
+ 'continue' => 'When more results are available, use this to continue (1, 3)',
'unique' => 'List only one revision for each page (3)',
);
}
array( 'code' => 'badparams', 'info' => "The 'from' parameter cannot be used in modes 1 or 2" ),
array( 'code' => 'badparams', 'info' => "The 'to' parameter cannot be used in modes 1 or 2" ),
array( 'code' => 'badparams', 'info' => "The 'prefix' parameter cannot be used in modes 1 or 2" ),
- array( 'code' => 'badparams', 'info' => "The 'continue' parameter cannot be used in modes 1 or 2" ),
array( 'code' => 'badparams', 'info' => "The 'start' parameter cannot be used in mode 3" ),
array( 'code' => 'badparams', 'info' => "The 'end' parameter cannot be used in mode 3" ),
) );
$this->addTables( 'recentchanges' );
$index = array( 'recentchanges' => 'rc_timestamp' ); // May change
$this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
+
+ if ( !is_null( $params['continue'] ) ) {
+ $cont = explode( '|', $params['continue'] );
+ if ( count( $cont ) != 2 ) {
+ $this->dieUsage( 'Invalid continue param. You should pass the ' .
+ 'original value returned by the previous query', '_badcontinue' );
+ }
+
+ $timestamp = $this->getDB()->addQuotes( wfTimestamp( TS_MW, $cont[0] ) );
+ $id = intval( $cont[1] );
+ $op = $params['dir'] == 'descending' ? '<' : '>';
+
+ $this->addWhere(
+ "rc_timestamp $op $timestamp OR " .
+ "(rc_timestamp = $timestamp AND " .
+ "rc_id <= $id)"
+ );
+ }
+
+
$this->addWhereFld( 'rc_namespace', $params['namespace'] );
$this->addWhereFld( 'rc_deleted', 0 );
$this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' );
}
+ $this->addFields( 'rc_id' );
/* Add fields to our query if they are specified as a needed parameter. */
- $this->addFieldsIf( array( 'rc_id', 'rc_this_oldid', 'rc_last_oldid' ), $this->fld_ids );
+ $this->addFieldsIf( array( 'rc_this_oldid', 'rc_last_oldid' ), $this->fld_ids );
$this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment );
$this->addFieldsIf( 'rc_user', $this->fld_user );
$this->addFieldsIf( 'rc_user_text', $this->fld_user || $this->fld_userid );
foreach ( $res as $row ) {
if ( ++ $count > $params['limit'] ) {
// We've reached the one extra which shows that there are additional pages to be had. Stop here...
- $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
+ $this->setContinueEnumParameter( 'continue', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) . '|' . $row->rc_id );
break;
}
}
$fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $vals );
if ( !$fit ) {
- $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
+ $this->setContinueEnumParameter( 'continue', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) . '|' . $row->rc_id );
break;
}
} else {
)
),
'toponly' => false,
+ 'continue' => null,
);
}
'limit' => 'How many total changes to return',
'tag' => 'Only list changes tagged with this tag',
'toponly' => 'Only list changes which are the latest revision',
+ 'continue' => 'When more results are available, use this to continue',
);
}
if ( $wgContLang->linkPrefixExtension() ) {
$data['linkprefix'] = wfMessage( 'linkprefix' )->inContentLanguage()->text();
+ } else {
+ $data['linkprefix'] = '';
}
$linktrail = $wgContLang->linkTrail();
if ( $linktrail ) {
$data['linktrail'] = $linktrail;
+ } else {
+ $data['linktrail'] = '';
}
$git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] );
$res = array( 'title' => $title->getPrefixedText() );
- // Currently unnecessary, code to act as a safeguard against any change in current behaviour of uselang
+ // Currently unnecessary, code to act as a safeguard against any change in current behavior of uselang
// Copy from ApiParse
$oldLang = null;
if ( isset( $params['uselang'] ) && $params['uselang'] != $this->getContext()->getLanguage()->getCode() ) {
* target is hit in order to provide (hopefully) the Title of the final
* destination instead of another redirect.
*
- * There is usually no need to override the default behaviour, subclasses that
+ * There is usually no need to override the default behavior, subclasses that
* want to implement redirects should override getRedirectTarget().
*
* @since 1.21
* form of the content.
* - If $wgContentHandlerTextFallback is 'ignore' and $content is not a
* TextContent object, this method returns null.
- * - otherwise, the behaviour is undefined.
+ * - otherwise, the behavior is undefined.
*
* @since 1.21
*
* Given an array of non-normalised probabilities, this function will select
* an element and return the appropriate key
*
- * @deprecated 1.21, use wfPickRandom()
+ * @deprecated 1.21, use ArrayUtils::pickRandom()
*
* @param $weights array
*
* @return bool|int|string
*/
function pickRandom( $weights ) {
- return wfPickRandom( $weights );
+ return ArrayUtils::pickRandom( $weights );
}
/**
$value = (float)$value;
break;
case 'bool':
- if ( is_string( $value ) ) {
- $value = $value !== '0';
- } elseif ( is_int( $value ) ) {
- $value = $value !== 0;
- }
+ $value = (bool)$value;
break;
case 'array':
if ( is_string( $value ) ) {
return null;
}
+ /**
+ * Release a scoped lock and set any errors in the attatched Status object.
+ * This is useful for early release of locks before function scope is destroyed.
+ * This is the same as setting the lock object to null.
+ *
+ * @param ScopedLock $lock
+ * @return void
+ * @since 1.21
+ */
+ public static function release( ScopedLock &$lock = null ) {
+ $lock = null;
+ }
+
function __destruct() {
$wasOk = $this->status->isOK();
$this->status->merge( $this->manager->unlock( $this->paths, $this->type ) );
return $result;
}
+ /**
+ * Return an array of files where the name starts with $prefix.
+ *
+ * STUB
+ * @param string $prefix The prefix to search for
+ * @param int $limit The maximum amount of files to return
+ * @return array
+ */
+ public function findFilesByPrefix( $prefix, $limit ) {
+ return array();
+ }
+
/**
* Get the public root URL of the repository
*
return $result;
}
+ /**\r
+ * Return an array of files where the name starts with $prefix.\r
+ *\r
+ * @param string $prefix The prefix to search for\r
+ * @param int $limit The maximum amount of files to return\r
+ * @return array\r
+ */\r
+ public function findFilesByPrefix( $prefix, $limit ) {
+ $selectOptions = array( 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) );
+
+ // Query database\r
+ $dbr = $this->getSlaveDB();
+ $res = $dbr->select(
+ 'image',
+ LocalFile::selectFields(),
+ 'img_name ' . $dbr->buildLike( $prefix, $dbr->anyString() ),
+ __METHOD__,
+ $selectOptions
+ );
+
+ // Build file objects
+ $files = array();
+ foreach ( $res as $row ) {
+ $files[] = $this->newFileFromRow( $row );
+ }
+ return $files;\r
+ }
+
/**
* Get a connection to the slave DB
* @return DatabaseBase
FileRepo, where no such configuration is needed.
File objects are generated by a factory function from the repository. The
-repository thus has full control over the behaviour of its subsidiary file
+repository thus has full control over the behavior of its subsidiary file
class, since it can subclass the file class and override functionality at its
whim. Thus there is no need for the File subclass to query its parent repository
-for information about repository-class-dependent behaviour -- the file subclass
+for information about repository-class-dependent behavior -- the file subclass
is generally fully aware of the static preferences of its repository. Limited
exceptions can be made to this rule to permit sharing of functions, or perhaps
even entire classes, between repositories.
* @return string
*/
function getDescriptionUrl() {
- // Restore remote behaviour
+ // Restore remote behavior
return File::getDescriptionUrl();
}
* @return string
*/
function getDescriptionText() {
- // Restore remote behaviour
+ // Restore remote behavior
return File::getDescriptionText();
}
}
return $types;
}
+ /**
+ * Check if jobs should not be popped of a queue right now.
+ * This is only used for performance, such as to avoid spamming
+ * the queue with many sub-jobs before they actually get run.
+ *
+ * @param $type string
+ * @return bool
+ */
+ public function isQueueDeprioritized( $type ) {
+ if ( $type === 'refreshLinks2' ) {
+ // Don't keep converting refreshLinks2 => refreshLinks jobs if the
+ // later jobs have not been done yet. This helps throttle queue spam.
+ return !$this->get( 'refreshLinks' )->isEmpty();
+ }
+ return false;
+ }
+
/**
* Execute any due periodic queue maintenance tasks for all queues.
*
'cursor_west' => null,
'four_notation_quantity' => null,
'four_notation_color' => null,
+ 'box_shadow' => null,
+ 'text_shadow1' => null,
+ 'text_shadow2' => null,
'bg_horizontal_percentage' => null,
'bg_horizontal_percentage_x' => null,
);
$patterns['ident'] = "-?{$patterns['nmstart']}{$patterns['nmchar']}*";
$patterns['quantity'] = "{$patterns['num']}(?:\s*{$patterns['unit']}|{$patterns['ident']})?";
$patterns['possibly_negative_quantity'] = "((?:-?{$patterns['quantity']})|(?:inherit|auto))";
- $patterns['color'] = "(#?{$patterns['nmchar']}+)";
+ $patterns['color'] = "(#?{$patterns['nmchar']}+|(?:rgba?|hsla?)\([ \d.,%-]+\))";
$patterns['url_chars'] = "(?:{$patterns['url_special_chars']}|{$patterns['nonAscii']}|{$patterns['escape']})*";
$patterns['lookahead_not_open_brace'] = "(?!({$patterns['nmchar']}|\r?\n|\s|#|\:|\.|\,|\+|>)*?{)";
$patterns['lookahead_not_closing_paren'] = "(?!{$patterns['url_chars']}?{$patterns['valid_after_uri_chars']}\))";
$patterns['rtl_in_url'] = "/{$patterns['lookbehind_not_letter']}(rtl){$patterns['lookahead_for_closing_paren']}/i";
$patterns['cursor_east'] = "/{$patterns['lookbehind_not_letter']}([ns]?)e-resize/";
$patterns['cursor_west'] = "/{$patterns['lookbehind_not_letter']}([ns]?)w-resize/";
- $patterns['four_notation_quantity'] = "/{$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}/i";
- $patterns['four_notation_color'] = "/(-color\s*:\s*){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}/i";
+ $patterns['four_notation_quantity'] = "/(:\s*){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s*[;}])/i";
+ $patterns['four_notation_color'] = "/(-color\s*:\s*){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s*[;}])/i";
+ $patterns['box_shadow'] = "/(box-shadow\s*:\s*(?:inset\s*)?){$patterns['possibly_negative_quantity']}/i";
+ $patterns['text_shadow1'] = "/(text-shadow\s*:\s*){$patterns['color']}(\s*){$patterns['possibly_negative_quantity']}/i";
+ $patterns['text_shadow2'] = "/(text-shadow\s*:\s*){$patterns['possibly_negative_quantity']}/i";
// The two regexes below are parenthesized differently then in the original implementation to make the
// callback's job more straightforward
$patterns['bg_horizontal_percentage'] = "/(background(?:-position)?\s*:\s*[^%]*?)(-?{$patterns['num']})(%\s*(?:{$patterns['quantity']}|{$patterns['ident']}))/";
$css = self::fixCursorProperties( $css );
$css = self::fixFourPartNotation( $css );
$css = self::fixBackgroundPosition( $css );
+ $css = self::fixShadows( $css );
// Detokenize stuff we tokenized before
$css = $comments->detokenize( $css );
* @return string
*/
private static function fixFourPartNotation( $css ) {
- $css = preg_replace( self::$patterns['four_notation_quantity'], '$1$2$7$4$5$6$3', $css );
- $css = preg_replace( self::$patterns['four_notation_color'], '$1$2$3$8$5$6$7$4', $css );
+ $css = preg_replace( self::$patterns['four_notation_quantity'], '$1$2$3$8$5$6$7$4$9', $css );
+ $css = preg_replace( self::$patterns['four_notation_color'], '$1$2$3$8$5$6$7$4$9', $css );
+
+ return $css;
+ }
+
+ /**
+ * Negates horizontal offset in box-shadow and text-shadow rules.
+ *
+ * @param $css string
+ * @return string
+ */
+ private static function fixShadows( $css ) {
+ // Flips the sign of a CSS value, possibly with a unit.
+ // (We can't just negate the value with unary minus due to the units.)
+ $flipSign = function ( $cssValue ) {
+ // Don't mangle zeroes
+ if ( intval( $cssValue ) === 0 ) {
+ return $cssValue;
+ } elseif ( $cssValue[0] === '-' ) {
+ return substr( $cssValue, 1 );
+ } else {
+ return "-" . $cssValue;
+ }
+ };
+
+ $css = preg_replace_callback( self::$patterns['box_shadow'], function ( $matches ) use ( $flipSign ) {
+ return $matches[1] . $flipSign( $matches[2] );
+ }, $css );
+
+ $css = preg_replace_callback( self::$patterns['text_shadow1'], function ( $matches ) use ( $flipSign ) {
+ return $matches[1] . $matches[2] . $matches[3] . $flipSign( $matches[4] );
+ }, $css );
+
+ $css = preg_replace_callback( self::$patterns['text_shadow2'], function ( $matches ) use ( $flipSign ) {
+ return $matches[1] . $flipSign( $matches[2] );
+ }, $css );
return $css;
}
/**
* Returns an array holding all the data that should go into serialization calls.
* This is intended to allow overloading without having to reimplement the
- * behaviour of this base class.
+ * behavior of this base class.
*
* @since 1.20
*
* whether the script filename has been obscured.
*
* The function returns false if the server is not known to have this
- * behaviour. Microsoft IIS in particular is known to decode escaped script
+ * behavior. Microsoft IIS in particular is known to decode escaped script
* filenames.
*
* SERVER_SOFTWARE typically contains either a plain string such as "Zeus",
} else {
/*
* We must keep a separate connection to MySQL in order to avoid deadlocks
- * However, SQLite has an opposite behaviour. And PostgreSQL needs to know
+ * However, SQLite has an opposite behavior. And PostgreSQL needs to know
* if we are in transaction or no
*/
if ( wfGetDB( DB_MASTER )->getType() == 'mysql' ) {
* string constructs.
*
* Must not consist of all title characters, or else it will change
- * the behaviour of <nowiki> in a link.
+ * the behavior of <nowiki> in a link.
*/
$this->mUniqPrefix = "\x7fUNIQ" . self::getRandomString();
$this->mStripState = new StripState( $this->mUniqPrefix );
{
# Bug 529: if the template begins with a table or block-level
# element, it should be treated as beginning a new line.
- # This behaviour is somewhat controversial.
+ # This behavior is somewhat controversial.
$text = "\n" . $text;
}
if ( $equalsLength > 0 ) {
if ( $searchStart - $equalsLength == $piece->startPos ) {
// This is just a single string of equals signs on its own line
- // Replicate the doHeadings behaviour /={count}(.+)={count}/
+ // Replicate the doHeadings behavior /={count}(.+)={count}/
// First find out how many equals signs there really are (don't stop at 6)
$count = $equalsLength;
if ( $count < 3 ) {
if ( $equalsLength > 0 ) {
if ( $searchStart - $equalsLength == $piece->startPos ) {
// This is just a single string of equals signs on its own line
- // Replicate the doHeadings behaviour /={count}(.+)={count}/
+ // Replicate the doHeadings behavior /={count}(.+)={count}/
// First find out how many equals signs there really are (don't stop at 6)
$count = $equalsLength;
if ( $count < 3 ) {
$this->hasErrors = true;
continue;
}
- $modules[$name] = $this->getModule( $name );
+ $modules[$name] = $module;
} else {
$missing[] = $name;
}
* @see Site::getPageUrl
*
* This implementation returns a URL constructed using the path returned by getLinkPath().
- * In addition to the default behaviour implemented by Site::getPageUrl(), this
+ * In addition to the default behavior implemented by Site::getPageUrl(), this
* method converts the $pageName to DBKey-format by replacing spaces with underscores
* before using it in the URL.
*
*/
/**
- * A special page called by proxy_check.php to block open proxies
+ * A special page called by proxyCheck.php to block open proxies
*
* @ingroup SpecialPage
*/
$file = wfFindFile( $title );
if ( $file && $file->exists() ) {
- // Default behaviour: Use the direct link to the file.
+ // Default behavior: Use the direct link to the file.
$url = $file->getURL();
$width = $request->getInt( 'width', -1 );
$height = $request->getInt( 'height', -1 );
if( $textMatches && $textMatches->hasSuggestion() ) {
$st = SpecialPage::getTitleFor( 'Search' );
- # mirror Go/Search behaviour of original request ..
+ # mirror Go/Search behavior of original request ..
$didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
if( $this->fulltext != null ) {
return $text;
}
- private function getOtherStats( $stats ) {
- if ( !count( $stats ) )
- return '';
+ /**
+ * Conversion of external statistics into an internal representation
+ * Following a ([<header-message>][<item-message>] = number) pattern
+ *
+ * @param array $stats
+ * @return string
+ */
+ private function getOtherStats( array $stats ) {
+ $return = '';
- $return = Xml::openElement( 'tr' ) .
- Xml::tags( 'th', array( 'colspan' => '2' ), $this->msg( 'statistics-header-hooks' )->parse() ) .
- Xml::closeElement( 'tr' );
+ foreach( $stats as $header => $items ) {
+
+ // Identify the structure used
+ if ( is_array( $items ) ) {
- foreach( $stats as $name => $number ) {
- $name = htmlspecialchars( $name );
- $number = htmlspecialchars( $number );
+ // Ignore headers that are recursively set as legacy header
+ if ( $header !== 'statistics-header-hooks' ) {
+ $return .= $this->formatRowHeader( $header );
+ }
+
+ // Collect all items that belong to the same header
+ foreach( $items as $key => $value ) {
+ $name = $this->msg( $key )->inContentLanguage()->parse();
+ $number = htmlspecialchars( $value );
- $return .= $this->formatRow( $name, $this->getLanguage()->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) );
+ $return .= $this->formatRow( $name, $this->getLanguage()->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) );
+ }
+ } else {
+ // Create the legacy header only once
+ if ( $return === '' ) {
+ $return .= $this->formatRowHeader( 'statistics-header-hooks' );
+ }
+
+ // Recursively remap the legacy structure
+ $return .= $this->getOtherStats( array( 'statistics-header-hooks' => array( $header => $items ) ) );
+ }
}
return $return;
}
+
+ /**
+ * Format row header
+ *
+ * @param string $header
+ * @return string
+ */
+ private function formatRowHeader( $header ) {
+ return Xml::openElement( 'tr' ) .
+ Xml::tags( 'th', array( 'colspan' => '2' ), $this->msg( $header )->parse() ) .
+ Xml::closeElement( 'tr' );
+ }
}
}
}
+ // Check for files with the same name but a different extension
+ $similarFiles = RepoGroup::singleton()->getLocalRepo()->findFilesByPrefix(
+ "{$partname}.", 1 );
+ if ( count( $similarFiles ) ) {
+ return array(\r
+ 'warning' => 'exists-normalized',\r
+ 'file' => $file,\r
+ 'normalizedFile' => $similarFiles[0],\r
+ );
+ }
+
if ( self::isThumbName( $file->getName() ) ) {
# Check for filenames like 50px- or 180px-, these are mostly thumbnails
$nt_thb = Title::newFromText( substr( $partname, strpos( $partname, '-' ) + 1 ) . '.' . $extension, NS_FILE );
** Emzalc'h hegazus/handeus betek re
** Mont re bell gant implij meur a gont
** Anv implijer n'eo ket aotreet",
-'ipb-hardblock' => "Mirout a ra ouzh an implijerien kevreet da zegas kemmoù adalek ar c'homlec'h IP-mañ",
+'ipb-hardblock' => "Mirout ouzh an implijerien kevreet da zegas kemmoù adalek ar chomlec'h IP-mañ",
'ipbcreateaccount' => 'Mirout ouzh an implijer da grouiñ kontoù',
'ipbemailban' => 'Mirout ouzh an implijer da gas posteloù',
'ipbenableautoblock' => "Stankañ war-eeun ar chomlec'h IP diwezhañ implijet gant an den-mañ hag an holl chomlec'hioù a c'hallfe klask kemmañ traoù drezo drezo diwezhatoc'h",
'minutes' => 'verdê {{PLURAL:$1|$1 daka|$1 daka}}',
'hours' => 'Verdê {{PLURAL:$1|$1 seata|$1 seata}}',
'days' => 'Verdê {{PLURAL:$1|$1 rocan|$1 rocan}}',
-'months' => '{{PLURAL:$1|aşmi|$1 aşman}}',
-'years' => '{{PLURAL:$1|$1 ser|$1 seran}}',
+'months' => '{{PLURAL:$1|aşme|$1 aşmi}}',
+'years' => '{{PLURAL:$1|$1 serre|$1 serri}}',
'ago' => 'Verdê $1',
'just-now' => 'Hema newke',
*/
/**
- * Fallback language, used for all unspecified messages and behaviour. This
+ * Fallback language, used for all unspecified messages and behavior. This
* is English by default, for all files other than this one.
*
* Do NOT set this to false in any other message file! Leave the line out to
/*
The sidebar for MonoBook is generated from this message, lines that do not
begin with * or ** are discarded, furthermore lines that do begin with ** and
-do not contain | are also discarded, but do not depend on this behaviour for
+do not contain | are also discarded, but do not depend on this behavior for
future releases. Also note that since each list value is wrapped in a unique
XHTML id it should only appear once and include characters that are legal
XHTML id names.
** Removing content from pages
** Spamming links to external sites
** Inserting nonsense/gibberish into pages
-** Intimidating behaviour/harassment
+** Intimidating behavior/harassment
** Abusing multiple accounts
** Unacceptable username',
'ipb-hardblock' => 'Prevent logged-in users from editing from this IP address',
'hidden-category-category' => 'Kategoria ezkutuak',
'category-subcat-count' => '{{PLURAL:$2|Kategoria honek beste honako azpikategoria baino ez du.|Kategoria honek honako {{PLURAL:$1|azpikategoria du|$1 azpikategoriak ditu}}, guztira dauden $2tik.}}',
'category-subcat-count-limited' => 'Kategoria honek {{PLURAL:$1|azpikategoria hau du|$1 azpikategoria hauek ditu}}.',
-'category-article-count' => '{{PLURAL:$2|Kategoria honek honako orrialdea baino ez du.|Honako {{PLURAL:$1|orrialdea kategoria honetan dago|$1 orrialdeak kategoria hauetan daude}}, guztira dauden $2 (e)tik.}}',
+'category-article-count' => '{{PLURAL:$2|Kategoria honek ondorengo orri hau baino ez du.|Ondorengo {{PLURAL:$1|orri hau kategoria honetan dago|$1 orriak kategoria honetan daude}}. Guztira $2 orri dira kategoria honetan.}}',
'category-article-count-limited' => 'Ondorengo {{PLURAL:$1|orri hau kategoria honetan dago.|$1 orri hauek kategoria honetan daude.}}',
-'category-file-count' => '{{PLURAL:$2|Kategoria honek fitxategi hau baino ez du.|Honako {{PLURAL:$1|fitxategia kategoria honetan dago|$1 fitxategiak kategoria honetan daude}} guztira dauden $2 (e)tik.}}',
+'category-file-count' => '{{PLURAL:$2|Kategoria honek ondorengo fitxategi hau baino ez du.|Ondorengo {{PLURAL:$1|fitxategi hau kategoria honetan dago|$1 fitxategiak kategoria honetan daude}}. Guztira $2 fitxategi dira kategoria honetan.}}',
'category-file-count-limited' => 'Ondorengo {{PLURAL:$1|fitxategia kategoria honetan dago.|$1 fitxategiak kategoria honetan daude.}}',
'listingcontinuesabbrev' => 'jarr.',
'index-category' => 'Indexatutako orrialdeak',
'editthispage' => 'Orri hau aldatu',
'create-this-page' => 'Orrialde hau sortu',
'delete' => 'Ezabatu',
-'deletethispage' => 'Orrialde hau ezabatu',
+'deletethispage' => 'Ezabatu orri hau',
'undelete_short' => 'Berreskuratu {{PLURAL:$1|aldaketa bat|$1 aldaketa}}',
'viewdeleted_short' => 'Ikusi ezabatutako {{PLURAL:$1|bidalketa bat|$1 bidalketa}}',
'protect' => 'Babestu',
'revdelete-concurrent-change' => 'Errorea, $1 $2 data duen elementua aldatzean: badirudi haren egoera aldatu duela nor edo nork, zu aldatzen saiatzen ari zinela.
Begira itzazu erregistroak.',
'revdelete-reason-dropdown' => '*Ezabatzeko ohiko arrazoiak
-** Egile eskubideen urraketa
+** Egile eskubideak urratzea
** Informazio pertsonal edo iruzkin desegokia
** Lankide izen desegokia
-** Iraingarria izan daitekeen informazioa',
+** Kalumnia edo iraintzat jo daiteke',
'revdelete-otherreason' => 'Bestelako arrazoia:',
'revdelete-reasonotherlist' => 'Beste arrazoi bat',
'revdelete-edit-reasonlist' => 'Ezabaketa arrazoiak aldatu',
'blocklist' => 'Blokeatutako erabiltzaileak',
'ipblocklist' => 'Blokeatutako erabiltzaileak',
'ipblocklist-legend' => 'Blokeatutako erabiltzaile bat bilatu',
+'blocklist-timestamp' => 'Eguna eta ordua',
'blocklist-target' => 'Helburua',
+'blocklist-by' => 'Blokeoa ezarri duen administratzailea',
'blocklist-reason' => 'Arrazoia',
'ipblocklist-submit' => 'Bilatu',
'ipblocklist-localblock' => 'Tokiko blokeoa',
Blokeo erregistroa ematen da azpian erreferentziarako:',
'blocklog-showsuppresslog' => 'Lankide hau aurretik blokeatua eta ezkutatua izan da.
Erregistroa ematen da azpian erreferentziarako:',
-'blocklogentry' => '"[[$1]]" wikilariari blokeoa ezarri zaio. Blokeoaldia: $2 $3',
+'blocklogentry' => 'wikilariak [[$1]] erabiltzailea blokeatu du. Blokeoaldia: $2 $3',
'reblock-logentry' => '[[$1]] wikilariari blokeoaldia aldatu diogu. Blokeoaldi berria: $2 $3',
'blocklogtext' => 'Erabiltzaileen blokeoen ezarpen eta ezabaketen erregistroa da hau.
Automatikoki blokeatutako IP helbideak ez dira zerrendatzen.
'htmlform-selectorother-other' => 'Beste bat',
# New logging system
-'logentry-delete-delete' => '$1 wikilariak $3 orria ezabatu du',
+'logentry-delete-delete' => '$1 wikilariak «$3» orria ezabatu du',
+'logentry-delete-event' => '$1 wikilariak ikusgaitasuna aldatu {{PLURAL:$5|dio erregistroko sarrera bati|die erregistroko $5 sarrerari}}, $3 orrian: $4',
+'logentry-suppress-event' => '$1 wikilariak ezkutuan ikusgaitasuna aldatu {{PLURAL:$5|dio erregistroko sarrera bati|die erregistroko $5 sarrerari}}, $3 orrian: $4',
'revdelete-restricted' => 'administratzaileentzako mugak ezarri dira',
'revdelete-unrestricted' => 'administratzaileentzako mugak kendu dira',
'logentry-move-move' => '$1 wikilariak «$3» orria «$4» izenera aldatu du',
** Removing content from pages
** Spamming links to external sites
** Inserting nonsense/gibberish into pages
-** Intimidating behaviour/harassment
+** Intimidating behavior/harassment
** Abusing multiple accounts
* Oyr elley
** Ennym ymmydeyryn neuchooie
'logentry-newusers-create2' => '$1 létrehozta $3 felhasználói fiókját',
'logentry-newusers-byemail' => 'Szerkesztői lap $3 néven létrehozva $1 által, jelszó kiküldve emailben.',
'logentry-newusers-autocreate' => '$1 fiók automatikusan létrehozva',
-'logentry-rights-rights' => '$1 megváltoztatta $3 csoport tagságát erről: $4 erre: $5',
-'logentry-rights-rights-legacy' => '$1 megváltoztatta $3 csoport tagságát',
+'logentry-rights-rights' => '$1 megváltoztatta $3 csoporttagságát erről: $4 erre: $5',
+'logentry-rights-rights-legacy' => '$1 megváltoztatta $3 csoporttagságát',
'logentry-rights-autopromote' => '$1 automatikusan előléptetve erről: $4 erre: $5',
'rightsnone' => '(semmi)',
ამის ნაცვლად, სავარაუდოდ, ისისნი უნდა მიუთითებდნენ შესაბამის კონკრეტულ სტატიაზე.<br />
გვერდი ითვლება მრავამნიშვნელოვნად, თუ მასში განთავსებულია თარგი, რომლის სახელიც მითითებულია გვერდზე [[MediaWiki:Disambiguationspage]].",
+'pageswithprop-prop' => 'თვისების სახელი:',
+
'doubleredirects' => 'ორმაგი გადამისამართება',
'doubleredirectstext' => 'ამ გვერდზე ჩამოთვლილია გვერდები, რომლებიც გადამისამართებულია სხვა გადამისამართების გვერდებზე.
ყოველი მწკრივი შეიცავს ბმულებს პირველ და მეორე გადამისამართებაზე, აგრეთვე მეორე გადამისამართების ტექსტის პირველ სტრიქონს, რომელშიც ჩვეულებრივ მითითებულია რეალური „სამიზნე“ გვერდის სათაური. საჭიროა, რომ პირველი გადამისამართებაც უთითებდეს ამ გვერდზე.
'duration-centuries' => '$1 {{PLURAL:$1|საუკუნე|საუკუნე}}',
'duration-millennia' => '$1 {{PLURAL:$1|ათასწლეული|ათასწლეული}}',
+# Unknown messages
+'pageswithprop-submit' => 'მიდი',
);
'thu' => 'Juğ',
'fri' => 'Vie',
'sat' => 'Shab',
-'january' => 'Enero',
-'february' => 'Fevrero',
+'january' => 'Jenero',
+'february' => 'Hevrero',
'march' => 'Março',
-'april' => 'Abril',
+'april' => 'Avril',
'may_long' => 'Mayo',
-'june' => 'Junio',
+'june' => 'Juño',
'july' => 'Jullo',
'august' => 'Agosto',
-'september' => 'Setembre',
-'october' => 'Ochůvre',
-'november' => 'Novembre',
-'december' => 'Diziembre',
+'september' => 'Setiembre',
+'october' => 'Ochòvre',
+'november' => 'Noviembre',
+'december' => 'Deziembre',
'january-gen' => 'Enero',
'february-gen' => 'Fevrero',
'march-gen' => 'Março',
'policy-url' => 'Project:Politikas',
'portal' => 'Puertal de la komunitá',
'portal-url' => 'Project:Puertal de la komunitá',
-'privacy' => 'Principio de particůlaridad',
+'privacy' => 'Principio de particòlaridad',
'privacypage' => 'Project:Principio de particůlaridad',
'badaccess' => 'Yerro de permissión',
'viewsourceold' => 'Ver su manadero',
'editlink' => 'trocar',
'viewsourcelink' => 'ver su manadero',
-'editsectionhint' => 'Troca el capítůlo: $1',
+'editsectionhint' => 'Troca el kapítolo: $1',
'toc' => 'Contènidos',
'showtoc' => 'Amostrar',
'hidetoc' => 'esconder',
# Special:ListGroupRights
'listgrouprights-members' => '(ver los miembros de este grupo)',
-# E-mail user
+# Email user
'emailuser' => 'Embia e-mail a este usuario',
# Watchlist
'blocklink' => 'blokea',
'unblocklink' => 'quita el bloqueo',
'change-blocklink' => 'troca el blokeo',
-'contribslink' => 'Àjustamientos',
+'contribslink' => 'donos',
'blocklogpage' => 'Bloqueos de usuarios',
'blocklogentry' => 'bloqueó a [[$1]] $3 durante un tiempo de $2',
'unblocklogentry' => 'desbloqueó a "$1"',
'tooltip-pt-preferences' => 'Mis preferencias',
'tooltip-pt-watchlist' => 'La lista de los trocamientos acontècidos en las hojas akavidadas.',
'tooltip-pt-mycontris' => 'La lista de tus àjustamientos',
-'tooltip-pt-login' => "T'encorajamos d'entrar ma no sos obligado",
+'tooltip-pt-login' => 'Te encorajamos de entrar ma no estás obligado',
'tooltip-pt-logout' => 'Salir',
'tooltip-ca-talk' => 'Diskusyón encima del artícůlo de contènido',
'tooltip-ca-edit' => 'Puedes trocar esta hoja. Y si puede ser, usa el botón de previsteo antes de enrejistrar la hoja',
'tooltip-search' => 'Busca en {{SITENAME}}',
'tooltip-search-go' => 'Si ay una hoja con este nombre egzakto, vate allá.',
'tooltip-search-fulltext' => 'Busca este teksto en las hojas',
-'tooltip-p-logo' => 'Visita la primera hoja',
+'tooltip-p-logo' => 'Vate a la primera hoja',
'tooltip-n-mainpage' => 'Visita la primera hoja',
'tooltip-n-mainpage-description' => 'Visita la primera hoja',
'tooltip-n-portal' => 'Encima del projeto, lo que puedes hazer y ánde topar todo',
'tooltip-n-currentevents' => 'Información encima de los acontècimientos de oy día',
-'tooltip-n-recentchanges' => 'La lista de los trocamientos freskos en el viki',
-'tooltip-n-randompage' => 'Carga una kualunke hoja asegún viene',
-'tooltip-n-help' => 'El lugar para âmbezarse',
+'tooltip-n-recentchanges' => 'La lista de los trocamientos muevos en el viki',
+'tooltip-n-randompage' => 'Carga una hoja por asardo',
+'tooltip-n-help' => 'El lugar para saver más',
'tooltip-t-whatlinkshere' => 'Una lista de todas las hojas del viki que tienen atamientos con esta hoja',
'tooltip-t-recentchangeslinked' => 'Los trocamientos freskos de las hojas que tienen atamiento con esta hoja',
'tooltip-feed-rss' => 'Sindicación RSS de esta hoja',
'show-big-image' => 'Resolución original',
# Bad image list
-'bad_image_list' => "El formato es ańsina:
+'bad_image_list' => 'El formato es ansina:
-Cale akavidar sólo elementos de lista (quere dezir: shurás/satires qu'empeçan con *).
-El primer atamiento de cada shurá deve de ser un atamiento á una dosya negra (á la dosya que se quere blokear).
-Los atamientos venideros que stan en la mesma shurá s'aprecian como eksepsiones, por eńxemplo, hojas ande la dosya se ve en la shurá.",
+Cale akavidar sólo elementos de lista (quere dezir: liñas que empeçan con *).
+El primer atamiento de cada liña deve de ser un atamiento á una dosya negra (á la dosya que se quere blokear).
+Los atamientos venideros que están en la mesma liña se aprecian como eksepsiones, por enxemplo, hojas ande la dosya se ve en la liña.',
# Metadata
'metadata' => 'Metadatos',
'namespacesall' => 'todos',
'monthsall' => '(todos)',
-# E-mail address confirmation
+# Email address confirmation
'confirmemail' => 'Konfirmar direksion e-pósta',
'confirmemail_send' => 'Embiar el kodigo de konfirmasion.',
'confirmemail_sent' => 'Konfirmasion de pósta embiada.',
'loginlanguagelabel' => 'Taal: $1',
'suspicious-userlogout' => 'Uw verzoek om af te melden is genegeerd, omdat het lijkt alsof het verzoek is verzonden door een browser of cacheproxy die stuk is.',
-# E-mail sending
+# Email sending
'php-mail-error-unknown' => 'Er is een onbekende fout opgetreden in de mail()-functie van PHP',
'user-mail-no-addy' => 'Geprobeerd een e-mail te verzenden zonder een e-mailadres.',
'user-mail-no-body' => 'Er is geprobeerd een e-mail te verzenden zonder inhoud of met een hele korte inhoud.',
'prefs-displaywatchlist' => 'Weergaveopties',
'prefs-diffs' => 'Verschillen',
-# User preference: e-mail validation using jQuery
+# User preference: email validation using jQuery
'email-address-validity-valid' => 'Het e-mailadres lijkt geldig',
'email-address-validity-invalid' => 'Geef een geldig e-mailadres op',
Deze horen waarschijnlijk direct naar een meer toepasselijke pagina te verwijzen.<br />
Een pagina wordt gezien als doorverwijspagina als er een sjabloon op staat dat opgenomen is op [[MediaWiki:Disambiguationspage]].",
+'pageswithprop' => "Pagina's met een pagina-eigenschap",
+'pageswithprop-text' => "Op deze pagina worden pagina's weergegeven met een bepaalde pagina-eigenschap.",
+'pageswithprop-prop' => 'Naam van de eigenschap:',
+
'doubleredirects' => 'Dubbele doorverwijzingen',
'doubleredirectstext' => "Deze lijst bevat pagina's die doorverwijzen naar andere doorverwijspagina's.
Elke rij bevat koppelingen naar de eerste en de tweede doorverwijspagina en een koppeling naar de doelpagina van de tweede doorverwijspagina.
'listgrouprights-addgroup-self-all' => 'Alle groepen toevoegen aan eigen gebruiker',
'listgrouprights-removegroup-self-all' => 'Alle groepen verwijderen van eigen gebruiker',
-# E-mail user
+# Email user
'mailnologin' => 'Geen verzendadres beschikbaar',
'mailnologintext' => 'U moet [[Special:UserLogin|aangemeld]] zijn en een geldig e-mailadres in uw [[Special:Preferences|voorkeuren]] vermelden om andere gebruikers te kunnen e-mailen.',
'emailuser' => 'Deze gebruiker e-mailen',
'monthsall' => 'alle',
'limitall' => 'alle',
-# E-mail address confirmation
+# Email address confirmation
'confirmemail' => 'E-mailadres bevestigen',
'confirmemail_noemail' => 'U hebt geen geldig e-mailadres ingegeven in uw [[Special:Preferences|gebruikersvoorkeuren]].',
'confirmemail_text' => '{{SITENAME}} eist bevestiging van uw e-mailadres voordat u de e-mailmogelijkheden kunt gebruiken.
'duration-centuries' => '$1 {{PLURAL:$1|eeuw|eeuwen}}',
'duration-millennia' => '$1 {{PLURAL:$1|millennium|millennia}}',
+# Unknown messages
+'pageswithprop-legend' => "Pagina's met een pagina-eigenschap",
+'pageswithprop-submit' => 'OK',
);
'tog-extendwatchlist' => 'କେବଳ ନଗଦ ନୁହେଁ, ସବୁଯାକ ବଦଳକୁ ଦେଖାଇବା ନିମନ୍ତେ ଦେଖଣାତାଲିକାକୁ ବଢ଼ାଇବେ',
'tog-usenewrc' => 'ନଗଦ ବଦଳରେ ପୃଷ୍ଠା ଅନୁଯାୟୀ ଗୋଷ୍ଠୀ ବଦଳ ଏବଂ ଦେଖଣା (ଜାଭାସ୍କ୍ରିପ୍ଟ ଲୋଡ଼ା)',
'tog-numberheadings' => 'ଆପେଆପେ-ସଂଖ୍ୟାର ନାମଗୁଡ଼ିକ',
-'tog-showtoolbar' => 'ସମà\8dପାଦନା à¬\9fà\81ଲବାର ଦà\87à¬\96ାà¬\87ବà\87 (à¬\9cାà¬à¬¾à¬¸à\8dà¬\95à\8dରିପà\8dà¬\9f ସà¬\9aଳ à¬\95ରିବà\87)',
+'tog-showtoolbar' => 'ସମà\8dପାଦନା à¬\9fà\81ଲବାର ଦà\87à¬\96ାà¬\87ବà\87 (à¬\9cାà¬à¬¾à¬¸à\8dà¬\95à\8dରିପà\8dà¬\9f ଲà\8bଡ଼ା)',
'tog-editondblclick' => 'ଦୁଇଥର କ୍ଲିକରେ ପୃଷ୍ଠା ବଦଳାଇବେ (ଜାଭାସ୍କ୍ରିପ୍ଟ ଲୋଡ଼ା)',
'tog-editsection' => '[ବଦଳାଇବେ] ଲିଙ୍କରେ ବିଭାଗର ସମ୍ପାଦନାକୁ ସଚଳ କରିବେ',
'tog-editsectiononrightclick' => 'ବିଭାଗ ନାମରେ ଡାହାଣ କ୍ଲିକ କରି ବିଭାଗ ସମ୍ପାଦନାକୁ ସଚଳ କରିବେ (ଜାଭାସ୍କ୍ରିପ୍ଟ ଲୋଡ଼ା)',
'tooltip-n-mainpage-description' => 'ପ୍ରଧାନ ପୃଷ୍ଠା',
'tooltip-n-portal' => 'ଏହି ପ୍ରକଳ୍ପଟିରେ ଖୋଜା ଖୋଜି ପାଇଁ ଆପଣ କେମିତି ସାହାଯ୍ୟ କରିପାରିବେ',
'tooltip-n-currentevents' => 'ନଗଦ କାମର ପଛପଟେ ଚାଲିଥିବା କାମର ତଥ୍ୟ',
-'tooltip-n-recentchanges' => 'ବିକିରେ ଏହିମାତ୍ର କରାଯାଇଥିବା ଅଦଳ ବଦଳ',
+'tooltip-n-recentchanges' => 'à±ିକିରେ ଏହିମାତ୍ର କରାଯାଇଥିବା ଅଦଳ ବଦଳ',
'tooltip-n-randompage' => 'ଯାହିତାହି ପୃଷ୍ଠାଟିଏ ଖୋଲ',
'tooltip-n-help' => 'ଖୋଜି ପାଇବା ଭଳି ଜାଗା',
'tooltip-t-whatlinkshere' => 'ଏଠାରେ ଯୋଡ଼ାଯାଇଥିବା ପୃଷ୍ଠାସବୁର ତାଲିକା',
'listingcontinuesabbrev' => 'Shown in contiuation of each first letter group. This message follows the first letter.
See http://test.wikipedia.org/wiki/Category:Test_ko?uselang={{SUBPAGENAME}}, for example.',
-'index-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__INDEX__</nowiki> behaviour switch are listed. For description of this behaviour switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
-'noindex-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__NOINDEX__</nowiki> behaviour switch are listed. For description of this behaviour switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
+'index-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__INDEX__</nowiki> behavior switch are listed. For description of this behavior switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
+'noindex-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__NOINDEX__</nowiki> behavior switch are listed. For description of this behavior switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
'broken-file-category' => 'Name of [[mw:Help:Tracking categories|tracking category]] where pages that embed files that do not exist ("broken images") are listed.',
'categoryviewer-pagedlinks' => '{{Optional}}
The pagination links in category viewer. Parameters:
runJobs.php
Immediately complete all jobs in the job queue
- stats.php
+ showCacheStats.php
Show all statistics stored in the cache
undelete.php
Update pages restriction to the new schema
userOptions.php
- Change user options
\ No newline at end of file
+ Change user options
--- /dev/null
+<?php
+/**
+ * Removes all statistics tracking from the cache.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to remove all statistics tracking from the cache.
+ *
+ * @ingroup Maintenance
+ */
+class ClearCacheStats extends Maintenance {
+
+ public function __construct() {
+ parent::__construct();
+ $this->mDescription = "Remove all statistics tracking from the cache";
+ }
+
+ public function execute() {
+ global $wgLocalDatabases, $wgMemc;
+ foreach ( $wgLocalDatabases as $db ) {
+ $wgMemc->delete( "$db:stats:request_with_session" );
+ $wgMemc->delete( "$db:stats:request_without_session" );
+ $wgMemc->delete( "$db:stats:pcache_hit" );
+ $wgMemc->delete( "$db:stats:pcache_miss_expired" );
+ $wgMemc->delete( "$db:stats:pcache_miss_absent" );
+ $wgMemc->delete( "$db:stats:pcache_miss_stub" );
+ $wgMemc->delete( "$db:stats:image_cache_hit" );
+ $wgMemc->delete( "$db:stats:image_cache_miss" );
+ $wgMemc->delete( "$db:stats:image_cache_update" );
+ $wgMemc->delete( "$db:stats:diff_cache_hit" );
+ $wgMemc->delete( "$db:stats:diff_cache_miss" );
+ $wgMemc->delete( "$db:stats:diff_uncacheable" );
+ $wgMemc->delete( "$db:stats:job-insert" );
+ $wgMemc->delete( "$db:stats:job-pop" );
+ }
+ }
+}
+
+$maintClass = "ClearCacheStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
--- /dev/null
+<?php
+/**
+ * Clear the cache of interwiki prefixes for all local wikis.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to clear the cache of interwiki prefixes for all local wikis.
+ *
+ * @ingroup Maintenance
+ */
+class ClearInterwikiCache extends Maintenance {
+
+ public function __construct() {
+ parent::__construct();
+ $this->mDescription = "Clear all interwiki links for all languages from the cache";
+ }
+
+ public function execute() {
+ global $wgLocalDatabases, $wgMemc;
+ $dbr = wfGetDB( DB_SLAVE );
+ $res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false );
+ $prefixes = array();
+ foreach ( $res as $row ) {
+ $prefixes[] = $row->iw_prefix;
+ }
+
+ foreach ( $wgLocalDatabases as $db ) {
+ $this->output( "$db..." );
+ foreach ( $prefixes as $prefix ) {
+ $wgMemc->delete( "$db:interwiki:$prefix" );
+ }
+ $this->output( "done\n" );
+ }
+ }
+}
+
+$maintClass = "ClearInterwikiCache";
+require_once( RUN_MAINTENANCE_IF_MAIN );
+++ /dev/null
-<?php
-/**
- * Clear the cache of interwiki prefixes for all local wikis.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to clear the cache of interwiki prefixes for all local wikis.
- *
- * @ingroup Maintenance
- */
-class ClearInterwikiCache extends Maintenance {
-
- public function __construct() {
- parent::__construct();
- $this->mDescription = "Clear all interwiki links for all languages from the cache";
- }
-
- public function execute() {
- global $wgLocalDatabases, $wgMemc;
- $dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false );
- $prefixes = array();
- foreach ( $res as $row ) {
- $prefixes[] = $row->iw_prefix;
- }
-
- foreach ( $wgLocalDatabases as $db ) {
- $this->output( "$db..." );
- foreach ( $prefixes as $prefix ) {
- $wgMemc->delete( "$db:interwiki:$prefix" );
- }
- $this->output( "done\n" );
- }
- }
-}
-
-$maintClass = "ClearInterwikiCache";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+++ /dev/null
-<?php
-/**
- * Removes all statistics tracking from the cache.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to remove all statistics tracking from the cache.
- *
- * @ingroup Maintenance
- */
-class clear_stats extends Maintenance {
-
- public function __construct() {
- parent::__construct();
- $this->mDescription = "Remove all statistics tracking from the cache";
- }
-
- public function execute() {
- global $wgLocalDatabases, $wgMemc;
- foreach ( $wgLocalDatabases as $db ) {
- $wgMemc->delete( "$db:stats:request_with_session" );
- $wgMemc->delete( "$db:stats:request_without_session" );
- $wgMemc->delete( "$db:stats:pcache_hit" );
- $wgMemc->delete( "$db:stats:pcache_miss_expired" );
- $wgMemc->delete( "$db:stats:pcache_miss_absent" );
- $wgMemc->delete( "$db:stats:pcache_miss_stub" );
- $wgMemc->delete( "$db:stats:image_cache_hit" );
- $wgMemc->delete( "$db:stats:image_cache_miss" );
- $wgMemc->delete( "$db:stats:image_cache_update" );
- $wgMemc->delete( "$db:stats:diff_cache_hit" );
- $wgMemc->delete( "$db:stats:diff_cache_miss" );
- $wgMemc->delete( "$db:stats:diff_uncacheable" );
- $wgMemc->delete( "$db:stats:job-insert" );
- $wgMemc->delete( "$db:stats:job-pop" );
- }
- }
-}
-
-$maintClass = "clear_stats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
--- /dev/null
+<?php
+/**
+ * Re-initialise or update the site statistics table.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ * @author Brion Vibber
+ * @author Rob Church <robchur@gmail.com>
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to re-initialise or update the site statistics table
+ *
+ * @ingroup Maintenance
+ */
+class InitSiteStats extends Maintenance {
+ public function __construct() {
+ parent::__construct();
+ $this->mDescription = "Re-initialise the site statistics tables";
+ $this->addOption( 'update', 'Update the existing statistics (preserves the ss_total_views field)' );
+ $this->addOption( 'noviews', "Don't update the page view counter" );
+ $this->addOption( 'active', 'Also update active users count' );
+ $this->addOption( 'use-master', 'Count using the master database' );
+ }
+
+ public function execute() {
+ $this->output( "Refresh Site Statistics\n\n" );
+ $counter = new SiteStatsInit( $this->hasOption( 'use-master' ) );
+
+ $this->output( "Counting total edits..." );
+ $edits = $counter->edits();
+ $this->output( "{$edits}\nCounting number of articles..." );
+
+ $good = $counter->articles();
+ $this->output( "{$good}\nCounting total pages..." );
+
+ $pages = $counter->pages();
+ $this->output( "{$pages}\nCounting number of users..." );
+
+ $users = $counter->users();
+ $this->output( "{$users}\nCounting number of images..." );
+
+ $image = $counter->files();
+ $this->output( "{$image}\n" );
+
+ if ( !$this->hasOption( 'noviews' ) ) {
+ $this->output( "Counting total page views..." );
+ $views = $counter->views();
+ $this->output( "{$views}\n" );
+ }
+
+ if ( $this->hasOption( 'active' ) ) {
+ $this->output( "Counting active users..." );
+ $active = SiteStatsUpdate::cacheUpdate( wfGetDB( DB_MASTER ) );
+ $this->output( "{$active}\n" );
+ }
+
+ $this->output( "\nUpdating site statistics..." );
+
+ if ( $this->hasOption( 'update' ) ) {
+ $counter->update();
+ } else {
+ $counter->refresh();
+ }
+
+ $this->output( "done.\n" );
+ }
+}
+
+$maintClass = "InitSiteStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
+++ /dev/null
-<?php
-/**
- * Re-initialise or update the site statistics table.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- * @author Brion Vibber
- * @author Rob Church <robchur@gmail.com>
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to re-initialise or update the site statistics table
- *
- * @ingroup Maintenance
- */
-class InitStats extends Maintenance {
- public function __construct() {
- parent::__construct();
- $this->mDescription = "Re-initialise the site statistics tables";
- $this->addOption( 'update', 'Update the existing statistics (preserves the ss_total_views field)' );
- $this->addOption( 'noviews', "Don't update the page view counter" );
- $this->addOption( 'active', 'Also update active users count' );
- $this->addOption( 'use-master', 'Count using the master database' );
- }
-
- public function execute() {
- $this->output( "Refresh Site Statistics\n\n" );
- $counter = new SiteStatsInit( $this->hasOption( 'use-master' ) );
-
- $this->output( "Counting total edits..." );
- $edits = $counter->edits();
- $this->output( "{$edits}\nCounting number of articles..." );
-
- $good = $counter->articles();
- $this->output( "{$good}\nCounting total pages..." );
-
- $pages = $counter->pages();
- $this->output( "{$pages}\nCounting number of users..." );
-
- $users = $counter->users();
- $this->output( "{$users}\nCounting number of images..." );
-
- $image = $counter->files();
- $this->output( "{$image}\n" );
-
- if ( !$this->hasOption( 'noviews' ) ) {
- $this->output( "Counting total page views..." );
- $views = $counter->views();
- $this->output( "{$views}\n" );
- }
-
- if ( $this->hasOption( 'active' ) ) {
- $this->output( "Counting active users..." );
- $active = SiteStatsUpdate::cacheUpdate( wfGetDB( DB_MASTER ) );
- $this->output( "{$active}\n" );
- }
-
- $this->output( "\nUpdating site statistics..." );
-
- if ( $this->hasOption( 'update' ) ) {
- $counter->update();
- } else {
- $counter->refresh();
- }
-
- $this->output( "done.\n" );
- }
-}
-
-$maintClass = "InitStats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
$wgBlockComments = array(
'sidebar' => "The sidebar for MonoBook is generated from this message, lines that do not
begin with * or ** are discarded, furthermore lines that do begin with ** and
-do not contain | are also discarded, but do not depend on this behaviour for
+do not contain | are also discarded, but do not depend on this behavior for
future releases. Also note that since each list value is wrapped in a unique
XHTML id it should only appear once and include characters that are legal
XHTML id names.",
return; // no jobs for this type
}
- list( $type, $db ) = $candidates[ mt_rand( 0, count( $candidates ) - 1 ) ];
- if ( !$this->checkJob( $type, $db ) ) { // queue is actually empty?
- $pendingDBs[$type] = array_diff( $pendingDBs[$type], $db );
- JobQueueAggregator::singleton()->notifyQueueEmpty( $db, $type );
+ list( $type, $db ) = $candidates[mt_rand( 0, count( $candidates ) - 1 )];
+ if ( JobQueueGroup::singleton( $db )->isQueueDeprioritized( $type ) ) {
+ $pendingDBs[$type] = array_diff( $pendingDBs[$type], array( $db ) );
$again = true;
}
} while ( $again );
}
}
- /**
- * Check if the specified database has a job of the specified type in it.
- * The type may be false to indicate "all".
- * @param $type string
- * @param $dbName string
- * @return bool
- */
- private function checkJob( $type, $dbName ) {
- return !JobQueueGroup::singleton( $dbName )->get( $type )->isEmpty();
- }
-
/**
* Do all ready periodic jobs for all databases every 5 minutes (and .1% of the time)
* @return integer
--- /dev/null
+<?php
+/**
+ * Command line script to check for an open proxy at a specified location.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+if( PHP_SAPI != 'cli' ) {
+ die( 1 );
+}
+
+/**
+ *
+ */
+$output = '';
+
+/**
+ * Exit if there are not enough parameters, or if it's not command line mode
+ */
+if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $argv ) < 4 ) {
+ $output .= "Incorrect parameters\n";
+} else {
+ /**
+ * Get parameters
+ */
+ $ip = $argv[1];
+ $port = $argv[2];
+ $url = $argv[3];
+ $host = trim(`hostname`);
+ $output = "Connecting to $ip:$port, target $url, this hostname $host\n";
+
+ # Open socket
+ $sock = @fsockopen($ip, $port, $errno, $errstr, 5);
+ if ($errno == 0 ) {
+ $output .= "Connected\n";
+ # Send payload
+ $request = "GET $url HTTP/1.0\r\n";
+# $request .= "Proxy-Connection: Keep-Alive\r\n";
+# $request .= "Pragma: no-cache\r\n";
+# $request .= "Host: ".$url."\r\n";
+# $request .= "User-Agent: MediaWiki open proxy check\r\n";
+ $request .= "\r\n";
+ @fputs($sock, $request);
+ $response = fgets($sock, 65536);
+ $output .= $response;
+ @fclose($sock);
+ } else {
+ $output .= "No connection\n";
+ }
+}
+
+$output = escapeshellarg( $output );
+
+#`echo $output >> /home/tstarling/open/proxy.log`;
+++ /dev/null
-<?php
-/**
- * Command line script to check for an open proxy at a specified location.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- */
-
-if( PHP_SAPI != 'cli' ) {
- die( 1 );
-}
-
-/**
- *
- */
-$output = '';
-
-/**
- * Exit if there are not enough parameters, or if it's not command line mode
- */
-if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $argv ) < 4 ) {
- $output .= "Incorrect parameters\n";
-} else {
- /**
- * Get parameters
- */
- $ip = $argv[1];
- $port = $argv[2];
- $url = $argv[3];
- $host = trim(`hostname`);
- $output = "Connecting to $ip:$port, target $url, this hostname $host\n";
-
- # Open socket
- $sock = @fsockopen($ip, $port, $errno, $errstr, 5);
- if ($errno == 0 ) {
- $output .= "Connected\n";
- # Send payload
- $request = "GET $url HTTP/1.0\r\n";
-# $request .= "Proxy-Connection: Keep-Alive\r\n";
-# $request .= "Pragma: no-cache\r\n";
-# $request .= "Host: ".$url."\r\n";
-# $request .= "User-Agent: MediaWiki open proxy check\r\n";
- $request .= "\r\n";
- @fputs($sock, $request);
- $response = fgets($sock, 65536);
- $output .= $response;
- @fclose($sock);
- } else {
- $output .= "No connection\n";
- }
-}
-
-$output = escapeshellarg( $output );
-
-#`echo $output >> /home/tstarling/open/proxy.log`;
$this->runJobsLog( "Executed $count periodic queue task(s)." );
}
+ $lastTime = time();
do {
$job = ( $type === false )
? $group->pop( JobQueueGroup::TYPE_DEFAULT, JobQueueGroup::USE_CACHE )
break;
}
- // Don't let any slaves/backups fall behind...
+ // Don't let any queue slaves/backups fall behind
$group->get( $job->getType() )->waitForBackups();
+ // Don't let any of the main DB slaves get backed up
+ $timePassed = time() - $lastTime;
+ if ( $timePassed >= 5 || $timePassed < 0 ) {
+ wfWaitForSlaves();
+ }
}
} while ( $job ); // stop when there are no jobs
}
--- /dev/null
+<?php
+/**
+ * Show statistics from the cache.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script that shows statistics from the cache.
+ *
+ * @ingroup Maintenance
+ */
+class ShowCacheStats extends Maintenance {
+
+ public function __construct() {
+ $this->mDescription = "Show statistics from the cache";
+ parent::__construct();
+ }
+
+ public function getDbType() {
+ return Maintenance::DB_NONE;
+ }
+
+ public function execute() {
+ global $wgMemc;
+
+ // Can't do stats if
+ if ( get_class( $wgMemc ) == 'EmptyBagOStuff' ) {
+ $this->error( "You are running EmptyBagOStuff, I can not provide any statistics.", true );
+ }
+ $session = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_with_session' ) ) );
+ $noSession = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_without_session' ) ) );
+ $total = $session + $noSession;
+ if ( $total == 0 ) {
+ $this->error( "You either have no stats or the cache isn't running. Aborting.", true );
+ }
+ $this->output( "Requests\n" );
+ $this->output( sprintf( "with session: %-10d %6.2f%%\n", $session, $session / $total * 100 ) );
+ $this->output( sprintf( "without session: %-10d %6.2f%%\n", $noSession, $noSession / $total * 100 ) );
+ $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) );
+
+
+ $this->output( "\nParser cache\n" );
+ $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_hit' ) ) );
+ $expired = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_expired' ) ) );
+ $absent = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_absent' ) ) );
+ $stub = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_stub' ) ) );
+ $total = $hits + $expired + $absent + $stub;
+ if ( $total ) {
+ $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
+ $this->output( sprintf( "expired: %-10d %6.2f%%\n", $expired, $expired / $total * 100 ) );
+ $this->output( sprintf( "absent: %-10d %6.2f%%\n", $absent, $absent / $total * 100 ) );
+ $this->output( sprintf( "stub threshold: %-10d %6.2f%%\n", $stub, $stub / $total * 100 ) );
+ $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) );
+ } else {
+ $this->output( "no statistics available\n" );
+ }
+
+ $this->output( "\nImage cache\n" );
+ $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_hit' ) ) );
+ $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_miss' ) ) );
+ $updates = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_update' ) ) );
+ $total = $hits + $misses;
+ if ( $total ) {
+ $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
+ $this->output( sprintf( "misses: %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
+ $this->output( sprintf( "updates: %-10d\n", $updates ) );
+ } else {
+ $this->output( "no statistics available\n" );
+ }
+
+ $this->output( "\nDiff cache\n" );
+ $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_hit' ) ) );
+ $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_miss' ) ) );
+ $uncacheable = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_uncacheable' ) ) );
+ $total = $hits + $misses + $uncacheable;
+ if ( $total ) {
+ $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
+ $this->output( sprintf( "misses: %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
+ $this->output( sprintf( "uncacheable: %-10d %6.2f%%\n", $uncacheable, $uncacheable / $total * 100 ) );
+ } else {
+ $this->output( "no statistics available\n" );
+ }
+ }
+}
+
+$maintClass = "ShowCacheStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
--- /dev/null
+<?php
+
+/**
+ * Show the cached statistics.
+ * Give out the same output as [[Special:Statistics]]
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ * @author Antoine Musso <hashar at free dot fr>
+ * Based on initSiteStats.php by:
+ * @author Brion Vibber
+ * @author Rob Church <robchur@gmail.com>
+ *
+ * @license GNU General Public License 2.0 or later
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to show the cached statistics.
+ *
+ * @ingroup Maintenance
+ */
+class ShowSiteStats extends Maintenance {
+ public function __construct() {
+ parent::__construct();
+ $this->mDescription = "Show the cached statistics";
+ }
+ public function execute() {
+ $fields = array(
+ 'ss_total_views' => 'Total views',
+ 'ss_total_edits' => 'Total edits',
+ 'ss_good_articles' => 'Number of articles',
+ 'ss_total_pages' => 'Total pages',
+ 'ss_users' => 'Number of users',
+ 'ss_images' => 'Number of images',
+ );
+
+ // Get cached stats from slave database
+ $dbr = wfGetDB( DB_SLAVE );
+ $stats = $dbr->selectRow( 'site_stats', '*', '', __METHOD__ );
+
+ // Get maximum size for each column
+ $max_length_value = $max_length_desc = 0;
+ foreach ( $fields as $field => $desc ) {
+ $max_length_value = max( $max_length_value, strlen( $stats->$field ) );
+ $max_length_desc = max( $max_length_desc, strlen( $desc ) ) ;
+ }
+
+ // Show them
+ foreach ( $fields as $field => $desc ) {
+ $this->output( sprintf( "%-{$max_length_desc}s: %{$max_length_value}d\n", $desc, $stats->$field ) );
+ }
+ }
+}
+
+$maintClass = "ShowSiteStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
+++ /dev/null
-<?php
-
-/**
- * Show the cached statistics.
- * Give out the same output as [[Special:Statistics]]
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- * @author Antoine Musso <hashar at free dot fr>
- * Based on initStats.php by:
- * @author Brion Vibber
- * @author Rob Church <robchur@gmail.com>
- *
- * @license GNU General Public License 2.0 or later
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to show the cached statistics.
- *
- * @ingroup Maintenance
- */
-class ShowStats extends Maintenance {
- public function __construct() {
- parent::__construct();
- $this->mDescription = "Show the cached statistics";
- }
- public function execute() {
- $fields = array(
- 'ss_total_views' => 'Total views',
- 'ss_total_edits' => 'Total edits',
- 'ss_good_articles' => 'Number of articles',
- 'ss_total_pages' => 'Total pages',
- 'ss_users' => 'Number of users',
- 'ss_images' => 'Number of images',
- );
-
- // Get cached stats from slave database
- $dbr = wfGetDB( DB_SLAVE );
- $stats = $dbr->selectRow( 'site_stats', '*', '', __METHOD__ );
-
- // Get maximum size for each column
- $max_length_value = $max_length_desc = 0;
- foreach ( $fields as $field => $desc ) {
- $max_length_value = max( $max_length_value, strlen( $stats->$field ) );
- $max_length_desc = max( $max_length_desc, strlen( $desc ) ) ;
- }
-
- // Show them
- foreach ( $fields as $field => $desc ) {
- $this->output( sprintf( "%-{$max_length_desc}s: %{$max_length_value}d\n", $desc, $stats->$field ) );
- }
- }
-}
-
-$maintClass = "ShowStats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+++ /dev/null
-<?php
-/**
- * Show statistics from the cache.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script that shows statistics from the cache.
- *
- * @ingroup Maintenance
- */
-class CacheStats extends Maintenance {
-
- public function __construct() {
- $this->mDescription = "Show statistics from the cache";
- parent::__construct();
- }
-
- public function getDbType() {
- return Maintenance::DB_NONE;
- }
-
- public function execute() {
- global $wgMemc;
-
- // Can't do stats if
- if ( get_class( $wgMemc ) == 'EmptyBagOStuff' ) {
- $this->error( "You are running EmptyBagOStuff, I can not provide any statistics.", true );
- }
- $session = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_with_session' ) ) );
- $noSession = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_without_session' ) ) );
- $total = $session + $noSession;
- if ( $total == 0 ) {
- $this->error( "You either have no stats or the cache isn't running. Aborting.", true );
- }
- $this->output( "Requests\n" );
- $this->output( sprintf( "with session: %-10d %6.2f%%\n", $session, $session / $total * 100 ) );
- $this->output( sprintf( "without session: %-10d %6.2f%%\n", $noSession, $noSession / $total * 100 ) );
- $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) );
-
-
- $this->output( "\nParser cache\n" );
- $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_hit' ) ) );
- $expired = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_expired' ) ) );
- $absent = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_absent' ) ) );
- $stub = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_stub' ) ) );
- $total = $hits + $expired + $absent + $stub;
- if ( $total ) {
- $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
- $this->output( sprintf( "expired: %-10d %6.2f%%\n", $expired, $expired / $total * 100 ) );
- $this->output( sprintf( "absent: %-10d %6.2f%%\n", $absent, $absent / $total * 100 ) );
- $this->output( sprintf( "stub threshold: %-10d %6.2f%%\n", $stub, $stub / $total * 100 ) );
- $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) );
- } else {
- $this->output( "no statistics available\n" );
- }
-
- $this->output( "\nImage cache\n" );
- $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_hit' ) ) );
- $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_miss' ) ) );
- $updates = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_update' ) ) );
- $total = $hits + $misses;
- if ( $total ) {
- $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
- $this->output( sprintf( "misses: %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
- $this->output( sprintf( "updates: %-10d\n", $updates ) );
- } else {
- $this->output( "no statistics available\n" );
- }
-
- $this->output( "\nDiff cache\n" );
- $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_hit' ) ) );
- $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_miss' ) ) );
- $uncacheable = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_uncacheable' ) ) );
- $total = $hits + $misses + $uncacheable;
- if ( $total ) {
- $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
- $this->output( sprintf( "misses: %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
- $this->output( sprintf( "uncacheable: %-10d %6.2f%%\n", $uncacheable, $uncacheable / $total * 100 ) );
- } else {
- $this->output( "no statistics available\n" );
- }
- }
-}
-
-$maintClass = "CacheStats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
*
* Write the new URL to the text table and set the bt_moved flag.
*
- * This is done in a single transaction to provide restartable behaviour
+ * This is done in a single transaction to provide restartable behavior
* without data loss.
*
* The transaction is kept short to reduce locking.
*
* @author Timo Tijhof, 2011-2012
*/
-/*global jQuery, QUnit */
-/*jshint eqeqeq:false, eqnull:false, forin:false */
( function ( $ ) {
'use strict';
$span.append( childNode );
} );
} else {
- // strings, integers, anything else
- // (will soon switch to createTextNode() for non-objects)
- $span.append( node );
+ // Let jQuery append nodes, arrays of nodes and jQuery objects
+ // other things (strings, numbers, ..) are appended as text nodes (not as HTML strings)
+ $span.append( $.type( node ) === 'object' ? node : document.createTextNode( node ) );
}
} );
return $span;
*/
get: function ( selection, fallback ) {
var results, i;
+ // If we only do this in the `return` block, it'll fail for the
+ // call to get() from the mutli-selection block.
+ fallback = arguments.length > 1 ? fallback : null;
if ( $.isArray( selection ) ) {
selection = slice.call( selection );
results = {};
- for ( i = 0; i < selection.length; i += 1 ) {
+ for ( i = 0; i < selection.length; i++ ) {
results[selection[i]] = this.get( selection[i], fallback );
}
return results;
}
if ( typeof selection === 'string' ) {
- if ( this.values[selection] === undefined ) {
- if ( fallback !== undefined ) {
- return fallback;
- }
- return null;
+ if ( !hasOwn.call( this.values, selection ) ) {
+ return fallback;
}
return this.values[selection];
}
}
return true;
}
- if ( typeof selection === 'string' && value !== undefined ) {
+ if ( typeof selection === 'string' && arguments.length > 1 ) {
this.values[selection] = value;
return true;
}
var s;
if ( $.isArray( selection ) ) {
- for ( s = 0; s < selection.length; s += 1 ) {
- if ( this.values[selection[s]] === undefined ) {
+ for ( s = 0; s < selection.length; s++ ) {
+ if ( typeof selection[s] !== 'string' || !hasOwn.call( this.values, selection[s] ) ) {
return false;
}
}
return true;
}
- return this.values[selection] !== undefined;
+ return typeof selection === 'string' && hasOwn.call( this.values, selection );
}
};
// If the jQuery selector isn't found within the <ul>,
// or if nextnode was invalid or not passed at all,
- // then just append it at the end of the <ul> (this is the default behaviour)
+ // then just append it at the end of the <ul> (this is the default behavior)
} else {
$ul.append( $item );
}
<!-- jumpto -->
<div id="jump-to-nav" class="mw-jump">
<?php $this->msg( 'jumpto' ) ?>
- <a href="#mw-head"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?>
+ <a href="#mw-navigation"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?>
<a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
</div>
<!-- /jumpto -->
pre, code, tt, kbd, samp, .mw-code {
/*
* Some browsers will render the monospace text too small, namely Firefox, Chrome and Safari.
- * Specifying any valid, second value will trigger correct behaviour without forcing a different font.
+ * Specifying any valid, second value will trigger correct behavior without forcing a different font.
*/
font-family: monospace, Courier;
}
.prefsection table {
width: 100%;
}
+.prefsection table.mw-htmlform-matrix {
+ width: auto;
+}
td.mw-submit {
white-space: nowrap;
}
white-space: nowrap;
}
+.mw-htmlform-matrix td {
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+}
+
input#wpSummary {
width: 80%;
margin-bottom: 1em;
# PHPUnit 3.5.0 introduced a nice autoloader based on class name
require_once( 'PHPUnit/Autoload.php' );
} else {
- # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
+ # Keep the old pre PHPUnit 3.5.0 behavior for compatibility
require_once( 'PHPUnit/TextUI/Command.php' );
}
!!end
!! test
-Short headings with trailing space should match behaviour of Parser::doHeadings (bug 19910)
+Short headings with trailing space should match behavior of Parser::doHeadings (bug 19910)
!! input
===
The line above must have a trailing space!
==marked==
!!end
-# Test behaviour of bug 19910
+# Test behavior of bug 19910
!! test
Sectiion with all-equals
!! options
);
}
+ /**
+ * @since 1.21
+ * @return array
+ */
+ protected function getMockValues() {
+ return array(
+ 'id' => 1,
+ 'str' => 'foobar4645645',
+ 'int' => 42,
+ 'float' => 4.2,
+ 'bool' => '',
+ 'array' => array( 42, 'foobar' ),
+ 'blob' => new stdClass()
+ );
+ }
+
}
class TestORMRow extends ORMRow {}
$this->assertEquals( true, $status->isOK(),
"Locking of files succeeded with OK status ($backendName)." );
}
+
+ $status = Status::newGood();
+ $sl = $this->backend->getScopedFileLocks( $paths, LockManager::LOCK_EX, $status );
+ $this->assertType( 'ScopedLock', $sl,
+ "Scoped locking of files succeeded ($backendName)." );
+ $this->assertEquals( array(), $status->errors,
+ "Scoped locking of files succeeded ($backendName)." );
+ $this->assertEquals( true, $status->isOK(),
+ "Scoped locking of files succeeded with OK status ($backendName)." );
+
+ ScopedLock::release( $sl );
+ $this->assertEquals( null, $sl,
+ "Scoped unlocking of files succeeded ($backendName)." );
+ $this->assertEquals( array(), $status->errors,
+ "Scoped unlocking of files succeeded ($backendName)." );
+ $this->assertEquals( true, $status->isOK(),
+ "Scoped unlocking of files succeeded with OK status ($backendName)." );
}
// test helper wrapper for backend prepare() function
'#settings td p strong'
),
array(
- # Not sure how 4+ values should behave,
- # testing to make sure changes are detected
- '.foo { x-unknown: 1 2 3 4 5; }',
- '.foo { x-unknown: 1 4 3 2 5; }',
+ // Test the colors regex
+ '.foo { border-color: red green blue white }',
+ '.foo { border-color: red white blue green }',
),
array(
- '.foo { x-unknown: 1 2 3 4 5 6; }',
- '.foo { x-unknown: 1 4 3 2 5 6; }',
+ // Test the colors regex harder
+ '.foo { border-color: red #f00 rgb(255, 0, 0%) rgba(100%, 0, 0, 0) }',
+ '.foo { border-color: red rgba(100%, 0, 0, 0) rgb(255, 0, 0%) #f00 }',
+ ),
+ array(
+ // Do not bork 4+ values
+ '.foo { x-unknown: 1 2 3 4 5; }'
+ ),
+ array(
+ '.foo { x-unknown: 1 2 3 4 5 6; }'
),
// Shorthand / Three notation
'.foo { padding: 1px; }'
),
+ // text-shadow and box-shadow
+ array(
+ '.foo { box-shadow: -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+ '.foo { box-shadow: 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+ ),
+ array(
+ '.foo { box-shadow: inset -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+ '.foo { box-shadow: inset 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+ ),
+ array(
+ '.foo { text-shadow: orange 2px 0; }',
+ '.foo { text-shadow: orange -2px 0; }',
+ ),
+ array(
+ '.foo { text-shadow: 2px 0 orange; }',
+ '.foo { text-shadow: -2px 0 orange; }',
+ ),
+ array(
+ // Don't mangle zeroes
+ '.foo { text-shadow: orange 0 2px; }'
+ ),
+
// Direction
// Note: This differs from the Python implementation,
// see also CSSJanus::fixDirection for more info.
// Someone generated a MaintenanceFixup instance without calling
// simulateShutdown. We'd have to raise a PHPUnit exception to correctly
// flag this illegal usage. However, we are already in a destruktor, which
- // would trigger undefined behaviour. Hence, we can only report to the
+ // would trigger undefined behavior. Hence, we can only report to the
// error output :( Hopefully people read the PHPUnit output.
$name = $this->testCase->getName();
fwrite( STDERR, "ERROR! Instance of " . __CLASS__ . " for test $name "
// Although the following tests do not seem to be too consistent (compare for
// example the newlines within the test.*StringString tests, or the
// test.*Intermittent.* tests), the objective of these tests is not to describe
- // consistent behaviour, but rather currently existing behaviour.
+ // consistent behavior, but rather currently existing behavior.
function testOutputEmpty() {
assert.deepEqual( $.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' );
assert.deepEqual( $.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' );
- // Perhaps this is a bug in colorUtil, but it is the current behaviour so, let's keep
+ // Perhaps this is a bug in colorUtil, but it is the current behavior so, let's keep
// track of it, so we will know in case it would ever change.
assert.strictEqual( $.colorUtil.getRGB( 'rgba(0,0,0,0)' ), undefined, 'Zero rgba without whitespace' );
assert.strictEqual( $.isEmpty( [] ), true, 'isEmpty: []' );
assert.strictEqual( $.isEmpty( {} ), true, 'isEmpty: {}' );
- // Documented behaviour
+ // Documented behavior
assert.strictEqual( $.isEmpty( { length: 0 } ), true, 'isEmpty: { length: 0 }' );
} );
} );
}
- QUnit.test( 'Replace', 7, function ( assert ) {
+ QUnit.test( 'Replace', 9, function ( assert ) {
var parser = mw.jqueryMsg.getMessageFunction();
mw.messages.set( 'simple', 'Foo $1 baz $2' );
assert.equal( parser( 'simple', 'bar' ), 'Foo bar baz $2', 'Replacements with less substitutes' );
assert.equal( parser( 'simple', 'bar', 'quux' ), 'Foo bar baz quux', 'Replacements with all substitutes' );
- /* Temporarily disabling until 2013-03 --Kaldari
mw.messages.set( 'plain-input', '<foo foo="foo">x$1y<</foo>z' );
assert.equal(
'Foo <bar bar="bar">&gt;</bar>',
'Replacement is not considered html'
);
- */
mw.messages.set( 'object-replace', 'Foo $1' );
assert.strictEqual( window.mw, window.mediaWiki, 'mw alias to mediaWiki' );
} );
- QUnit.test( 'mw.Map', 17, function ( assert ) {
+ QUnit.test( 'mw.Map', 27, function ( assert ) {
var arry, conf, funky, globalConf, nummy, someValues;
- assert.ok( mw.Map, 'mw.Map defined' );
-
conf = new mw.Map();
// Dummy variables
funky = function () {};
arry = [];
nummy = 7;
- // Tests for input validation
- assert.strictEqual( conf.get( 'inexistantKey' ), null, 'Map.get returns null if selection was a string and the key was not found' );
- assert.strictEqual( conf.set( 'myKey', 'myValue' ), true, 'Map.set returns boolean true if a value was set for a valid key string' );
+ // Single get and set
+
+ assert.strictEqual( conf.set( 'foo', 'Bar' ), true, 'Map.set returns boolean true if a value was set for a valid key string' );
+ assert.equal( conf.get( 'foo' ), 'Bar', 'Map.get returns a single value value correctly' );
+
+ assert.strictEqual( conf.get( 'example' ), null, 'Map.get returns null if selection was a string and the key was not found' );
+ assert.strictEqual( conf.get( 'example', arry ), arry, 'Map.get returns fallback by reference if the key was not found' );
+ assert.strictEqual( conf.get( 'example', undefined ), undefined, 'Map.get supports `undefined` as fallback instead of `null`' );
+
+ assert.strictEqual( conf.get( 'constructor' ), null, 'Map.get does not look at Object.prototype of internal storage (constructor)' );
+ assert.strictEqual( conf.get( 'hasOwnProperty' ), null, 'Map.get does not look at Object.prototype of internal storage (hasOwnProperty)' );
+
+ conf.set( 'hasOwnProperty', function () { return true; } );
+ assert.strictEqual( conf.get( 'example', 'missing' ), 'missing', 'Map.get uses neutral hasOwnProperty method (positive)' );
+
+ conf.set( 'example', 'Foo' );
+ conf.set( 'hasOwnProperty', function () { return false; } );
+ assert.strictEqual( conf.get( 'example' ), 'Foo', 'Map.get uses neutral hasOwnProperty method (negative)' );
+
+ assert.strictEqual( conf.set( 'constructor', 42 ), true, 'Map.set for key "constructor"' );
+ assert.strictEqual( conf.get( 'constructor' ), 42, 'Map.get for key "constructor"' );
+
+ assert.strictEqual( conf.set( 'ImUndefined', undefined ), true, 'Map.set allows setting value to `undefined`' );
+ assert.equal( conf.get( 'ImUndefined', 'fallback' ), undefined , 'Map.get supports retreiving value of `undefined`' );
+
assert.strictEqual( conf.set( funky, 'Funky' ), false, 'Map.set returns boolean false if key was invalid (Function)' );
assert.strictEqual( conf.set( arry, 'Arry' ), false, 'Map.set returns boolean false if key was invalid (Array)' );
assert.strictEqual( conf.set( nummy, 'Nummy' ), false, 'Map.set returns boolean false if key was invalid (Number)' );
- assert.equal( conf.get( 'myKey' ), 'myValue', 'Map.get returns a single value value correctly' );
- assert.strictEqual( conf.get( nummy ), null, 'Map.get ruturns null if selection was invalid (Number)' );
+
assert.strictEqual( conf.get( funky ), null, 'Map.get ruturns null if selection was invalid (Function)' );
+ assert.strictEqual( conf.get( nummy ), null, 'Map.get ruturns null if selection was invalid (Number)' );
+
+ conf.set( String( nummy ), 'I used to be a number' );
+
+ assert.strictEqual( conf.exists( 'doesNotExist' ), false, 'Map.exists where property does not exist' );
+ assert.strictEqual( conf.exists( 'ImUndefined' ), true, 'Map.exists where value is `undefined`' );
+ assert.strictEqual( conf.exists( nummy ), false, 'Map.exists where key is invalid but looks like an existing key' );
// Multiple values at once
someValues = {
'notExist': null
}, 'Map.get return includes keys that were not found as null values' );
- assert.strictEqual( conf.exists( 'foo' ), true, 'Map.exists returns boolean true if a key exists' );
- assert.strictEqual( conf.exists( 'notExist' ), false, 'Map.exists returns boolean false if a key does not exists' );
// Interacting with globals and accessing the values object
assert.strictEqual( conf.get(), conf.values, 'Map.get returns the entire values object by reference (if called without arguments)' );
conf.set( 'globalMapChecker', 'Hi' );
- assert.ok( false === 'globalMapChecker' in window, 'new mw.Map did not store its values in the global window object by default' );
+ assert.ok( 'globalMapChecker' in window === false, 'new mw.Map did not store its values in the global window object by default' );
globalConf = new mw.Map( true );
globalConf.set( 'anotherGlobalMapChecker', 'Hello' );