which can be cascading (previously 'sysop' was hard-coded as the only one).
* XHTML5 support has been improved. If you set $wgMimeType = 'application/xhtml+xml'
MediaWiki will try outputting markup acording to XHTML5 rules.
+* New hook 'TitleSquidURLs' for manipulating the list of URLs to be purged from
+ HTTP caches when a page is changed.
=== Bug fixes in 1.22 ===
* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
stored in the database.
* (bug 47219) Allow specifying change type of Wikipedia feed items
* prop=imageinfo now allows setting iiurlheight without setting iiurlwidth
-* prop=info now adds the content model of the title.
+* prop=info now adds the content model and page language of the title.
* New upload log entries will now contain information on the relavent
image (sha1 and timestamp).
// Bail if PHP is too low
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
- require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
+ require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
wfPHPVersionError( 'api.php' );
}
// Initialise common code.
-require ( __DIR__ . '/includes/WebStart.php' );
+require __DIR__ . '/includes/WebStart.php';
wfProfileIn( 'api.php' );
$starttime = microtime( true );
making for some slight savings in memory and load-up performance at runtime.
Admins who want to have all the reversed titles can add:
- require_once('extensions/ReverseTitle.php');
+ require_once 'extensions/ReverseTitle.php';
...to their LocalSettings.php file; those of us who don't want or need it can
just leave it out.
$user: Current user object
&$whitelisted: Boolean value of whether this title is whitelisted
+'TitleSquidURLs': Called to determine which URLs to purge from HTTP caches.
+$this: Title object to purge
+&$urls: An array of URLs to purge from the caches, to be manipulated.
+
'UndeleteForm::showHistory': Called in UndeleteForm::showHistory, after a
PageArchive object has been created but before any further processing is done.
&$archive: PageArchive object
EXAMPLE:
<?php
-require("MemCachedClient.inc.php");
+require 'MemCachedClient.inc.php';
// set the servers, with the last one having an integer weight value of 3
$options["servers"] = array("10.0.0.15:11000","10.0.0.16:11001",array("10.0.0.17:11002", 3));
*/
define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
-require ( __DIR__ . '/includes/WebStart.php' );
+require __DIR__ . '/includes/WebStart.php';
wfProfileIn( 'img_auth.php' );
# Set action base paths so that WebRequest::getPathInfo()
'UnwatchedpagesPage' => 'includes/specials/SpecialUnwatchedpages.php',
'UploadChunkFileException' => 'includes/upload/UploadFromChunks.php',
'UploadChunkZeroLengthFileException' => 'includes/upload/UploadFromChunks.php',
+ 'UploadChunkVerificationException' => 'includes/upload/UploadFromChunks.php',
'UploadForm' => 'includes/specials/SpecialUpload.php',
'UploadSourceField' => 'includes/specials/SpecialUpload.php',
'UserrightsPage' => 'includes/specials/SpecialUserrights.php',
}
if ( !class_exists( 'AutoLoader' ) ) {
- require_once( "$IP/includes/AutoLoader.php" );
+ require_once "$IP/includes/AutoLoader.php";
}
wfProfileIn( $fname . '-exception' );
wfProfileOut( $fname . '-exception' );
wfProfileIn( $fname . '-includes' );
-require_once( "$IP/includes/normal/UtfNormalUtil.php" );
-require_once( "$IP/includes/GlobalFunctions.php" );
-require_once( "$IP/includes/ProxyTools.php" );
-require_once( "$IP/includes/normal/UtfNormalDefines.php" );
+require_once "$IP/includes/normal/UtfNormalUtil.php";
+require_once "$IP/includes/GlobalFunctions.php";
+require_once "$IP/includes/ProxyTools.php";
+require_once "$IP/includes/normal/UtfNormalDefines.php";
wfProfileOut( $fname . '-includes' );
if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
}
}
+ wfRunHooks( 'TitleSquidURLs', array( $this, &$urls ) );
return $urls;
}
$from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText();
$to = Title::makeTitle( $row->rd_namespace, $row->rd_title, $row->rd_fragment, $row->rd_interwiki );
unset( $this->mPendingRedirectIDs[$rdfrom] );
- if ( !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) {
+ if ( !$to->isExternal() && !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) {
$lb->add( $row->rd_namespace, $row->rd_title );
}
$this->mRedirectTitles[$from] = $to;
$dbkey = $title->getDBkey();
$pageInfo['contentmodel'] = $title->getContentModel();
+ $pageInfo['pagelanguage'] = $title->getPageLanguage()->getCode();
if ( $titleExists ) {
global $wgDisableCounters;
if ( !$this->mUpload->getTitle() ) {
$this->dieUsage( 'Invalid file title supplied', 'internal-error' );
}
- } elseif ( $this->mParams['async'] ) {
+ } elseif ( $this->mParams['async'] && $this->mParams['filekey'] ) {
// defer verification to background process
} else {
+ wfDebug( __METHOD__ . 'about to verify' );
$this->verifyUpload();
}
$chunkPath = $request->getFileTempname( 'chunk' );
$chunkSize = $request->getUpload( 'chunk' )->getSize();
if ( $this->mParams['offset'] == 0 ) {
- $filekey = $this->performStash();
+ try {
+ $filekey = $this->performStash();
+ } catch ( MWException $e ) {
+ // FIXME: Error handling here is wrong/different from rest of this
+ $this->dieUsage( $e->getMessage(), 'stashfailed' );
+ }
} else {
$filekey = $this->mParams['filekey'];
/** @var $status Status */
return $output;
}
do {
- if ( '{' != $text{$offset} ) {
+ if ( '{' != $text[$offset] ) {
preg_match( "/(\\{?\"([^\"\\\\]|\\\\.)*\"|[^,{}]+)+([,}]+)/",
$text, $match, 0, $offset );
$offset += strlen( $match[0] );
- $output[] = ( '"' != $match[1]{0}
+ $output[] = ( '"' != $match[1][0]
? $match[1]
: stripcslashes( substr( $match[1], 1, -1 ) ) );
if ( '},' == $match[3] ) {
foreach ( $this->extensions as $extName ) {
$encExtName = self::escapePhpString( $extName );
- $localSettings .= "require_once( \"\$IP/extensions/$encExtName/$encExtName.php\" );\n";
+ $localSettings .= "require_once \"\$IP/extensions/$encExtName/$encExtName.php\";\n";
}
}
If the php_normal.so module is loaded in php.ini, the normalization functions
will automatically use it. If you can't (or don't want to) load it in php.ini,
-you may be able to load it using the dl() function before include()ing or
-require()ing UtfNormal.php, and it will be picked up.
+you may be able to load it using the dl() function before the inclusion of
+UtfNormal.php, and it will be picked up.
$this->addSource( $wgResourceLoaderSources );
// Register core modules
- $this->register( include( "$IP/resources/Resources.php" ) );
+ $this->register( include "$IP/resources/Resources.php" );
// Register extension modules
wfRunHooks( 'ResourceLoaderRegisterModules', array( &$this ) );
$this->register( $wgResourceModules );
}
/**
- * Verify the mime type
+ * Verify the mime type.
*
+ * @note Only checks that it is not an evil mime. The does it have
+ * correct extension given its mime type check is in verifyFile.
* @param string $mime representing the mime
* @return mixed true if the file is verified, an array otherwise
*/
return array( 'filetype-badmime', $mime );
}
- # XXX: Missing extension will be caught by validateName() via getTitle()
- if ( $this->mFinalExtension != '' && !$this->verifyExtension( $mime, $this->mFinalExtension ) ) {
- wfProfileOut( __METHOD__ );
- return array( 'filetype-mime-mismatch', $this->mFinalExtension, $mime );
- }
-
# Check IE type
$fp = fopen( $this->mTempPath, 'rb' );
$chunk = fread( $fp, 256 );
return true;
}
+
/**
* Verifies that it's ok to include the uploaded file
*
* @return mixed true of the file is verified, array otherwise.
*/
protected function verifyFile() {
+ global $wgVerifyMimeType;
+ wfProfileIn( __METHOD__ );
+
+ $status = $this->verifyPartialFile();
+ if ( $status !== true ) {
+ wfProfileOut( __METHOD__ );
+ return $status;
+ }
+
+ if ( $wgVerifyMimeType ) {
+ $this->mFileProps = FSFile::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
+ $mime = $this->mFileProps['file-mime'];
+
+ # XXX: Missing extension will be caught by validateName() via getTitle()
+ if ( $this->mFinalExtension != '' && !$this->verifyExtension( $mime, $this->mFinalExtension ) ) {
+ wfProfileOut( __METHOD__ );
+ return array( 'filetype-mime-mismatch', $this->mFinalExtension, $mime );
+ }
+ }
+
+
+ $handler = MediaHandler::getHandler( $mime );
+ if ( $handler ) {
+ $handlerStatus = $handler->verifyUpload( $this->mTempPath );
+ if ( !$handlerStatus->isOK() ) {
+ $errors = $handlerStatus->getErrorsArray();
+ wfProfileOut( __METHOD__ );
+ return reset( $errors );
+ }
+ }
+
+ wfRunHooks( 'UploadVerifyFile', array( $this, $mime, &$status ) );
+ if ( $status !== true ) {
+ wfProfileOut( __METHOD__ );
+ return $status;
+ }
+
+ wfDebug( __METHOD__ . ": all clear; passing.\n" );
+ wfProfileOut( __METHOD__ );
+ return true;
+ }
+
+ /**
+ * A verification routine suitable for partial files
+ *
+ * Runs the blacklist checks, but not any checks that may
+ * assume the entire file is present.
+ *
+ * @return Mixed true for valid or array with error message key.
+ */
+ protected function verifyPartialFile() {
global $wgAllowJavaUploads, $wgDisableUploadScriptChecks;
wfProfileIn( __METHOD__ );
- # get the title, even though we are doing nothing with it, because
- # we need to populate mFinalExtension
+ # getTitle() sets some internal parameters like $this->mFinalExtension
$this->getTitle();
$this->mFileProps = FSFile::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
return array( 'uploadvirus', $virus );
}
- $handler = MediaHandler::getHandler( $mime );
- if ( $handler ) {
- $handlerStatus = $handler->verifyUpload( $this->mTempPath );
- if ( !$handlerStatus->isOK() ) {
- $errors = $handlerStatus->getErrorsArray();
- wfProfileOut( __METHOD__ );
- return reset( $errors );
- }
- }
-
- wfRunHooks( 'UploadVerifyFile', array( $this, $mime, &$status ) );
- if ( $status !== true ) {
- wfProfileOut( __METHOD__ );
- return $status;
- }
-
- wfDebug( __METHOD__ . ": all clear; passing.\n" );
wfProfileOut( __METHOD__ );
return true;
}
if ( $this->mTitle !== false ) {
return $this->mTitle;
}
-
/* Assume that if a user specified File:Something.jpg, this is an error
* and that the namespace prefix needs to be stripped of.
*/
// Stash file is the called on creating a new chunk session:
$this->mChunkIndex = 0;
$this->mOffset = 0;
+
+ $this->verifyChunk();
// Create a local stash target
$this->mLocalFile = parent::stashFile();
// Update the initial file offset (based on file size)
return $status;
}
wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds.\n" );
+
+ $this->mTempPath = $tmpPath; // file system path
+ $this->mFileSize = filesize( $this->mTempPath ); //Since this was set for the last chunk previously
+ $ret = $this->verifyUpload();
+ if ( $ret['status'] !== UploadBase::OK ) {
+ wfDebugLog( 'fileconcatenate', "Verification failed for chunked upload" );
+ $status->fatal( $this->getVerificationErrorCode( $ret['status'] ) );
+ return $status;
+ }
+
// Update the mTempPath and mLocalFile
// (for FileUpload or normal Stash to take over)
- $this->mTempPath = $tmpPath; // file system path
$tStart = microtime( true );
$this->mLocalFile = parent::stashFile( $this->user );
$tAmount = microtime( true ) - $tStart;
if ( $preAppendOffset == $offset ) {
// Update local chunk index for the current chunk
$this->mChunkIndex++;
+ try {
+ # For some reason mTempPath is set to first part
+ $oldTemp = $this->mTempPath;
+ $this->mTempPath = $chunkPath;
+ $this->verifyChunk();
+ $this->mTempPath = $oldTemp;
+ } catch ( UploadChunkVerificationException $e ) {
+ return Status::newFatal( $e->getMessage() );
+ }
$status = $this->outputChunk( $chunkPath );
if ( $status->isGood() ) {
// Update local offset:
}
return $this->mFileKey . '.' . $index;
}
+
+ /**
+ * Verify that the chunk isn't really an evil html file
+ *
+ * @throws UploadChunkVerificationException
+ */
+ private function verifyChunk() {
+ // Rest mDesiredDestName here so we verify the name as if it were mFileKey
+ $oldDesiredDestName = $this->mDesiredDestName;
+ $this->mDesiredDestName = $this->mFileKey;
+ $this->mTitle = false;
+ $res = $this->verifyPartialFile();
+ $this->mDesiredDestName = $oldDesiredDestName;
+ $this->mTitle = false;
+ if( is_array( $res ) ) {
+ throw new UploadChunkVerificationException( $res[0] );
+ }
+ }
}
class UploadChunkZeroLengthFileException extends MWException {};
class UploadChunkFileException extends MWException {};
+class UploadChunkVerificationException extends MWException {};
return $this->mFileProps['sha1'];
}
- /**
- * File has been previously verified so no need to do so again.
- *
- * @return bool
+ /*
+ * protected function verifyFile() inherited
*/
- protected function verifyFile() {
- return true;
- }
/**
* Stash the file.
* @return string
*/
public static function getExtensionForPath( $path ) {
+ global $wgFileBlacklist;
// Does this have an extension?
$n = strrpos( $path, '.' );
$extension = null;
throw new UploadStashFileException( "extension is null" );
}
- return File::normalizeExtension( $extension );
+ $extension = File::normalizeExtension( $extension );
+ if ( in_array( $extension, $wgFileBlacklist ) ) {
+ // The file should already be checked for being evil.
+ // However, if somehow we got here, we definitely
+ // don't want to give it an extension of .php and
+ // put it in a web accesible directory.
+ return '';
+ }
+ return $extension;
}
/**
# 5.1, respectively.
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
- require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
+ require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
wfPHPVersionError( 'index.php' );
}
# Initialise common code. This gives us access to GlobalFunctions, the
# AutoLoader, and the globals $wgRequest, $wgOut, $wgUser, $wgLang and
# $wgContLang, amongst others; it does *not* load $wgTitle
-require ( __DIR__ . '/includes/WebStart.php' );
+require __DIR__ . '/includes/WebStart.php';
$mediaWiki = new MediaWiki();
$mediaWiki->run();
# Read language names
global $wgLanguageNames;
-require_once( __DIR__ . '/Names.php' );
+require_once __DIR__ . '/Names.php';
if ( function_exists( 'mb_strtoupper' ) ) {
mb_internal_encoding( 'UTF-8' );
static $coreLanguageNames;
if ( $coreLanguageNames === null ) {
- include( MWInit::compiledPath( 'languages/Names.php' ) );
+ include MWInit::compiledPath( 'languages/Names.php' );
}
if ( isset( $coreLanguageNames[$tag] )
}
if ( file_exists( "$IP/languages/classes/$class.php" ) ) {
- include_once( "$IP/languages/classes/$class.php" );
+ include_once "$IP/languages/classes/$class.php";
}
}
static $coreLanguageNames;
if ( $coreLanguageNames === null ) {
- include( MWInit::compiledPath( 'languages/Names.php' ) );
+ include MWInit::compiledPath( 'languages/Names.php' );
}
$names = array();
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
-require_once( __DIR__ . '/LanguageZh.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
+require_once __DIR__ . '/LanguageZh.php';
/**
* @ingroup Language
}
function loadDefaultTables() {
- require( __DIR__ . "/../../includes/ZhConversion.php" );
+ require __DIR__ . '/../../includes/ZhConversion.php';
$this->mTables = array(
'gan-hans' => new ReplacementArray( $zh2Hans ),
'gan-hant' => new ReplacementArray( $zh2Hant ),
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
/**
* Conversion script between Latin and Syllabics for Inuktitut.
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
-require_once( __DIR__ . '/LanguageKk_cyrl.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
+require_once __DIR__ . '/LanguageKk_cyrl.php';
define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
}
function loadDefaultTables() {
- // require( __DIR__."/../../includes/KkConversion.php" );
+ // require __DIR__."/../../includes/KkConversion.php";
// Placeholder for future implementing. Remove variables declarations
// after generating KkConversion.php
$kk2Cyrl = array();
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
-require_once( __DIR__ . '/LanguageKu_ku.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
+require_once __DIR__ . '/LanguageKu_ku.php';
/**
* Kurdish converter routines
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
/**
* Conversion script between Latin and Tifinagh for Tachelhit.
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
-require_once( __DIR__ . '/LanguageSr_ec.php' );
-require_once( __DIR__ . '/LanguageSr_el.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
+require_once __DIR__ . '/LanguageSr_ec.php';
+require_once __DIR__ . '/LanguageSr_el.php';
/**
* There are two levels of conversion for Serbian: the script level
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
/**
* Converts Tajiki to latin orthography
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
/**
* @ingroup Language
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
-require_once( __DIR__ . '/LanguageZh_hans.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
+require_once __DIR__ . '/LanguageZh_hans.php';
/**
* @ingroup Language
}
function loadDefaultTables() {
- require( __DIR__ . "/../../includes/ZhConversion.php" );
+ require __DIR__ . "/../../includes/ZhConversion.php";
$this->mTables = array(
'zh-hans' => new ReplacementArray( $zh2Hans ),
'zh-hant' => new ReplacementArray( $zh2Hant ),
// Bail if PHP is too low
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
- require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
+ require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
wfPHPVersionError( 'load.php' );
}
-require ( __DIR__ . '/includes/WebStart.php' );
+require __DIR__ . '/includes/WebStart.php';
wfProfileIn( 'load.php' );
// Make sure we're on PHP5.3.2 or better
if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
- require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
+ require_once dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
wfPHPVersionError( 'cli' );
}
// Make sure the class is loaded first
if ( !MWInit::classExists( $maintClass ) ) {
if ( $classFile ) {
- require_once( $classFile );
+ require_once $classFile;
}
if ( !MWInit::classExists( $maintClass ) ) {
$this->error( "Cannot spawn child: $maintClass" );
( strpos( file_get_contents( $file ), '$maintClass' ) === false ) ) {
continue;
}
- require( $file );
+ require $file;
$vars = get_defined_vars();
if ( array_key_exists( 'maintClass', $vars ) ) {
self::$mCoreScripts[$vars['maintClass']] = $file;
* @ingroup MaintenanceArchive
*/
-require( __DIR__ . '/../commandLine.inc' );
+require __DIR__ . '/../commandLine.inc';
/**
* Maintenance script that upgrade for log_id/log_deleted fields in a
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to correct wrong values in the `page_latest` field
*/
function loadPlugin( $class, $file ) {
if ( $file != '' ) {
- require_once( $file );
+ require_once $file;
}
$register = array( $class, 'register' );
call_user_func_array( $register, array( &$this ) );
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/backup.inc' );
+require_once __DIR__ . '/backup.inc';
/**
* @ingroup Maintenance
* @ingroup Benchmark
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Base class for benchmark scripts.
* @author Platonides
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmarks HTTP request vs HTTPS request.
* @ingroup Benchmark
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmarks SQL DELETE vs SQL TRUNCATE.
* @author Platonides
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmark if elseif... versus switch case.
* @ingroup Benchmark
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
function bfNormalizeTitleStrTr( $str ) {
return strtr( $str, '_', ' ' );
* @ingroup Benchmark
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* This little benchmark executes the regexp used in Language->checkTitleEncoding()
* @author Tyler Romeo
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmarks wfBaseConvert().
* @author Platonides
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmarks wfIsWindows().
* @ingroup Benchmark
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmarks %MediaWiki hooks.
* @ingroup Benchmark
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmarks Squid purge.
*/
/** */
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
function cdbShowHelp( $command ) {
$commandList = array(
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to change the password of a given user.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to check that pages marked as being redirects really are.
* @file
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to check images to see if they exist, are readable, etc.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to check syntax of all PHP files in MediaWiki.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to check that database usernames are actually valid.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to cleans up old database tables, dropping old indexes
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/cleanupTable.inc' );
+require_once __DIR__ . '/cleanupTable.inc';
/**
* Maintenance script to clean up broken page links when somebody turns on $wgCapitalLinks.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/cleanupTable.inc' );
+require_once __DIR__ . '/cleanupTable.inc';
/**
* Maintenance script to clean up broken, unparseable upload filenames.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that removes hidden preferences from the database.
* @author Roan Kattouw
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to remove cache entries for removed ResourceLoader modules
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to cleanup all spam from a given hostname.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Generic class to cleanup a database table. Already subclasses Maintenance.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/cleanupTable.inc' );
+require_once __DIR__ . '/cleanupTable.inc';
/**
* Maintenance script to clean up broken, unparseable titles.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to remove old or broken uploads from temporary uploaded
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/cleanupTable.inc' );
+require_once __DIR__ . '/cleanupTable.inc';
/**
* Maintenance script to remove broken, unparseable titles in the watchlist table.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to remove all statistics tracking from the cache.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to clear the cache of interwiki prefixes for all local wikis.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
global $optionsWithArgs;
if ( !isset( $optionsWithArgs ) ) {
}
$maintClass = 'CommandLineInc';
-require( RUN_MAINTENANCE_IF_MAIN );
+require RUN_MAINTENANCE_IF_MAIN;
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/dumpIterator.php' );
+require_once __DIR__ . '/dumpIterator.php';
/**
* Maintenance script to take page text out of an XML dump file and render
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to convert from the old links schema (string->ID)
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to convert user options to the new `user_properties` table.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Copy all files in one container of one backend to another.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Copy all jobs from one job queue system to another.
* @author Pablo Castellano <pablo@anche.no>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to create an account and grant it administrator rights.
* @author Aaron Schulz
*/
-require_once( __DIR__ . '/Maintenance.php' );
-require_once( __DIR__ . '/deleteArchivedFiles.inc' );
+require_once __DIR__ . '/Maintenance.php';
+require_once __DIR__ . '/deleteArchivedFiles.inc';
/**
* Maintenance script to delete archived (non-current) files from the database.
* @author Aaron Schulz
*/
-require_once( __DIR__ . '/Maintenance.php' );
-require_once( __DIR__ . '/deleteArchivedRevisions.inc' );
+require_once __DIR__ . '/Maintenance.php';
+require_once __DIR__ . '/deleteArchivedRevisions.inc';
/**
* Maintenance script to delete archived (deleted from public) revisions
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to delete a batch of pages.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes all pages in the MediaWiki namespace
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes all pages in the MediaWiki namespace
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes image information from the object cache.
* @author Rob Church <robchur@gmail.com>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes old (non-current) revisions from the database.
* @todo More efficient cleanup of text records
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes revisions which refer to a nonexisting page.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes one or more revisions by moving them
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes self-references to $wgServer
# We use require and return true here because when you return false
# the php webserver will discard post data and things like login
# will not function in the dev environment.
- require( $file );
+ require $file;
return true;
}
$mime = false;
// Detect compiled mode
# Get the MWInit class
-require_once( "$IP/includes/Init.php" );
-require_once( "$IP/includes/AutoLoader.php" );
+require_once "$IP/includes/Init.php";
+require_once "$IP/includes/AutoLoader.php";
# Stub the profiler
-require_once( "$IP/includes/profiler/Profiler.php" );
+require_once "$IP/includes/profiler/Profiler.php";
# Start the profiler
$wgProfiler = array();
if ( file_exists( "$IP/StartProfiler.php" ) ) {
- require( "$IP/StartProfiler.php" );
+ require "$IP/StartProfiler.php";
}
// Some other requires
-require_once( "$IP/includes/Defines.php" );
-require_once( MWInit::compiledPath( 'includes/DefaultSettings.php' ) );
+require_once "$IP/includes/Defines.php";
+require_once MWInit::compiledPath( 'includes/DefaultSettings.php' );
if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
# Use a callback function to configure MediaWiki
# Maybe a hook?
global $cluster;
$cluster = 'pmtpa';
- require( MWInit::interpretedPath( '../wmf-config/wgConf.php' ) );
+ require MWInit::interpretedPath( '../wmf-config/wgConf.php' );
}
// Require the configuration (probably LocalSettings.php)
- require( $maintenance->loadSettings() );
+ require $maintenance->loadSettings();
}
if ( $maintenance->getDbType() === Maintenance::DB_ADMIN &&
is_readable( "$IP/AdminSettings.php" ) )
{
- require( MWInit::interpretedPath( 'AdminSettings.php' ) );
+ require MWInit::interpretedPath( 'AdminSettings.php' );
}
if ( $maintenance->getDbType() === Maintenance::DB_NONE ) {
}
$maintenance->finalSetup();
// Some last includes
-require_once( MWInit::compiledPath( 'includes/Setup.php' ) );
+require_once MWInit::compiledPath( 'includes/Setup.php' );
// Much much faster startup than creating a title object
$wgTitle = null;
$optionsWithArgs = array( 'pagelist', 'start', 'end', 'revstart', 'revend' );
-require_once( __DIR__ . '/commandLine.inc' );
-require_once( __DIR__ . '/backup.inc' );
+require_once __DIR__ . '/commandLine.inc';
+require_once __DIR__ . '/backup.inc';
$dumper = new BackupDumper( $argv );
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Base class for interating over a dump.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that generates a plaintext link dump.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that generates a page name dump for SisterSites usage.
$originalDir = getcwd();
-require_once( __DIR__ . '/commandLine.inc' );
-require_once( __DIR__ . '/backupTextPass.inc' );
+require_once __DIR__ . '/commandLine.inc';
+require_once __DIR__ . '/backupTextPass.inc';
$dumper = new TextPassDumper( $argv );
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to dump a the list of files uploaded,
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to make a page edit.
$optionsWithArgs = array( 'd' );
/** */
-require_once( __DIR__ . "/commandLine.inc" );
+require_once __DIR__ . "/commandLine.inc";
if ( isset( $options['d'] ) ) {
$d = $options['d'];
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script used to fetch page text in a subprocess.
$wgProfiler = array( 'class' => 'ProfilerSimpleText' );
error_reporting( E_ALL );
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to test fileop performance.
* @author Antoine Musso <hashar at free dot fr>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that compares documented and actually present mismatches.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that fixes double redirects.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that fixes any entriy for protocol-relative URLs
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that fixes erroneous page_latest values
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that fixes timestamp corruption caused by one or
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that fixes the user_registration field.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that formats RELEASE-NOTE file to wiki text or HTML markup.
$wgEnableWriteAPI = true; // enable API.
// Install & enable Parser Hook extensions to increase code coverage. E.g.:
- require_once("extensions/ParserFunctions/ParserFunctions.php");
- require_once("extensions/Cite/Cite.php");
- require_once("extensions/inputbox/inputbox.php");
- require_once("extensions/Sort/Sort.php");
- require_once("extensions/wikihiero/wikihiero.php");
- require_once("extensions/CharInsert/CharInsert.php");
- require_once("extensions/FixedImage/FixedImage.php");
+ require_once "extensions/ParserFunctions/ParserFunctions.php";
+ require_once "extensions/Cite/Cite.php";
+ require_once "extensions/inputbox/inputbox.php";
+ require_once "extensions/Sort/Sort.php";
+ require_once "extensions/wikihiero/wikihiero.php";
+ require_once "extensions/CharInsert/CharInsert.php";
+ require_once "extensions/FixedImage/FixedImage.php";
// Install & enable Special Page extensions to increase code coverage. E.g.:
- require_once("extensions/Cite/SpecialCite.php");
- require_once("extensions/Renameuser/SpecialRenameuser.php");
+ require_once "extensions/Cite/SpecialCite.php";
+ require_once "extensions/Renameuser/SpecialRenameuser.php";
// --------- End ---------
If you want to try E_STRICT error logging, add this to the above:
// ///////////////////////// COMMAND LINE HELP ////////////////////////////////////
// This is a command line script, load MediaWiki env (gives command line options);
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
// if the user asked for an explanation of command line options.
if ( isset( $options["help"] ) ) {
* @see http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that generates a sitemap for the site.
* @author Antoine Musso
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Print serialized output of MediaWiki config vars
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that displays replication lag times.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that reports the hostname of a slave server.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that outputs page text to stdout.
#!/usr/bin/hhvm -f
<?php
-require( __DIR__ . '/../Maintenance.php' );
+require __DIR__ . '/../Maintenance.php';
class RunHipHopServer extends Maintenance {
function __construct() {
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that imports XML dump files into the current wiki.
'extensions', 'comment', 'comment-file', 'comment-ext', 'summary', 'user',
'license', 'sleep', 'limit', 'from', 'source-wiki-url', 'timestamp',
);
-require_once( __DIR__ . '/commandLine.inc' );
-require_once( __DIR__ . '/importImages.inc' );
+require_once __DIR__ . '/commandLine.inc';
+require_once __DIR__ . '/importImages.inc';
$processed = $added = $ignored = $skipped = $overwritten = $failed = 0;
echo "Import Images\n\n";
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to import all scripts in the MediaWiki namespace from a
$options = array( 'help', 'nooverwrite', 'norc' );
$optionsWithArgs = array( 'title', 'user', 'comment' );
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
echo "Import Text File\n\n";
if ( count( $args ) < 1 || isset( $options['help'] ) ) {
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
class InitEditCount extends Maintenance {
public function __construct() {
* @author Rob Church <robchur@gmail.com>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to re-initialise or update the site statistics table
*/
if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.3.2' ) < 0 ) ) {
- require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
+ require_once dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
wfPHPVersionError( 'cli' );
}
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
define( 'MEDIAWIKI_INSTALL', true );
-require_once( dirname( __DIR__ ) . "/maintenance/Maintenance.php" );
+require_once dirname( __DIR__ ) . "/maintenance/Maintenance.php";
/**
* Maintenance script to install and configure MediaWiki
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to do test JavaScript validity parses using jsmin+'s parser
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to show database lag.
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that gets all messages as defined by the
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
+require_once __DIR__ . '/../commandLine.inc';
$messagesDir = __DIR__ . '/../../languages/messages/';
$runTest = false;
$run = false;
} elseif ( !strcmp( $runMode, 'raw' ) ) {
$runMode = 'raw';
}
- include( $messagesFile );
+ include $messagesFile;
$messageExist = isset( $messages );
if ( $messageExist ) {
$wgMessages[$langCode] = $messages;
}
- include( $messagesFileC );
+ include $messagesFileC;
$messageCExist = isset( $messages );
if ( $messageCExist ) {
$wgMessages[$langCodeC] = $messages;
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
+require_once __DIR__ . '/../commandLine.inc';
require_once 'languages.inc';
require_once 'checkLanguage.inc';
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
+require_once __DIR__ . '/../commandLine.inc';
require_once 'checkLanguage.inc';
require_once 'languages.inc';
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that counts how many messages we have defined
private function getNumMessages( $file ) {
// Separate function to limit scope
- require( $file );
+ require $file;
if ( isset( $messages ) ) {
return count( $messages );
} else {
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that tests various language time and date functions.
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that check digit transformation.
$filename = Language::getMessagesFileName( $code );
$this->output( "Loading language [$code] ... " );
unset( $digitTransformTable );
- require_once( $filename );
+ require_once $filename;
if ( !isset( $digitTransformTable ) ) {
$this->error( "\$digitTransformTable not found for lang: $code" );
continue;
* @todo Make this more useful, right now just dumps $wgContLang
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that dumps an entire language, using the keys from English.
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Generate first letter data files for Collation.php
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../../includes/normal/UtfNormalUtil.php' );
+require_once __DIR__ . '/../../includes/normal/UtfNormalUtil.php';
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Generates normalizer data files for Arabic and Malayalam.
*/
/** This is a command line script */
-require_once( __DIR__ . '/../Maintenance.php' );
-require_once( __DIR__ . '/languages.inc' );
+require_once __DIR__ . '/../Maintenance.php';
+require_once __DIR__ . '/languages.inc';
/**
* Maintenance script that tries to get the memory usage for each language file.
* @param $exif bool Treat the Exif messages?
*/
function __construct( $exif = true ) {
- require( __DIR__ . '/messageTypes.inc' );
+ require __DIR__ . '/messageTypes.inc';
$this->mIgnoredMessages = $wgIgnoredMessages;
if ( $exif ) {
$this->mOptionalMessages = array_merge( $wgOptionalMessages );
$this->mSpecialPageAliases[$code] = array();
$filename = Language::getMessagesFileName( $code );
if ( file_exists( $filename ) ) {
- require( $filename );
+ require $filename;
if ( isset( $messages ) ) {
$this->mRawMessages[$code] = $messages;
}
* @defgroup MaintenanceLanguage MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
+require_once __DIR__ . '/../commandLine.inc';
require_once 'languages.inc';
require_once 'writeMessagesArray.inc';
*/
function removeDupes( $oldMsgArray, $dupeMsgSource ) {
if ( file_exists( $dupeMsgSource ) ) {
- include( $dupeMsgSource );
+ include $dupeMsgSource;
if ( !isset( $dupeMessages ) ) {
echo "There are no duplicated messages in the source file provided.";
exit( 1 );
*/
$optionsWithArgs = array( 'output' );
-require_once( __DIR__ . '/../commandLine.inc' );
+require_once __DIR__ . '/../commandLine.inc';
require_once 'languages.inc';
-require_once( __DIR__ . '/StatOutputs.php' );
+require_once __DIR__ . '/StatOutputs.php';
if ( isset( $options['help'] ) ) {
$IP = __DIR__ . '/../..';
-require_once( "$IP/includes/Defines.php" );
-require_once( "$IP/languages/Language.php" );
+require_once "$IP/includes/Defines.php";
+require_once "$IP/languages/Language.php";
$files = array();
foreach ( $argv as $arg ) {
}
function getVars( $filename ) {
- require( $filename );
+ require $filename;
$vars = get_defined_vars();
unset( $vars['filename'] );
return $vars;
# Load messages
$dir = $prefix ? $prefix : __DIR__;
- require( $dir . '/messages.inc' );
+ require $dir . '/messages.inc';
self::$messageStructure = $wgMessageStructure;
self::$blockComments = $wgBlockComments;
- require( $dir . '/messageTypes.inc' );
+ require $dir . '/messageTypes.inc';
self::$ignoredMessages = $wgIgnoredMessages;
self::$optionalMessages = $wgOptionalMessages;
*/
/** */
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
$options = getopt( '', array( 'debug', 'help', 'cache:' ) );
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that makes several 'set', 'incr' and 'get' requests
# Start from scratch
define( 'MW_NO_EXTENSION_MESSAGES', 1 );
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
$maintClass = 'MergeMessageFileList';
$mmfl = false;
if ( empty( $mmfl['quiet'] ) ) {
fwrite( STDERR, "Loading data from $fileName\n" );
}
- if ( !include_once( $fileName ) ) {
+ if ( !( include_once $fileName ) ) {
fwrite( STDERR, "Unable to read $fileName\n" );
exit( 1 );
}
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that re-assigns users from an old group to a new one.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that minifies a file or set of files.
* e.g. immobile_namespace for namespaces which can't be moved
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to move a batch of pages.
#
define( 'MEDIAWIKI', true );
-require_once( "$mwPath/includes/GlobalFunctions.php" );
+require_once "$mwPath/includes/GlobalFunctions.php";
/**
* Read a line from the shell
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that checks for articles to fix after
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that picks a database that has pending jobs.
* based on nukePage by Rob Church
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that removes pages with only one revision from the
* @author Rob Church <robchur@gmail.com>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that erases a page record from the database.
* i.e.: GRANT REFERENCES (user_id) ON mwuser TO hubclient;
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
class AlterSharedConstraints extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that looks for 'orphan' revisions hooked to pages which
* @license GNU General Public License 2.0 or later
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to parse some wikitext.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that manually runs an SQL patch outside of the general updaters.
* @author Simetrical
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Mainteance script to populate the category table.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once dirname( __FILE__ ) . '/Maintenance.php';
/**
* Maintenance script to populate the fa_sha1 field.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to populate the img_sha1 field.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that makes the required database updates for populating the
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that makes the required database updates for
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that makes the required database updates for rev_parent_id
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that populates the rev_len field for old revisions
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that fills the rev_sha1 and ar_sha1 columns of revision
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/dumpIterator.php' );
+require_once __DIR__ . '/dumpIterator.php';
/**
* Maintenance script that takes page text out of an XML dump file and
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
$wgHooks['BeforeParserFetchTemplateAndtitle'][] = 'PPFuzzTester::templateHook';
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that protects or unprotects a page.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that prunes file cache for pages, objects, resources, etc.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that scans the deletion log and purges affected files
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that sends purge requests for listed pages to squid.
* @author Rob Church <robchur@gmail.com>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that purges old text records from the database.
* @ingroup Maintenance
*/
-require( __DIR__ . '/Maintenance.php' );
+require __DIR__ . '/Maintenance.php';
/**
* Maintenance script to remove old objects from the parser cache.
* @licence GNU General Public Licence 2.0 or later
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that reassigns edits from a user or IP address
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that builds file cache for content pages.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to update image metadata records.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to rebuild the localisation cache.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that rebuilds link tracking tables from scratch.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that purges all languages from the message cache.
* @todo Document
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that rebuilds recent changes from scratch.
* @todo document
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that rebuilds search index table from scratch.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to refresh file headers from metadata
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to refresh image metadata fields.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to refresh link tables.
* @author Rob Church <robchur@gmail.com>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that removes unused user accounts from the database.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that changes the prefix of database tables.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that takes page text out of an XML dump file
* @author Daniel Friesen <mediawiki@danielfriesen.name>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to reset the user_token for all users on the wiki.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to rollback all edits by a given user or IP provided
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to run a database query in batches and wait for slaves.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that runs pending jobs.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that shows statistics from the cache.
* @author Antoine Musso
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that reports the number of jobs currently waiting
* @license GNU General Public License 2.0 or later
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to show the cached statistics.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that sends SQL queries from the specified file to the database.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that performs some operations specific to SQLite database backend.
*/
if ( !defined( 'MEDIAWIKI' ) ) {
- require_once( __DIR__ . '/../commandLine.inc' );
+ require_once __DIR__ . '/../commandLine.inc';
$cs = new CheckStorage;
$fix = isset( $options['fix'] );
* @ingroup Maintenance ExternalStorage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that compress the text of a wiki.
* @ingroup Maintenance ExternalStorage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that gets the text of a revision,
* @ingroup Maintenance ExternalStorage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script to fix bug 20757.
define( 'REPORTING_INTERVAL', 1 );
if ( !defined( 'MEDIAWIKI' ) ) {
- require_once( __DIR__ . '/../commandLine.inc' );
- require_once( __DIR__ . '/../../includes/externalstore/ExternalStoreDB.php' );
+ require_once __DIR__ . '/../commandLine.inc';
+ require_once __DIR__ . '/../../includes/externalstore/ExternalStoreDB.php';
require_once 'resolveStubs.php';
$fname = 'moveToExternal';
* @ingroup Maintenance ExternalStorage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that shows some statistics on the blob_orphans table,
*/
$optionsWithArgs = RecompressTracked::getOptionsWithArgs();
-require( __DIR__ . '/../commandLine.inc' );
+require __DIR__ . '/../commandLine.inc';
if ( count( $args ) < 1 ) {
echo "Usage: php recompressTracked.php [options] <cluster> [... <cluster>...]
if ( !defined( 'MEDIAWIKI' ) ) {
$optionsWithArgs = array( 'm' );
- require_once( __DIR__ . '/../commandLine.inc' );
+ require_once __DIR__ . '/../commandLine.inc';
resolveStubs();
}
* @ingroup Maintenance ExternalStorage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
class StorageTypeStats extends Maintenance {
function execute() {
*/
$optionsWithArgs = array( 'start', 'limit', 'type' );
-require( __DIR__ . '/../commandLine.inc' );
+require __DIR__ . '/../commandLine.inc';
if ( !isset( $args[0] ) ) {
echo "Usage: php testCompression.php [--type=<type>] [--start=<start-date>] [--limit=<num-revs>] <page-title>\n";
* @see wfWaitForSlaves()
*/
-require( __DIR__ . '/../commandLine.inc' );
+require __DIR__ . '/../commandLine.inc';
if ( count( $args ) < 1 ) {
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that syncs one file backend to another based on
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
class Undelete extends Maintenance {
public function __construct() {
*/
if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.3.2' ) < 0 ) ) {
- require( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
+ require dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
wfPHPVersionError( 'cli' );
}
$wgUseMasterForMaintenance = true;
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to run database schema updates.
* @author Rob Church <robchur@gmail.com>
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to provide a better count of the number of articles
#$optionsWithArgs = array( 'begin', 'max-slave-lag' );
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that will find all rows in the categorylinks table
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to normalize double-byte latin UTF-8 characters.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that updates page_restrictions table from
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script for periodic off-peak updating of the search index.
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to update cached special pages.
}
// This is needed to initialise $wgQueryPages
- require_once( "$IP/includes/QueryPage.php" );
+ require_once "$IP/includes/QueryPage.php";
foreach ( $wgQueryPages as $page ) {
list( $class, $special ) = $page;
} else {
if ( !class_exists( $class ) ) {
$file = $specialObj->getFile();
- require_once( $file );
+ require_once $file;
}
$queryPage = new $class;
}
$options = array( 'list', 'nowarn', 'quiet', 'usage', 'dry' );
$optionsWithArgs = array( 'old', 'new' );
-require_once( __DIR__ . '/commandLine.inc' );
+require_once __DIR__ . '/commandLine.inc';
/**
* @ingroup Maintenance
* @see wfWaitForSlaves()
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to wait until slave lag goes under a certain value.
define( 'MEDIAWIKI_INSTALL', true );
chdir( dirname( __DIR__ ) );
-require( dirname( __DIR__ ) . '/includes/WebStart.php' );
+require dirname( __DIR__ ) . '/includes/WebStart.php';
wfInstallerMain();
* @file
*/
-require_once( __DIR__ . '/includes/WebStart.php' );
+require_once __DIR__ . '/includes/WebStart.php';
if ( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
// Makes testing tweaks about a billion times easier
ini_set( 'zlib.output_compression', 'off' );
$wgEnableProfileInfo = $wgProfileToDatabase = false;
-require ( __DIR__ . '/includes/WebStart.php' );
+require __DIR__ . '/includes/WebStart.php';
header( 'Content-Type: text/html; charset=utf-8' );
if ( !defined( 'MEDIAWIKI' ) ) {
$wgNoDBParam = true;
$optionsWithArgs = array( 'o' );
- require_once( __DIR__ .'/../maintenance/commandLine.inc' );
+ require_once __DIR__ .'/../maintenance/commandLine.inc';
$stderr = fopen( 'php://stderr', 'w' );
if ( !isset( $args[0] ) ) {
//----------------------------------------------------------------------------
function getVars( $_gv_filename ) {
- require( $_gv_filename );
+ require $_gv_filename;
$vars = get_defined_vars();
unset( $vars['_gv_filename'] );
define( 'SELENIUMTEST', true );
-require( __DIR__ . '/../maintenance/Maintenance.php' );
+require __DIR__ . '/../maintenance/Maintenance.php';
require_once 'PHPUnit/Runner/Version.php';
if ( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
include_once 'PHPUnit/Util/Log/JUnit.php';
-require_once( __DIR__ . "/selenium/SeleniumServerManager.php" );
+require_once __DIR__ . "/selenium/SeleniumServerManager.php";
class SeleniumTester extends Maintenance {
protected $selenium;
}
foreach ( $seleniumTestSuites as $testSuiteName => $testSuiteFile ) {
- require( $testSuiteFile );
+ require $testSuiteFile;
$suite = new $testSuiteName();
$suite->setName( $testSuiteName );
$suite->addTests();
!! end
+!! test
+Extra newlines: More paragraphs with indented comment
+!! input
+a
+
+ <!--boo-->
+
+b
+!!result
+<p>a
+</p><p><br />
+b
+</p>
+!!end
+
+!! test
+Extra newlines followed by heading
+!! input
+a
+
+
+
+=b=
+[[a]]
+
+
+=b=
+!! result
+<p>a
+</p><p><br />
+</p>
+<h1><span class="mw-headline" id="b">b</span><span class="mw-editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: b">edit</a>]</span></h1>
+<p><a href="/index.php?title=A&action=edit&redlink=1" class="new" title="A (page does not exist)">a</a>
+</p><p><br />
+</p>
+<h1><span class="mw-headline" id="b_2">b</span><span class="mw-editsection">[<a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: b">edit</a>]</span></h1>
+
+!! end
+
+!! test
+Extra newlines between heading and content are swallowed
+!! input
+=b=
+
+
+
+[[a]]
+!! result
+<h1><span class="mw-headline" id="b">b</span><span class="mw-editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: b">edit</a>]</span></h1>
+<p><a href="/index.php?title=A&action=edit&redlink=1" class="new" title="A (page does not exist)">a</a>
+</p>
+!! end
+
!! test
Parsing an URL
!! input
</p>
!! end
+# Parsoid-specific testing for images
+# http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images
+# Currently imperfect due to a flaw in the Parsoid testrunner
+# Work in progress
+
+!! test
+Parsoid-specific image handling - simple image
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg]]
+!! result
+<p>
+<span class="mw-default-size" typeof="mw:Image">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg" height="220" width="1941">
+</a>
+</span>
+</p>
+!! end
+
+!! test
+Parsoid-specific image handling - simple image without link
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|link=]]
+!! result
+<p>
+<span class="mw-default-size" typeof="mw:Image">
+<span>
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg" height="220" width="1941">
+</span>
+</span>
+</p>
+!! end
+
+!! test
+Parsoid-specific image handling - simple image with specific link
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|link=Main Page]]
+!! result
+<p>
+<span class="mw-default-size" typeof="mw:Image">
+<a href="Main_Page">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg" height="220" width="1941">
+</a>
+</span>
+</p>
+!! end
+
+!! test
+Parsoid-specific image handling - simple image with size and middle alignment
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|50px|middle]]
+!! result
+<p>
+<span class="mw-valign-middle" typeof="mw:Image">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50">
+</a>
+</span>
+</p>
+!! end
+
+!! test
+Parsoid-specific image handling - simple image with both sizes, a baseline alignment, and a caption
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|500x10px|baseline|caption]]
+!! result
+<p>
+<span class="mw-valign-baseline" typeof="mw:Image" data-mw="{"caption":"caption"}">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/89px-Foobar.jpg" height="10" width="89">
+</a>
+</span>
+</p>
+!! end
+
+!! test
+Parsoid-specific image handling - simple image with border and size spec
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|50px|border|caption]]
+!! result
+<p>
+<span class="mw-image-border" typeof="mw:Image" data-mw="{"caption":"caption"}">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50">
+</a>
+</span>
+</p>
+!! end
+
+!! test
+Parsoid-specific image handling - thumbnail with halign, valign, and caption
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|thumb|left|baseline|caption content]]
+!! result
+<figure class="mw-default-size mw-halign-left mw-valign-baseline" typeof="mw:Image/Thumb">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/180px-Foobar.jpg" height="21" width="180" />
+</a>
+<figcaption class="mw-figcaption">caption content</figcaption>
+</figure>
+!! end
+
+!! test
+Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|thumb|50x50px|right|middle|caption]]
+!! result
+<figure class="mw-halign-right mw-valign-middle" typeof="mw:Image/Thumb">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50" />
+</a>
+<figcaption class="mw-figcaption">caption</figcaption>
+</figure>
+!! end
+
+!! test
+Parsoid-specific image handling - framed image with specific size and caption
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|500x50px|frame|caption]]
+!! result
+<figure typeof="mw:Image/Frame">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
+</a>
+<figcaption class="mw-figcaption">caption</figcaption>
+</figure>
+!! end
+
+!! test
+Parsoid-specific image handling - framed image with specific size, halign, valign, and caption
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|500x50px|frame|left|baseline|caption]]
+!! result
+<figure class="mw-halign-left mw-valign-baseline" typeof="mw:Image/Frame">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
+</a>
+<figcaption class="mw-figcaption">caption</figcaption>
+</figure>
+!! end
+
+!! test
+Parsoid-specific image handling - frameless image with specific size, border, and caption
+!! options
+parsoid
+!! input
+[[Image:Foobar.jpg|frameless|500x50px|border|caption]]
+!! result
+<p>
+<span class="mw-image-border" typeof="mw:Image/Frameless" data-mw="{"caption":"caption"}">
+<a href="File:Foobar.jpg">
+<img resource="./File:Foobar.jpg" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/442px-Foobar.jpg" height="50" width="442" />
+</a>
+</p>
+!! end
+
+#!! test
+#Parsoid-specific image handling - simple image with a formatted caption
+#!! options
+#parsoid
+#!! input
+#[[Image:Foobar.jpg|<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>]]
+#!! result
+#<p>
+#<span typeof="mw:Image">
+#<a class="mw-default-size" href="Image:Foobar.jpg">
+#<img alt="Foobar.jpg" class="mw-default-size" src="http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg" height="220" width="1941">
+#</a>
+#<span>abc</span>
+#</span>
+#</p>
+
###
### Subpages
</p>
!!end
+
TODO:
more images
more tables
$otions = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled', 'run-parsoid' );
$optionsWithArgs = array( 'regex', 'filter', 'seed', 'setversion' );
-require_once( __DIR__ . '/../maintenance/commandLine.inc' );
-require_once( __DIR__ . '/TestsAutoLoader.php' );
+require_once __DIR__ . '/../maintenance/commandLine.inc';
+require_once __DIR__ . '/TestsAutoLoader.php';
if ( isset( $options['help'] ) ) {
echo <<<ENDS
You are running these tests directly from phpunit. You may not have all globals correctly set.
Running phpunit.php instead is recommended.
EOF;
- require_once( __DIR__ . "/phpunit.php" );
+ require_once __DIR__ . "/phpunit.php";
}
*/
// Start up MediaWiki in command-line mode
-require_once( __DIR__ . "/../../../../maintenance/Maintenance.php" );
-require( __DIR__ . "/RandomImageGenerator.php" );
+require_once __DIR__ . "/../../../../maintenance/Maintenance.php";
+require __DIR__ . "/RandomImageGenerator.php";
class GenerateRandomImages extends Maintenance {
}
$maintClass = 'GenerateRandomImages';
-require( RUN_MAINTENANCE_IF_MAIN );
+require RUN_MAINTENANCE_IF_MAIN;
// result array, but it seems kind of big to put directly in the test
// file.
$result = null;
- include( $xmpPath . $file[0] . '.result.php' );
+ include $xmpPath . $file[0] . '.result.php';
$data[] = array( $xmp, $result, '[' . $file[0] . '.xmp] ' . $file[1] );
}
<?php
-require_once( __DIR__ . '/NewParserTest.php' );
+require_once __DIR__ . '/NewParserTest.php';
/**
* The UnitTest must be either a class that inherits from MediaWikiTestCase
define( 'MW_PHPUNIT_TEST', true );
// Start up MediaWiki in command-line mode
-require_once( dirname( dirname( __DIR__ ) ) . "/maintenance/Maintenance.php" );
+require_once dirname( dirname( __DIR__ ) ) . "/maintenance/Maintenance.php";
class PHPUnitMaintClass extends Maintenance {
}
$maintClass = 'PHPUnitMaintClass';
-require( RUN_MAINTENANCE_IF_MAIN );
+require RUN_MAINTENANCE_IF_MAIN;
require_once 'PHPUnit/Runner/Version.php';
}
require_once 'PHPUnit/Autoload.php';
-require_once( "$IP/tests/TestsAutoLoader.php" );
+require_once "$IP/tests/TestsAutoLoader.php";
MediaWikiPHPUnitCommand::main();
<?php
-require_once( dirname( __DIR__ ) . '/includes/upload/UploadFromUrlTest.php' );
+require_once dirname( __DIR__ ) . '/includes/upload/UploadFromUrlTest.php';
class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
public $savedGlobals = array();
* </code>
*/
-require( __DIR__ . '/../../../maintenance/Maintenance.php' );
+require __DIR__ . '/../../../maintenance/Maintenance.php';
class GenerateJqueryMsgData extends Maintenance {
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 09 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 10 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 29 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
-require_once ( __DIR__ . '/MediaWikiInstallationConfig.php' );
-require_once ( __DIR__ . '/MediaWikiInstallationMessage.php' );
-require_once ( __DIR__ . '/MediaWikiInstallationVariables.php' );
+require_once __DIR__ . '/MediaWikiInstallationConfig.php';
+require_once __DIR__ . '/MediaWikiInstallationMessage.php';
+require_once __DIR__ . '/MediaWikiInstallationVariables.php';
class MediaWikiInstallationCommonFunction extends PHPUnit_Extensions_SeleniumTestCase {
function setUp() {
require_once 'PHPUnit/Framework/TestSuite.php';
-require_once ( __DIR__ . '/MediaWikiUserInterfaceTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiButtonsAvailabilityTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiHelpFieldHintTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiRightFrameworkLinksTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiRestartInstallationTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiErrorsConnectToDatabasePageTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiErrorsNamepageTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiMySQLDataBaseTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiMySQLiteDataBaseTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiUpgradeExistingDatabaseTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiDifferntDatabasePrefixTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiDifferentDatabaseAccountTestCase.php' );
-require_once ( __DIR__ . '/MediaWikiOnAlreadyInstalledTestCase.php' );
+require_once __DIR__ . '/MediaWikiUserInterfaceTestCase.php';
+require_once __DIR__ . '/MediaWikiButtonsAvailabilityTestCase.php';
+require_once __DIR__ . '/MediaWikiHelpFieldHintTestCase.php';
+require_once __DIR__ . '/MediaWikiRightFrameworkLinksTestCase.php';
+require_once __DIR__ . '/MediaWikiRestartInstallationTestCase.php';
+require_once __DIR__ . '/MediaWikiErrorsConnectToDatabasePageTestCase.php';
+require_once __DIR__ . '/MediaWikiErrorsNamepageTestCase.php';
+require_once __DIR__ . '/MediaWikiMySQLDataBaseTestCase.php';
+require_once __DIR__ . '/MediaWikiMySQLiteDataBaseTestCase.php';
+require_once __DIR__ . '/MediaWikiUpgradeExistingDatabaseTestCase.php';
+require_once __DIR__ . '/MediaWikiDifferntDatabasePrefixTestCase.php';
+require_once __DIR__ . '/MediaWikiDifferentDatabaseAccountTestCase.php';
+require_once __DIR__ . '/MediaWikiOnAlreadyInstalledTestCase.php';
$suite = new PHPUnit_Framework_TestSuite( 'ArrayTest' );
$result = new PHPUnit_Framework_TestResult;
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* http://www.gnu.org/copyleft/gpl.html
*/
-require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
+require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
/**
* Test Case ID : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* Sample test suite.
* Two ways to configure MW for these tests
* 1) If you are running multiple test suites, add the following in LocalSettings.php
- * require_once("tests/selenium/SimpleSeleniumConfig.php");
+ * require_once "tests/selenium/SimpleSeleniumConfig.php";
* $wgSeleniumTestConfigs['SimpleSeleniumTestSuite'] = 'SimpleSeleniumConfig::getSettings';
* OR
* 2) Add the following to your Localsettings.php
# Execute thumb.php, having set THUMB_HANDLER so that
# it knows to extract params from a thumbnail file URL.
-require( __DIR__ . '/thumb.php' );
+require __DIR__ . '/thumb.php';
<?php
// stub file for compatibility with older versions
-include_once('./index.php');
+include_once './index.php';