** The rc_type field of recentchanges will be deprecated in a future point
release.
* The global variable $wgArticle has been removed after a lengthy deprecation.
+* The global functions addButton and insertTags (for mw.toolbar.addButton and
+ mw.toolbar.insertTags) now emits mw.log.warn when accessed.
== Compatibility ==
-[July 22nd 2008]
+/docs Directory README
+======================
The 'docs' directory contain various text files that should help you understand
the most important parts of the code of MediaWiki. More in-depth documentation
-can be found at http://www.mediawiki.org/wiki/Manual:Code.
+can be found at:
+ https://www.mediawiki.org/wiki/Manual:Code
API documentation is automatically generated and updated daily at:
- http://svn.wikimedia.org/doc/
+ https://doc.wikimedia.org/mediawiki-core/master/php/html/
You can get a fresh version using 'make doc' or mwdocgen.php in the
../maintenance/ directory.
-For end user / administrators, most of the documentation is located online at:
- http://www.mediawiki.org/wiki/Help:Contents
- http://www.mediawiki.org/wiki/Manual:Contents
+For end users, most of the documentation is located online at:
+ https://www.mediawiki.org/wiki/Help:Contents
+Documentation for MediaWiki site administrators is at:
+ https://www.mediawiki.org/wiki/Manual:Contents
That's it. In the execute() method, you have access to all of the normal
MediaWiki functions, so you can get a DB connection, use the cache, etc.
For full docs on the Maintenance class, see the auto-generated docs at
-http://svn.wikimedia.org/doc/classMaintenance.html
+https://doc.wikimedia.org/mediawiki-core/master/php/html/classMaintenance.html
separately. Drop them into this extensions directory and enable as
per the extension's directions.
+You can find a list of extensions and documentation on the MediaWiki website:
+ https://www.mediawiki.org/wiki/Category:Extensions
+
+
If you are a developer, you want to fetch the extension tree in another
directory and make a symbolic link:
mediawiki/extensions$ ln -s ../../extensions-trunk/FooBarExt
-The extensions are available through Git:
+Most extensions are available through Git:
https://gerrit.wikimedia.org/r/#/admin/projects/
+ https://git.wikimedia.org/project/mediawiki
-or Subversion:
+Old extensions are on Subversion:
https://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/
-You can find documentation and additional extensions on MediaWiki website:
- https://www.mediawiki.org/wiki/Category:Extensions
-
Please note that under POSIX systems (Linux...), parent of a symbolic path
refers to the link source, NOT to the target! You should check the env
* Host for UDP profiler.
*
* The host should be running a daemon which can be obtained from MediaWiki
- * Subversion at: http://svn.wikimedia.org/svnroot/mediawiki/trunk/udpprofile
+ * Git at:
+ * http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile
*/
$wgUDPProfilerHost = '127.0.0.1';
* @param string $name The content model ID, as given by a CONTENT_MODEL_XXX
* constant or returned by Revision::getContentModel().
*
- * @return string The content format's localized name.
+ * @return string The content model's localized name.
* @throws MWException if the model id isn't known.
*/
public static function getLocalizedName( $name ) {
+ // Messages: content-model-wikitext, content-model-text,
+ // content-model-javascript, content-model-css
$key = "content-model-$name";
$msg = wfMessage( $key );
/**
* ProfilerSimpleUDP class, that sends out messages for 'udpprofile' daemon
- * (the one from mediawiki/trunk/udpprofile SVN )
+ * (the one from
+ * http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile)
* @ingroup Profiler
*/
class ProfilerSimpleUDP extends ProfilerSimple {
$length -= $eLength;
$string = substr( $string, 0, $length ); // xyz...
$string = $this->removeBadCharLast( $string );
+ $string = rtrim( $string );
$string = $string . $ellipsis;
} else {
$length += $eLength;
$string = substr( $string, $length ); // ...xyz
$string = $this->removeBadCharFirst( $string );
+ $string = ltrim( $string );
$string = $ellipsis . $string;
}
}
'disclaimers' => 'Disclaimers',
'disclaimerpage' => 'Project:General disclaimer',
'edithelp' => 'Editing help',
-'edithelppage' => '//www.mediawiki.org/wiki/Special:MyLanguage/Help:Editing_pages', # do not translate or duplicate this message to other languages
+'edithelppage' => 'https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Editing_pages', # do not translate or duplicate this message to other languages
'helppage' => 'Help:Contents',
'mainpage' => 'Main Page',
'mainpage-description' => 'Main page',
'allmessagesdefault' => 'Default message text',
'allmessagescurrent' => 'Current message text',
'allmessagestext' => 'This is a list of system messages available in the MediaWiki namespace.
-Please visit [//www.mediawiki.org/wiki/Localisation MediaWiki Localisation] and [//translatewiki.net translatewiki.net] if you wish to contribute to the generic MediaWiki localisation.',
+Please visit [https://www.mediawiki.org/wiki/Localisation MediaWiki Localisation] and [//translatewiki.net translatewiki.net] if you wish to contribute to the generic MediaWiki localisation.',
'allmessagesnotsupportedDB' => "This page cannot be used because '''\$wgUseDatabaseMessages''' has been disabled.",
'allmessages-filter-legend' => 'Filter',
'allmessages-filter' => 'Filter by customization state:',
# External editor support
'edit-externally' => 'Edit this file using an external application',
-'edit-externally-help' => '(See the [//www.mediawiki.org/wiki/Manual:External_editors setup instructions] for more information)',
+'edit-externally-help' => '(See the [https://www.mediawiki.org/wiki/Manual:External_editors setup instructions] for more information)',
# 'all' in various places, this might be different for inflected languages
'watchlistall2' => 'all',
'version-version' => '(Version $1)',
'version-svn-revision' => '(r$2)', # only translate this message to other languages if you have to change it
'version-license' => 'License',
-'version-poweredby-credits' => "This wiki is powered by '''[//www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
+'version-poweredby-credits' => "This wiki is powered by '''[https://www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
'version-poweredby-others' => 'others',
'version-poweredby-translators' => 'translatewiki.net translators',
'version-credits-summary' => 'We would like to recognize the following persons for their contribution to [[Special:Version|MediaWiki]].',
* Imagini animate : <code>image/gif</code>
* Fișiere sunet : <code>audio/ogg</code>, <code>audio/x-ogg</code>
* Fișiere video : <code>video/ogg</code>, <code>video/x-ogg</code>
-* Fișiere PDF : <code>application/pdf</code>
-
-Lista tipurilor MIME recunoscute de MediaWiki poate fi găsită la [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/mime.types?view=markup fișiere mime.types].',
+* Fișiere PDF : <code>application/pdf</code>',
'mimetype' => 'Tip MIME:',
'download' => 'descarcă',
+++ /dev/null
--- Column added 2005-05-24
-
-ALTER TABLE /*$wgDBprefix*/validate
- ADD COLUMN val_ip varchar(20) NOT NULL default '';
+++ /dev/null
--- For article validation
-
-DROP TABLE IF EXISTS /*$wgDBprefix*/validate;
-CREATE TABLE /*$wgDBprefix*/validate (
- `val_user` int(11) NOT NULL default '0',
- `val_page` int(11) unsigned NOT NULL default '0',
- `val_revision` int(11) unsigned NOT NULL default '0',
- `val_type` int(11) unsigned NOT NULL default '0',
- `val_value` int(11) default '0',
- `val_comment` varchar(255) NOT NULL default '',
- `val_ip` varchar(20) NOT NULL default '',
- KEY `val_user` (`val_user`,`val_revision`)
-) /*$wgDBTableOptions*/;
#!/usr/bin/perl
## Convert data from a MySQL mediawiki database into a Postgres mediawiki database
-## svn: $Id$
## NOTE: It is probably easier to dump your wiki using maintenance/dumpBackup.php
## and then import it with maintenance/importDump.php
print qq{
-- Dump of MySQL Mediawiki tables for import into a Postgres Mediawiki schema
-- Performed by the program: $0
--- Version: $VERSION (subversion }.q{$LastChangedRevision$}.qq{)
+-- Version: $VERSION
-- Author: Greg Sabino Mullane <greg\@turnstep.com> Comments welcome
--
-- This file was created: $now
};
// Legacy (for compatibility with the code previously in skins/common.edit.js)
- window.addButton = toolbar.addButton;
- window.insertTags = toolbar.insertTags;
+ mw.log.deprecate( window, 'addButton', toolbar.addButton, 'Use mw.toolbar.addButton instead' );
+ mw.log.deprecate( window, 'insertTags', toolbar.insertTags, 'Use mw.toolbar.insertTags instead' );
- // Explose API publicly
+ // Expose API publicly
mw.toolbar = toolbar;
$( function () {
'MockFSFile' => "$testDir/phpunit/mocks/filebackend/MockFSFile.php",
'MockFileBackend' => "$testDir/phpunit/mocks/filebackend/MockFileBackend.php",
'MockBitmapHandler' => "$testDir/phpunit/mocks/media/MockBitmapHandler.php",
- 'MockImageHandler' => "$testDir/phpunit/mocks/media/MockBitmapHandler.php",
- 'MockSvgHandler' => "$testDir/phpunit/mocks/media/MockBitmapHandler.php",
+ 'MockImageHandler' => "$testDir/phpunit/mocks/media/MockImageHandler.php",
+ 'MockSvgHandler' => "$testDir/phpunit/mocks/media/MockSvgHandler.php",
# tests/phpunit/languages
'LanguageClassesTestCase' => "$testDir/phpunit/languages/LanguageClassesTestCase.php",
/**
- * @covers ::testWfArrayDiff2
+ * @covers ::wfArrayToCgi
*/
public function testArrayToCGI2() {
$this->assertEquals(
$this->getLang()->truncate( "123456789", -5, 'XXXXXXXXXXXXXXX' ),
'truncate suffix, large ellipsis'
);
+ $this->assertEquals(
+ "123XXX",
+ $this->getLang()->truncate( "123 ", 9, 'XXX' ),
+ 'truncate prefix, with spaces'
+ );
+ $this->assertEquals(
+ "12345XXX",
+ $this->getLang()->truncate( "12345 8", 11, 'XXX' ),
+ 'truncate prefix, with spaces and non-space ending'
+ );
+ $this->assertEquals(
+ "XXX234",
+ $this->getLang()->truncate( "1 234", -8, 'XXX' ),
+ 'truncate suffix, with spaces'
+ );
+ $this->assertEquals(
+ "12345XXX",
+ $this->getLang()->truncate( "1234567890", 5, 'XXX', false ),
+ 'truncate without adjustment'
+ );
}
/**
<?php
/**
- * Fake handler for images.
+ * Fake handler for Bitmap images.
*
* 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
function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
return MockImageHandler::doFakeTransform( $this, $image, $dstPath, $dstUrl, $params, $flags );
}
+
function doClientImage( $image, $scalerParams ) {
return $this->getClientScalingThumbnailImage( $image, $scalerParams );
}
}
-class MockSvgHandler extends SvgHandler {
- function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
- return MockImageHandler::doFakeTransform( $this, $image, $dstPath, $dstUrl, $params, $flags );
- }
-}
-/**
- * Mock handler for images.
- *
- * This is really intended for unit testing.
- *
- * @ingroup Media
- */
-class MockImageHandler {
-
- /**
- * Override BitmapHandler::doTransform() making sure we do not generate
- * a thumbnail at all. That is merely returning a ThumbnailImage that
- * will be consumed by the unit test. There is no need to create a real
- * thumbnail on the filesystem.
- */
- static function doFakeTransform( $that, $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
- # Example of what we receive:
- # $image: LocalFile
- # $dstPath: /tmp/transform_7d0a7a2f1a09-1.jpg
- # $dstUrl : http://example.com/images/thumb/0/09/Bad.jpg/320px-Bad.jpg
- # $params: width: 320, descriptionUrl http://trunk.dev/wiki/File:Bad.jpg
-
- $that->normaliseParams( $image, $params );
-
- $scalerParams = array(
- # The size to which the image will be resized
- 'physicalWidth' => $params['physicalWidth'],
- 'physicalHeight' => $params['physicalHeight'],
- 'physicalDimensions' => "{$params['physicalWidth']}x{$params['physicalHeight']}",
- # The size of the image on the page
- 'clientWidth' => $params['width'],
- 'clientHeight' => $params['height'],
- # Comment as will be added to the EXIF of the thumbnail
- 'comment' => isset( $params['descriptionUrl'] ) ?
- "File source: {$params['descriptionUrl']}" : '',
- # Properties of the original image
- 'srcWidth' => $image->getWidth(),
- 'srcHeight' => $image->getHeight(),
- 'mimeType' => $image->getMimeType(),
- 'dstPath' => $dstPath,
- 'dstUrl' => $dstUrl,
- );
-
- # In some cases, we do not bother generating a thumbnail.
- if ( !$image->mustRender() &&
- $scalerParams['physicalWidth'] == $scalerParams['srcWidth']
- && $scalerParams['physicalHeight'] == $scalerParams['srcHeight']
- ) {
- wfDebug( __METHOD__ . ": returning unscaled image\n" );
- // getClientScalingThumbnailImage is protected
- return $that->doClientImage( $image, $scalerParams );
- }
-
- return new ThumbnailImage( $image, $dstUrl, false, $params );
- }
-}
--- /dev/null
+<?php
+/**
+ * Fake handler for images.
+ *
+ * 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 Media
+ */
+
+/**
+ * Mock handler for images.
+ *
+ * This is really intended for unit testing.
+ *
+ * @ingroup Media
+ */
+class MockImageHandler {
+
+ /**
+ * Override BitmapHandler::doTransform() making sure we do not generate
+ * a thumbnail at all. That is merely returning a ThumbnailImage that
+ * will be consumed by the unit test. There is no need to create a real
+ * thumbnail on the filesystem.
+ */
+ static function doFakeTransform( $that, $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
+ # Example of what we receive:
+ # $image: LocalFile
+ # $dstPath: /tmp/transform_7d0a7a2f1a09-1.jpg
+ # $dstUrl : http://example.com/images/thumb/0/09/Bad.jpg/320px-Bad.jpg
+ # $params: width: 320, descriptionUrl http://trunk.dev/wiki/File:Bad.jpg
+
+ $that->normaliseParams( $image, $params );
+
+ $scalerParams = array(
+ # The size to which the image will be resized
+ 'physicalWidth' => $params['physicalWidth'],
+ 'physicalHeight' => $params['physicalHeight'],
+ 'physicalDimensions' => "{$params['physicalWidth']}x{$params['physicalHeight']}",
+ # The size of the image on the page
+ 'clientWidth' => $params['width'],
+ 'clientHeight' => $params['height'],
+ # Comment as will be added to the EXIF of the thumbnail
+ 'comment' => isset( $params['descriptionUrl'] ) ?
+ "File source: {$params['descriptionUrl']}" : '',
+ # Properties of the original image
+ 'srcWidth' => $image->getWidth(),
+ 'srcHeight' => $image->getHeight(),
+ 'mimeType' => $image->getMimeType(),
+ 'dstPath' => $dstPath,
+ 'dstUrl' => $dstUrl,
+ );
+
+ # In some cases, we do not bother generating a thumbnail.
+ if ( !$image->mustRender() &&
+ $scalerParams['physicalWidth'] == $scalerParams['srcWidth']
+ && $scalerParams['physicalHeight'] == $scalerParams['srcHeight']
+ ) {
+ wfDebug( __METHOD__ . ": returning unscaled image\n" );
+ // getClientScalingThumbnailImage is protected
+ return $that->doClientImage( $image, $scalerParams );
+ }
+
+ return new ThumbnailImage( $image, $dstUrl, false, $params );
+ }
+}
--- /dev/null
+<?php
+/**
+ * Fake handler for SVG images.
+ *
+ * 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 Media
+ */
+
+class MockSvgHandler extends SvgHandler {
+ function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
+ return MockImageHandler::doFakeTransform( $this, $image, $dstPath, $dstUrl, $params, $flags );
+ }
+}