* (bug 38904) prop=revisions&rvstart=... no longer blows up when continuing.
* (bug 39032) ApiQuery generates help in constructor.
* (bug 11142) Improve file extension blacklist error reporting in API upload
+* (bug 39635) PostgreSQL LOCK IN SHARE MODE option is a syntax error
=== Languages updated in 1.20 ===
* Deprecated mw.user.anonymous in favour of mw.user.isAnon.
* Deprecated DatabaseBase functions newFromParams(), newFromType(), set(),
quote_ident(), and escapeLike() were removed.
+* Use of __DIR__ instead of dirname( __FILE__ ).
== Compatibility ==
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require ( 'core/includes/WebStart.php' );
} else {
- require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+ require ( __DIR__ . '/includes/WebStart.php' );
}
wfProfileIn( 'api.php' );
);
----
-$wgExtensionMessagesFiles['ExtensionNameMagic'] = dirname( __FILE__ ) . '/ExtensionName.i18n.magic.php';
+$wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
$wgHooks['MagicWordwgVariableIDs'][] = 'wfAddCustomMagicWordID';
$wgHooks['ParserGetVariableValueSwitch'][] = 'wfGetCustomMagicWordValue';
);
----
-$wgExtensionMessagesFiles['ExtensionNameMagic'] = dirname( __FILE__ ) . '/ExtensionName.i18n.magic.php';
+$wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php';
$wgHooks['ParserFirstCallInit'][] = 'wfRegisterCustomMagicWord';
function wfRegisterCustomMagicWord( &$parser ){
refers to the link source, NOT to the target! You should check the env
variable MW_INSTALL_PATH in case the extension is not in the default location.
-The following code snippet let you override the default path:
+The following code snippet lets you override the default path:
$IP = getenv( 'MW_INSTALL_PATH' );
if( $IP === false ) {
- $IP = dirname( __FILE__ ) . '/../..';
+ $IP = __DIR__ . '/../..';
}
require_once( "$IP/maintenance/Maintenance.php" ); // a MediaWiki core file
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require ( 'core/includes/WebStart.php' );
} else {
- require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+ require ( __DIR__ . '/includes/WebStart.php' );
}
wfProfileIn( 'img_auth.php' );
'UnlistedSpecialPage' => 'includes/SpecialPage.php',
'UploadSourceAdapter' => 'includes/Import.php',
'UppercaseCollation' => 'includes/Collation.php',
- 'Uri' => 'includes/Uri.php',
'User' => 'includes/User.php',
'UserArray' => 'includes/UserArray.php',
'UserArrayFromResult' => 'includes/UserArray.php',
'Language' => 'languages/Language.php',
'LanguageConverter' => 'languages/LanguageConverter.php',
'CLDRPluralRuleEvaluator' => 'languages/utils/CLDRPluralRuleEvaluator.php',
+ 'CLDRPluralRuleError' => 'languages/utils/CLDRPluralRuleEvaluator.php',
# maintenance
'ConvertLinks' => 'maintenance/convertLinks.php',
'IGNORE'
);
- $cond1 = $dbw->conditional( 'page_namespace=' . NS_CATEGORY, 1, 'NULL' );
- $cond2 = $dbw->conditional( 'page_namespace=' . NS_FILE, 1, 'NULL' );
+ $cond1 = $dbw->conditional( array( 'page_namespace' => NS_CATEGORY ), 1, 'NULL' );
+ $cond2 = $dbw->conditional( array( 'page_namespace' => NS_FILE ), 1, 'NULL' );
$result = $dbw->selectRow(
array( 'categorylinks', 'page' ),
array( 'pages' => 'COUNT(*)',
$files[] = __FILE__;
// We must also have a parent folder, and with the usual file structure, a grandparent
- $files[] = dirname( __FILE__ );
- $files[] = dirname( dirname( __FILE__ ) );
+ $files[] = __DIR__;
+ $files[] = dirname( __DIR__ );
// The config file is likely the most often edited file we know should be around
// so include its stat info into the state.
$exception = null;
/**
- * @var $update StorageUpdate
- * @var $trans StorageUpdate
+ * @var $update DataUpdate
+ * @var $trans DataUpdate
*/
try {
* 'scripts' => 'myExtension.js',
* 'styles' => 'myExtension.css',
* 'dependencies' => array( 'jquery.cookie', 'jquery.tabIndex' ),
- * 'localBasePath' => dirname( __FILE__ ),
+ * 'localBasePath' => __DIR__,
* 'remoteExtPath' => 'MyExtension',
* );
* @endcode
*
* @par Example:
* @code
- * $wgExtensionMessagesFiles['ConfirmEdit'] = dirname(__FILE__).'/ConfirmEdit.i18n.php';
+ * $wgExtensionMessagesFiles['ConfirmEdit'] = __DIR__.'/ConfirmEdit.i18n.php';
* @endcode
*/
$wgExtensionMessagesFiles = array();
/**
* Unicode and normalisation related
*/
-require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
+require_once __DIR__.'/normal/UtfNormalDefines.php';
/**@{
* Hook support constants
$cgi = '';
foreach ( $array1 as $key => $value ) {
- if ( $value !== false ) {
+ if ( !is_null($value) && $value !== false ) {
if ( $cgi != '' ) {
$cgi .= '&';
}
} else {
if ( is_object( $value ) ) {
$value = $value->__toString();
- } elseif( !is_null( $value ) ) {
- $cgi .= urlencode( $key ) . '=' . urlencode( $value );
- } else {
- $cgi .= urlencode( $key );
}
+ $cgi .= urlencode( $key ) . '=' . urlencode( $value );
}
}
}
continue;
}
if ( strpos( $bit, '=' ) === false ) {
- // Pieces like &qwerty become 'qwerty' => null
- $key = urldecode( $bit );
- $value = null;
+ // Pieces like &qwerty become 'qwerty' => '' (at least this is what php does)
+ $key = $bit;
+ $value = '';
} else {
list( $key, $value ) = explode( '=', $bit );
- $key = urldecode( $key );
- $value = urldecode( $value );
}
-
+ $key = urldecode( $key );
+ $value = urldecode( $value );
if ( strpos( $key, '[' ) !== false ) {
$keys = array_reverse( explode( '[', $key ) );
$key = array_pop( $keys );
* Append a query string to an existing URL, which may or may not already
* have query string parameters already. If so, they will be combined.
*
- * @deprecated in 1.20. Use Uri class.
* @param $url String
* @param $query Mixed: string or associative array
* @return string
*/
function wfAppendQuery( $url, $query ) {
- $obj = new Uri( $url );
- $obj->extendQuery( $query );
- return $obj->toString();
+ if ( is_array( $query ) ) {
+ $query = wfArrayToCgi( $query );
+ }
+ if( $query != '' ) {
+ if( false === strpos( $url, '?' ) ) {
+ $url .= '?';
+ } else {
+ $url .= '&';
+ }
+ $url .= $query;
+ }
+ return $url;
}
/**
* @todo Need to integrate this into wfExpandUrl (bug 32168)
*
* @since 1.19
- * @deprecated
* @param $urlParts Array URL parts, as output from wfParseUrl
* @return string URL assembled from its component parts
*/
function wfAssembleUrl( $urlParts ) {
- $obj = new Uri( $urlParts );
- return $obj->toString();
+ $result = '';
+
+ if ( isset( $urlParts['delimiter'] ) ) {
+ if ( isset( $urlParts['scheme'] ) ) {
+ $result .= $urlParts['scheme'];
+ }
+
+ $result .= $urlParts['delimiter'];
+ }
+
+ if ( isset( $urlParts['host'] ) ) {
+ if ( isset( $urlParts['user'] ) ) {
+ $result .= $urlParts['user'];
+ if ( isset( $urlParts['pass'] ) ) {
+ $result .= ':' . $urlParts['pass'];
+ }
+ $result .= '@';
+ }
+
+ $result .= $urlParts['host'];
+
+ if ( isset( $urlParts['port'] ) ) {
+ $result .= ':' . $urlParts['port'];
+ }
+ }
+
+ if ( isset( $urlParts['path'] ) ) {
+ $result .= $urlParts['path'];
+ }
+
+ if ( isset( $urlParts['query'] ) ) {
+ $result .= '?' . $urlParts['query'];
+ }
+
+ if ( isset( $urlParts['fragment'] ) ) {
+ $result .= '#' . $urlParts['fragment'];
+ }
+
+ return $result;
}
/**
* 2) Handles protocols that don't use :// (e.g., mailto: and news: , as well as protocol-relative URLs) correctly
* 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))
*
- * @deprecated
* @param $url String: a URL to parse
* @return Array: bits of the URL in an associative array, per PHP docs
*/
function wfParseUrl( $url ) {
- $obj = new Uri( $url );
- return $obj->getComponents();
+ global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php
+
+ // Protocol-relative URLs are handled really badly by parse_url(). It's so bad that the easiest
+ // way to handle them is to just prepend 'http:' and strip the protocol out later
+ $wasRelative = substr( $url, 0, 2 ) == '//';
+ if ( $wasRelative ) {
+ $url = "http:$url";
+ }
+ wfSuppressWarnings();
+ $bits = parse_url( $url );
+ wfRestoreWarnings();
+ // parse_url() returns an array without scheme for some invalid URLs, e.g.
+ // parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
+ if ( !$bits || !isset( $bits['scheme'] ) ) {
+ return false;
+ }
+
+ // most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
+ if ( in_array( $bits['scheme'] . '://', $wgUrlProtocols ) ) {
+ $bits['delimiter'] = '://';
+ } elseif ( in_array( $bits['scheme'] . ':', $wgUrlProtocols ) ) {
+ $bits['delimiter'] = ':';
+ // parse_url detects for news: and mailto: the host part of an url as path
+ // We have to correct this wrong detection
+ if ( isset( $bits['path'] ) ) {
+ $bits['host'] = $bits['path'];
+ $bits['path'] = '';
+ }
+ } else {
+ return false;
+ }
+
+ /* Provide an empty host for eg. file:/// urls (see bug 28627) */
+ if ( !isset( $bits['host'] ) ) {
+ $bits['host'] = '';
+
+ /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
+ if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
+ $bits['path'] = '/' . $bits['path'];
+ }
+ }
+
+ // If the URL was protocol-relative, fix scheme and delimiter
+ if ( $wasRelative ) {
+ $bits['scheme'] = '';
+ $bits['delimiter'] = '//';
+ }
+ return $bits;
}
/**
* @param $logonly Bool: set true to avoid appearing in HTML when $wgDebugComments is set
*/
function wfDebug( $text, $logonly = false ) {
- global $wgOut, $wgDebugLogFile, $wgDebugComments, $wgProfileOnly, $wgDebugRawPage;
- global $wgDebugLogPrefix, $wgShowDebug;
-
- static $cache = array(); // Cache of unoutputted messages
+ global $wgDebugLogFile, $wgProfileOnly, $wgDebugRawPage, $wgDebugLogPrefix;
if ( !$wgDebugRawPage && wfIsDebugRawPage() ) {
return;
$text = preg_replace( '/[^\n]/', $timer . '\0', $text, 1 );
}
- if ( ( $wgDebugComments || $wgShowDebug ) && !$logonly ) {
- $cache[] = $text;
-
- if ( isset( $wgOut ) && is_object( $wgOut ) ) {
- // add the message and any cached messages to the output
- array_map( array( $wgOut, 'debug' ), $cache );
- $cache = array();
- }
+ if ( !$logonly ) {
+ MWDebug::debugMsg( $text );
}
+
if ( wfRunHooks( 'Debug', array( $text, null /* no log group */ ) ) ) {
if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
# Strip unprintables; they can switch terminal modes when binary data
wfErrorLog( $text, $wgDebugLogFile );
}
}
-
- MWDebug::debugMsg( $text );
}
/**
* @return null
*/
function wfDeprecated( $function, $version = false, $component = false, $callerOffset = 2 ) {
- static $functionsWarned = array();
-
- MWDebug::deprecated( $function, $version, $component );
-
- if ( !isset( $functionsWarned[$function] ) ) {
- $functionsWarned[$function] = true;
-
- if ( $version ) {
- global $wgDeprecationReleaseLimit;
-
- if ( $wgDeprecationReleaseLimit && $component === false ) {
- # Strip -* off the end of $version so that branches can use the
- # format #.##-branchname to avoid issues if the branch is merged into
- # a version of MediaWiki later than what it was branched from
- $comparableVersion = preg_replace( '/-.*$/', '', $version );
-
- # If the comparableVersion is larger than our release limit then
- # skip the warning message for the deprecation
- if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
- return;
- }
- }
-
- $component = $component === false ? 'MediaWiki' : $component;
- wfWarn( "Use of $function was deprecated in $component $version.", $callerOffset );
- } else {
- wfWarn( "Use of $function is deprecated.", $callerOffset );
- }
- }
+ MWDebug::deprecated( $function, $version, $component, $callerOffset + 1 );
}
/**
* is true
*/
function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
- global $wgDevelopmentWarnings;
-
- MWDebug::warning( $msg, $callerOffset + 2 );
-
- $callers = wfDebugBacktrace();
- if ( isset( $callers[$callerOffset + 1] ) ) {
- $callerfunc = $callers[$callerOffset + 1];
- $callerfile = $callers[$callerOffset];
- if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
- $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
- } else {
- $file = '(internal function)';
- }
- $func = '';
- if ( isset( $callerfunc['class'] ) ) {
- $func .= $callerfunc['class'] . '::';
- }
- if ( isset( $callerfunc['function'] ) ) {
- $func .= $callerfunc['function'];
- }
- $msg .= " [Called from $func in $file]";
- }
-
- if ( $wgDevelopmentWarnings ) {
- trigger_error( $msg, $level );
- } else {
- wfDebug( "$msg\n" );
- }
+ MWDebug::warning( $msg, $callerOffset + 1, $level );
}
/**
}
} else {
if ( !$suppressCount ) {
- // E_DEPRECATED is undefined in PHP 5.2
- if( !defined( 'E_DEPRECATED' ) ) {
- define( 'E_DEPRECATED', 8192 );
- }
- $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED ) );
+ $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED ) );
}
++$suppressCount;
}
* @return String: HTML output
*/
public static function formatHiddenCategories( $hiddencats ) {
- global $wgLang;
wfProfileIn( __METHOD__ );
$outText = '';
/**
* Constructor.
+ * @since 1.17
* @param $key: message key, or array of message keys to try and use the first non-empty message for
* @param $params Array message parameters
* @return Message: $this
* Factory function that is just wrapper for the real constructor. It is
* intented to be used instead of the real constructor, because it allows
* chaining method calls, while new objects don't.
+ * @since 1.17
* @param $key String: message key
* @param Varargs: parameters as Strings
* @return Message: $this
* Factory function accepting multiple message keys and returning a message instance
* for the first message which is non-empty. If all messages are empty then an
* instance of the first message key is returned.
+ * @since 1.18
* @param Varargs: message keys (or first arg as an array of all the message keys)
* @return Message: $this
*/
/**
* Adds parameters to the parameter list of this message.
+ * @since 1.17
* @param Varargs: parameters as Strings, or a single argument that is an array of Strings
* @return Message: $this
*/
* In other words the parsing process cannot access the contents
* of this type of parameter, and you need to make sure it is
* sanitized beforehand. The parser will see "$n", instead.
+ * @since 1.17
* @param Varargs: raw parameters as Strings (or single argument that is an array of raw parameters)
* @return Message: $this
*/
/**
* Add parameters that are numeric and will be passed through
* Language::formatNum before substitution
+ * @since 1.18
* @param Varargs: numeric parameters (or single argument that is array of numeric parameters)
* @return Message: $this
*/
/**
* Set the language and the title from a context object
- *
+ * @since 1.19
* @param $context IContextSource
* @return Message: $this
*/
/**
* Enable or disable database use.
+ * @since 1.17
* @param $value Boolean
* @return Message: $this
*/
/**
* Set the Title object to use as context when transforming the message
- *
+ * @since 1.18
* @param $title Title object
* @return Message: $this
*/
/**
* Returns the message parsed from wikitext to HTML.
+ * @since 1.17
* @return String: HTML
*/
public function toString() {
* Magic method implementation of the above (for PHP >= 5.2.0), so we can do, eg:
* $foo = Message::get($key);
* $string = "<abbr>$foo</abbr>";
+ * @since 1.18
* @return String
*/
public function __toString() {
/**
* Fully parse the text from wikitext to HTML
+ * @since 1.17
* @return String parsed HTML
*/
public function parse() {
/**
* Returns the message text. {{-transformation is done.
+ * @since 1.17
* @return String: Unescaped message text.
*/
public function text() {
/**
* Returns the message text as-is, only parameters are subsituted.
+ * @since 1.17
* @return String: Unescaped untransformed message text.
*/
public function plain() {
/**
* Returns the parsed message text which is always surrounded by a block element.
+ * @since 1.17
* @return String: HTML
*/
public function parseAsBlock() {
/**
* Returns the message text. {{-transformation is done and the result
* is escaped excluding any raw parameters.
+ * @since 1.17
* @return String: Escaped message text.
*/
public function escaped() {
/**
* Check whether a message key has been defined currently.
+ * @since 1.17
* @return Bool: true if it is and false if not.
*/
public function exists() {
/**
* Check whether a message does not exist, or is an empty string
+ * @since 1.18
* @return Bool: true if is is and false if not
* @todo FIXME: Merge with isDisabled()?
*/
/**
* Check whether a message does not exist, is an empty string, or is "-"
+ * @since 1.18
* @return Bool: true if is is and false if not
*/
public function isDisabled() {
}
/**
+ * @since 1.17
* @param $value
* @return array
*/
}
/**
+ * @since 1.18
* @param $value
* @return array
*/
/**
* Substitutes any paramaters into the message text.
+ * @since 1.17
* @param $message String: the message text
* @param $type String: either before or after
* @return String
/**
* Extracts the parameter type and preprocessed the value if needed.
+ * @since 1.18
* @param $param String|Array: Parameter as defined in this class.
* @return Tuple(type, value)
* @throws MWException
/**
* Wrapper for what ever method we use to parse wikitext.
+ * @since 1.17
* @param $string String: Wikitext message contents
* @return string Wikitext parsed into HTML
*/
/**
* Wrapper for what ever method we use to {{-transform wikitext.
+ * @since 1.17
* @param $string String: Wikitext message contents
* @return string Wikitext with {{-constructs replaced with their values.
*/
/**
* Wrapper for what ever method we use to get message contents
- *
+ * @since 1.17
* @return string
*/
protected function fetchMessage() {
/**
* Holds the debug lines that will be output as comments in page source if
* $wgDebugComments is enabled. See also $wgShowDebug.
- * TODO: make a getter method for this
+ * @deprecated since 1.20; use MWDebug class instead.
*/
- public $mDebugtext = ''; // TODO: we might want to replace it by wfDebug() wfDebugLog()
+ public $mDebugtext = '';
/// Should be private. Stores contents of "<title>" tag
var $mHTMLtitle = '';
return $this->mBodytext;
}
- /**
- * Add $text to the debug output
- *
- * @param $text String: debug text
- */
- public function debug( $text ) {
- $this->mDebugtext .= $text;
- }
-
/**
* Get/set the ParserOptions object to use for wikitext parsing
*
* based on $pageTitle
*/
public function prepareErrorPage( $pageTitle, $htmlTitle = false ) {
- if ( $this->getTitle() ) {
- $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
- }
-
$this->setPageTitle( $pageTitle );
if ( $htmlTitle !== false ) {
$this->setHTMLTitle( $htmlTitle );
if ( !empty( $allCats['normal'] ) ) {
$t = $embed . implode( "{$pop}{$embed}" , $allCats['normal'] ) . $pop;
- $msg = $this->msg( 'pagecategories', count( $allCats['normal'] ) )->escaped();
+ $msg = $this->msg( 'pagecategories' )->numParams( count( $allCats['normal'] ) )->escaped();
$linkPage = wfMessage( 'pagecategorieslink' )->inContentLanguage()->text();
$s .= '<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
Linker::link( Title::newFromText( $linkPage ), $msg )
}
$s .= "<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
- $this->msg( 'hidden-categories', count( $allCats['hidden'] ) )->escaped() .
+ $this->msg( 'hidden-categories' )->numParams( count( $allCats['hidden'] ) )->escaped() .
$colon . '<ul>' . $embed . implode( "{$pop}{$embed}" , $allCats['hidden'] ) . $pop . '</ul>' .
'</div>';
}
* @return String HTML containing debug data, if enabled (otherwise empty).
*/
protected function generateDebugHTML() {
- global $wgShowDebug;
-
- $html = MWDebug::getDebugHTML( $this->getContext() );
-
- if ( $wgShowDebug ) {
- $listInternals = $this->formatDebugHTML( $this->getOutput()->mDebugtext );
- $html .= "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">" .
- $listInternals . "</ul>\n";
- }
-
- return $html;
- }
-
- /**
- * @param $debugText string
- * @return string
- */
- private function formatDebugHTML( $debugText ) {
- global $wgDebugTimestamps;
-
- $lines = explode( "\n", $debugText );
- $curIdent = 0;
- $ret = '<li>';
-
- foreach ( $lines as $line ) {
- $pre = '';
- if ( $wgDebugTimestamps ) {
- $matches = array();
- if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
- $pre = $matches[1];
- $line = substr( $line, strlen( $pre ) );
- }
- }
- $display = ltrim( $line );
- $ident = strlen( $line ) - strlen( $display );
- $diff = $ident - $curIdent;
-
- $display = $pre . $display;
- if ( $display == '' ) {
- $display = "\xc2\xa0";
- }
-
- if ( !$ident && $diff < 0 && substr( $display, 0, 9 ) != 'Entering ' && substr( $display, 0, 8 ) != 'Exiting ' ) {
- $ident = $curIdent;
- $diff = 0;
- $display = '<span style="background:yellow;">' . htmlspecialchars( $display ) . '</span>';
- } else {
- $display = htmlspecialchars( $display );
- }
-
- if ( $diff < 0 ) {
- $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
- } elseif ( $diff == 0 ) {
- $ret .= "</li><li>\n";
- } else {
- $ret .= str_repeat( "<ul><li>\n", $diff );
- }
- $ret .= "<tt>$display</tt>\n";
-
- $curIdent = $ident;
- }
-
- $ret .= str_repeat( '</li></ul>', $curIdent ) . '</li>';
-
- return $ret;
+ return MWDebug::getHTMLDebugLog();
}
/**
global $wgDisableCounters, $wgSitename, $wgLogo, $wgHideInterlanguageLinks;
global $wgMaxCredits, $wgShowCreditsIfMax;
global $wgPageShowWatchingUsers;
- global $wgDebugComments;
global $wgArticlePath, $wgScriptPath, $wgServer;
wfProfileIn( __METHOD__ );
}
}
- if ( $wgDebugComments ) {
- $tpl->setRef( 'debug', $out->mDebugtext );
- } else {
- $tpl->set( 'debug', '' );
- }
-
$tpl->set( 'sitenotice', $this->getSiteNotice() );
$tpl->set( 'bottomscripts', $this->bottomScripts() );
$tpl->set( 'printfooter', $this->printSource() );
$tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
}
+ $tpl->set( 'debug', '' );
$tpl->set( 'debughtml', $this->generateDebugHTML() );
$tpl->set( 'reporttime', wfReportTime() );
function printTrail() { ?>
<?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
<?php $this->html( 'reporttime' ) ?>
-<?php if ( $this->data['debug'] ): ?>
-<!-- Debug output:
-<?php $this->text( 'debug' ); ?>
-
--->
-<?php endif;
+<?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() );
}
}
-
$this->mFunction = $function;
}
if ( $file === 'default' ) {
- $this->mFile = dirname( __FILE__ ) . "/specials/Special$name.php";
+ $this->mFile = __DIR__ . "/specials/Special$name.php";
} else {
$this->mFile = $file;
}
+++ /dev/null
-<?php
-/**
- * Class for simple URI parsing and manipulation.
- * Intended to simplify things that were using wfParseUrl and
- * had to do manual concatenation for various needs.
- * Built to match our JS mw.Uri in naming patterns.
- * @file
- * @author Daniel Friesen
- * @since 1.20
- */
-
-class Uri {
-
- /**
- * The parsed components of the URI
- */
- protected $components;
-
- protected static $validComponents = array( 'scheme', 'delimiter', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment' );
- protected static $componentAliases = array( 'protocol' => 'scheme', 'password' => 'pass' );
-
- /**
- * parse_url() work-alike, but non-broken. Differences:
- *
- * 1) Does not raise warnings on bad URLs (just returns false)
- * 2) Handles protocols that don't use :// (e.g., mailto: and news: , as well as protocol-relative URLs) correctly
- * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))
- *
- * @param $url String: a URL to parse
- * @return Array: bits of the URL in an associative array, per PHP docs
- */
- protected static function parseUri( $url ) {
- global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php
-
- // Protocol-relative URLs are handled really badly by parse_url(). It's so bad that the easiest
- // way to handle them is to just prepend 'http:' and strip the protocol out later
- $wasRelative = substr( $url, 0, 2 ) == '//';
- if ( $wasRelative ) {
- $url = "http:$url";
- }
- wfSuppressWarnings();
- $bits = parse_url( $url );
- wfRestoreWarnings();
- // parse_url() returns an array without scheme for some invalid URLs, e.g.
- // parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
- if ( !$bits ||
- !isset( $bits['scheme'] ) && strpos( $url, "://" ) !== false ) {
- wfDebug( __METHOD__ . ": Invalid URL: $url" );
- return false;
- } else {
- $scheme = isset( $bits['scheme'] ) ? $bits['scheme'] : null;
- }
-
- // most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
- if ( in_array( $scheme . '://', $wgUrlProtocols ) ) {
- $bits['delimiter'] = '://';
- } elseif ( !is_null( $scheme ) && !in_array( $scheme . ':', $wgUrlProtocols ) ) {
- wfDebug( __METHOD__ . ": Invalid scheme in URL: $scheme" );
- return false;
- } elseif( !is_null( $scheme ) ) {
- if( !in_array( $scheme . ':', $wgUrlProtocols ) ) {
- // For URLs that don't have a scheme, but do have a user:password, parse_url
- // detects the user as the scheme.
- unset( $bits['scheme'] );
- $bits['user'] = $scheme;
- } else {
- $bits['delimiter'] = ':';
- // parse_url detects for news: and mailto: the host part of an url as path
- // We have to correct this wrong detection
- if ( isset( $bits['path'] ) ) {
- $bits['host'] = $bits['path'];
- $bits['path'] = '';
- }
- }
- }
-
- /* Provide an empty host for eg. file:/// urls (see bug 28627) */
- if ( !isset( $bits['host'] ) && $scheme == "file" ) {
- $bits['host'] = '';
-
- /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
- if ( isset( $bits['path'] ) && substr( $bits['path'], 0, 1 ) !== '/' ) {
- $bits['path'] = '/' . $bits['path'];
- }
- }
-
- // If the URL was protocol-relative, fix scheme and delimiter
- if ( $wasRelative ) {
- $bits['scheme'] = '';
- $bits['delimiter'] = '//';
- }
- return $bits;
- }
-
- /**
- *
- * @param $uri mixed URI string or array
- */
- public function __construct( $uri ) {
- $this->components = array();
- $this->setUri( $uri );
- }
-
- /**
- * Set the Uri to the value of some other URI.
- *
- * @param $uri mixed URI string or array
- */
- public function setUri( $uri ) {
- if ( is_string( $uri ) ) {
- $parsed = self::parseUri( $uri );
- if( $parsed === false ) {
- return false;
- }
- $this->setComponents( $parsed );
- } elseif ( is_array( $uri ) ) {
- $this->setComponents( $uri );
- } elseif ( $uri instanceof Uri ) {
- $this->setComponents( $uri->getComponents() );
- } else {
- throw new MWException( __METHOD__ . ": $uri is not of a valid type." );
- }
- }
-
- /**
- * Set the components of this array.
- * Will output warnings when invalid components or aliases are found.
- *
- * @param $components Array The components to set on this Uri.
- */
- public function setComponents( array $components ) {
- foreach ( $components as $name => $value ) {
- if ( isset( self::$componentAliases[$name] ) ) {
- $canonical = self::$componentAliases[$name];
- wfDebug( __METHOD__ . ": Converting alias $name to canonical $canonical." );
- $components[$canonical] = $value;
- unset( $components[$name] );
- } elseif ( !in_array( $name, self::$validComponents ) ) {
- throw new MWException( __METHOD__ . ": $name is not a valid component." );
- }
- }
-
- $this->components = $components;
- }
-
- /**
- * Return the components for this Uri
- * @return Array
- */
- public function getComponents() {
- return $this->components;
- }
-
- /**
- * Return the value of a specific component
- *
- * @param $name string The name of the component to return
- * @param string|null
- */
- public function getComponent( $name ) {
- if ( isset( self::$componentAliases[$name] ) ) {
- // Component is an alias. Get the actual name.
- $alias = $name;
- $name = self::$componentAliases[$name];
- wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
- }
-
- if( !in_array( $name, self::$validComponents ) ) {
- // Component is invalid
- throw new MWException( __METHOD__ . ": $name is not a valid component." );
- } elseif( !empty( $this->components[$name] ) ) {
- // Component is valid and has a value.
- return $this->components[$name];
- } else {
- // Component is empty
- return null;
- }
- }
-
- /**
- * Set a component for this Uri
- * @param $name string The name of the component to set
- * @param $value string|null The value to set
- */
- public function setComponent( $name, $value ) {
- if ( isset( self::$componentAliases[$name] ) ) {
- $alias = $name;
- $name = self::$componentAliases[$name];
- wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
- } elseif ( !in_array( $name, self::$validComponents ) ) {
- throw new MWException( __METHOD__ . ": $name is not a valid component." );
- }
- $this->components[$name] = $value;
- }
-
- public function getProtocol() { return $this->getComponent( 'scheme' ); }
- public function getUser() { return $this->getComponent( 'user' ); }
- public function getPassword() { return $this->getComponent( 'pass' ); }
- public function getHost() { return $this->getComponent( 'host' ); }
- public function getPort() { return $this->getComponent( 'port' ); }
- public function getPath() { return $this->getComponent( 'path' ); }
- public function getQueryString() { return $this->getComponent( 'query' ); }
- public function getFragment() { return $this->getComponent( 'fragment' ); }
-
- public function setProtocol( $scheme ) { $this->setComponent( 'scheme', $scheme ); }
- public function setUser( $user ) { $this->setComponent( 'user', $user ); }
- public function setPassword( $pass ) { $this->setComponent( 'pass', $pass ); }
- public function setHost( $host ) { $this->setComponent( 'host', $host ); }
- public function setPort( $port ) { $this->setComponent( 'port', $port ); }
- public function setPath( $path ) { $this->setComponent( 'path', $path ); }
- public function setFragment( $fragment ) { $this->setComponent( 'fragment', $fragment ); }
-
- /**
- * Gets the protocol-authority delimiter of a URI (:// or //).
- * @return string|null
- */
- public function getDelimiter() {
- $delimiter = $this->getComponent( 'delimiter' );
- if ( $delimiter ) {
- // A specific delimiter is set, so return it.
- return $delimiter;
- }
- if ( $this->getAuthority() && $this->getProtocol() ) {
- // If the URI has a protocol and a body (i.e., some sort of host, etc.)
- // the default delimiter is "://", e.g., "http://test.com".
- return '://';
- }
- return null;
- }
-
- /**
- * Gets query portion of a URI in array format.
- * @return string
- */
- public function getQuery() {
- return wfCgiToArray( $this->getQueryString() );
- }
-
- /**
- * Gets query portion of a URI.
- * @param string|array $query
- */
- public function setQuery( $query ) {
- if ( is_array( $query ) ) {
- $query = wfArrayToCGI( $query );
- }
- $this->setComponent( 'query', $query );
- }
-
- /**
- * Extend the query -- supply query parameters to override or add to ours
- * @param Array|string $parameters query parameters to override or add
- * @return Uri this URI object
- */
- public function extendQuery( $parameters ) {
- if ( !is_array( $parameters ) ) {
- $parameters = wfCgiToArray( $parameters );
- }
-
- $query = $this->getQuery();
- foreach( $parameters as $key => $value ) {
- $query[$key] = $value;
- }
-
- $this->setQuery( $query );
- return $this;
- }
-
- /**
- * Returns user and password portion of a URI.
- * @return string
- */
- public function getUserInfo() {
- $user = $this->getComponent( 'user' );
- $pass = $this->getComponent( 'pass' );
- return $pass ? "$user:$pass" : $user;
- }
-
- /**
- * Gets host and port portion of a URI.
- * @return string
- */
- public function getHostPort() {
- $host = $this->getComponent( 'host' );
- $port = $this->getComponent( 'port' );
- return $port ? "$host:$port" : $host;
- }
-
- /**
- * Returns the userInfo and host and port portion of the URI.
- * In most real-world URLs, this is simply the hostname, but it is more general.
- * @return string
- */
- public function getAuthority() {
- $userinfo = $this->getUserInfo();
- $hostinfo = $this->getHostPort();
- return $userinfo ? "$userinfo@$hostinfo" : $hostinfo;
- }
-
- /**
- * Returns everything after the authority section of the URI
- * @return String
- */
- public function getRelativePath() {
- $path = $this->getComponent( 'path' );
- $query = $this->getComponent( 'query' );
- $fragment = $this->getComponent( 'fragment' );
-
- $retval = $path;
- if( $query ) {
- $retval .= "?$query";
- }
- if( $fragment ) {
- $retval .= "#$fragment";
- }
- return $retval;
- }
-
- /**
- * Gets the entire URI string. May not be precisely the same as input due to order of query arguments.
- * @return String the URI string
- */
- public function toString() {
- return $this->getComponent( 'scheme' ) . $this->getDelimiter() . $this->getAuthority() . $this->getRelativePath();
- }
-
- /**
- * Gets the entire URI string. May not be precisely the same as input due to order of query arguments.
- * @return String the URI string
- */
- public function __toString() {
- return $this->toString();
- }
-
-}
# Full path to working directory.
# Makes it possible to for example to have effective exclude path in apc.
# Also doesn't break installations using symlinked includes, like
-# dirname( __FILE__ ) would do.
+# __DIR__ would do.
$IP = getenv( 'MW_INSTALL_PATH' );
if ( $IP === false ) {
$IP = realpath( '.' );
* Returns an SQL expression for a simple conditional. This doesn't need
* to be overridden unless CASE isn't supported in your DBMS.
*
- * @param $cond String: SQL expression which will result in a boolean value
+ * @param $cond string|array SQL expression which will result in a boolean value
* @param $trueVal String: SQL expression to return if true
* @param $falseVal String: SQL expression to return if false
* @return String: SQL fragment
*/
public function conditional( $cond, $trueVal, $falseVal ) {
+ if ( is_array( $cond ) ) {
+ $cond = $this->makeList( $cond, LIST_AND );
+ }
return " (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) ";
}
if ( isset( $noKeyOptions['FOR UPDATE'] ) ) {
$postLimitTail .= ' FOR UPDATE';
}
- if ( isset( $noKeyOptions['LOCK IN SHARE MODE'] ) ) {
- $postLimitTail .= ' LOCK IN SHARE MODE';
- }
if ( isset( $noKeyOptions['DISTINCT'] ) || isset( $noKeyOptions['DISTINCTROW'] ) ) {
$startOpts .= 'DISTINCT';
}
* Adds a warning entry to the log
*
* @since 1.19
- * @param $msg
- * @param int $callerOffset
+ * @param $msg string
+ * @param $callerOffset int
* @return mixed
*/
- public static function warning( $msg, $callerOffset = 1 ) {
- if ( !self::$enabled ) {
- return;
- }
+ public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
+ $callerDescription = self::getCallerDescription( $callerOffset );
- // Check to see if there was already a deprecation notice, so not to
- // get a duplicate warning
- $logCount = count( self::$log );
- $caller = wfGetCaller( $callerOffset + 1 );
- if ( $logCount ) {
- $lastLog = self::$log[ $logCount - 1 ];
- if ( $lastLog['type'] == 'deprecated' && $lastLog['caller'] == $caller ) {
- return;
- }
- }
+ self::sendWarning( $msg, $callerDescription, $level );
- self::$log[] = array(
- 'msg' => htmlspecialchars( $msg ),
- 'type' => 'warn',
- 'caller' => $caller,
- );
+ if ( self::$enabled ) {
+ self::$log[] = array(
+ 'msg' => htmlspecialchars( $msg ),
+ 'type' => 'warn',
+ 'caller' => $callerDescription['func'],
+ );
+ }
}
/**
- * Adds a depreciation entry to the log, along with a backtrace
+ * Show a warning that $function is deprecated.
+ * This will send it to the following locations:
+ * - Debug toolbar, with one item per function and caller, if $wgDebugToolbar
+ * is set to true.
+ * - PHP's error log, with level E_USER_DEPRECATED, if $wgDevelopmentWarnings
+ * is set to true.
+ * - MediaWiki's debug log, if $wgDevelopmentWarnings is set to false.
*
* @since 1.19
- * @param $function
- * @param $version
- * @param $component
+ * @param $function string: Function that is deprecated.
+ * @param $version string|bool: Version in which the function was deprecated.
+ * @param $component string|bool: Component to which the function belongs.
+ * If false, it is assumbed the function is in MediaWiki core.
+ * @param $callerOffset integer: How far up the callstack is the original
+ * caller. 2 = function that called the function that called
+ * MWDebug::deprecated() (Added in 1.20).
* @return mixed
*/
- public static function deprecated( $function, $version, $component ) {
- if ( !self::$enabled ) {
- return;
- }
+ public static function deprecated( $function, $version = false, $component = false, $callerOffset = 2 ) {
+ $callerDescription = self::getCallerDescription( $callerOffset );
+ $callerFunc = $callerDescription['func'];
- // Chain: This function -> wfDeprecated -> deprecatedFunction -> caller
- $caller = wfGetCaller( 4 );
+ $sendToLog = true;
// Check to see if there already was a warning about this function
- $functionString = "$function-$caller";
- if ( in_array( $functionString, self::$deprecationWarnings ) ) {
+ if ( isset( self::$deprecationWarnings[$function][$callerFunc] ) ) {
return;
+ } elseif ( isset( self::$deprecationWarnings[$function] ) ) {
+ if ( self::$enabled ) {
+ $sendToLog = false;
+ } else {
+ return;
+ }
}
- $version = $version === false ? '(unknown version)' : $version;
- $component = $component === false ? 'MediaWiki' : $component;
- $msg = htmlspecialchars( "Use of function $function was deprecated in $component $version" );
- $msg .= Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
- Html::element( 'span', array(), 'Backtrace:' )
- . wfBacktrace()
- );
+ self::$deprecationWarnings[$function][$callerFunc] = true;
- self::$deprecationWarnings[] = $functionString;
- self::$log[] = array(
- 'msg' => $msg,
- 'type' => 'deprecated',
- 'caller' => $caller,
- );
+ if ( $version ) {
+ global $wgDeprecationReleaseLimit;
+ if ( $wgDeprecationReleaseLimit && $component === false ) {
+ # Strip -* off the end of $version so that branches can use the
+ # format #.##-branchname to avoid issues if the branch is merged into
+ # a version of MediaWiki later than what it was branched from
+ $comparableVersion = preg_replace( '/-.*$/', '', $version );
+
+ # If the comparableVersion is larger than our release limit then
+ # skip the warning message for the deprecation
+ if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
+ $sendToLog = false;
+ }
+ }
+
+ $component = $component === false ? 'MediaWiki' : $component;
+ $msg = "Use of $function was deprecated in $component $version.";
+ } else {
+ $msg = "Use of $function is deprecated.";
+ }
+
+ if ( $sendToLog ) {
+ self::sendWarning( $msg, $callerDescription, E_USER_DEPRECATED );
+ }
+
+ if ( self::$enabled ) {
+ $logMsg = htmlspecialchars( $msg ) .
+ Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
+ Html::element( 'span', array(), 'Backtrace:' ) . wfBacktrace()
+ );
+
+ self::$log[] = array(
+ 'msg' => $logMsg,
+ 'type' => 'deprecated',
+ 'caller' => $callerFunc,
+ );
+ }
+ }
+
+ /**
+ * Get an array describing the calling function at a specified offset.
+ *
+ * @param $callerOffset integer: How far up the callstack is the original
+ * caller. 0 = function that called getCallerDescription()
+ * @return array with two keys: 'file' and 'func'
+ */
+ private static function getCallerDescription( $callerOffset ) {
+ $callers = wfDebugBacktrace();
+
+ if ( isset( $callers[$callerOffset] ) ) {
+ $callerfile = $callers[$callerOffset];
+ if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
+ $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
+ } else {
+ $file = '(internal function)';
+ }
+ } else {
+ $file = '(unknown location)';
+ }
+
+ if ( isset( $callers[$callerOffset + 1] ) ) {
+ $callerfunc = $callers[$callerOffset + 1];
+ $func = '';
+ if ( isset( $callerfunc['class'] ) ) {
+ $func .= $callerfunc['class'] . '::';
+ }
+ if ( isset( $callerfunc['function'] ) ) {
+ $func .= $callerfunc['function'];
+ }
+ } else {
+ $func = 'unknown';
+ }
+
+ return array( 'file' => $file, 'func' => $func );
+ }
+
+ /**
+ * Send a warning either to the debug log or by triggering an user PHP
+ * error depending on $wgDevelopmentWarnings.
+ *
+ * @param $msg string Message to send
+ * @param $caller array caller description get from getCallerDescription()
+ * @param $level error level to use if $wgDevelopmentWarnings is true
+ */
+ private static function sendWarning( $msg, $caller, $level ) {
+ global $wgDevelopmentWarnings;
+
+ $msg .= ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
+
+ if ( $wgDevelopmentWarnings ) {
+ trigger_error( $msg, $level );
+ } else {
+ wfDebug( "$msg\n" );
+ }
}
/**
* @param $str string
*/
public static function debugMsg( $str ) {
- if ( !self::$enabled ) {
- return;
- }
+ global $wgDebugComments, $wgShowDebug;
- self::$debug[] = trim( $str );
+ if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
+ self::$debug[] = rtrim( $str );
+ }
}
/**
* @return string
*/
public static function getDebugHTML( IContextSource $context ) {
- if ( !self::$enabled ) {
+ global $wgDebugComments;
+
+ $html = '';
+
+ if ( self::$enabled ) {
+ MWDebug::log( 'MWDebug output complete' );
+ $debugInfo = self::getDebugInfo( $context );
+
+ // Cannot use OutputPage::addJsConfigVars because those are already outputted
+ // by the time this method is called.
+ $html = Html::inlineScript(
+ ResourceLoader::makeLoaderConditionalScript(
+ ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
+ )
+ );
+ }
+
+ if ( $wgDebugComments ) {
+ $html .= "<!-- Debug output:\n" .
+ htmlspecialchars( implode( "\n", self::$debug ) ) .
+ "\n\n-->";
+ }
+
+ return $html;
+ }
+
+ /**
+ * Generate debug log in HTML for displaying at the bottom of the main
+ * content area.
+ * If $wgShowDebug is false, an empty string is always returned.
+ *
+ * @since 1.20
+ * @return string HTML fragment
+ */
+ public static function getHTMLDebugLog() {
+ global $wgDebugTimestamps, $wgShowDebug;
+
+ if ( !$wgShowDebug ) {
return '';
}
- MWDebug::log( 'MWDebug output complete' );
- $debugInfo = self::getDebugInfo( $context );
+ $curIdent = 0;
+ $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n<li>";
- // Cannot use OutputPage::addJsConfigVars because those are already outputted
- // by the time this method is called.
- $html = Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
- )
- );
+ foreach ( self::$debug as $line ) {
+ $pre = '';
+ if ( $wgDebugTimestamps ) {
+ $matches = array();
+ if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
+ $pre = $matches[1];
+ $line = substr( $line, strlen( $pre ) );
+ }
+ }
+ $display = ltrim( $line );
+ $ident = strlen( $line ) - strlen( $display );
+ $diff = $ident - $curIdent;
- return $html;
+ $display = $pre . $display;
+ if ( $display == '' ) {
+ $display = "\xc2\xa0";
+ }
+
+ if ( !$ident && $diff < 0 && substr( $display, 0, 9 ) != 'Entering ' && substr( $display, 0, 8 ) != 'Exiting ' ) {
+ $ident = $curIdent;
+ $diff = 0;
+ $display = '<span style="background:yellow;">' . nl2br( htmlspecialchars( $display ) ) . '</span>';
+ } else {
+ $display = nl2br( htmlspecialchars( $display ) );
+ }
+
+ if ( $diff < 0 ) {
+ $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
+ } elseif ( $diff == 0 ) {
+ $ret .= "</li><li>\n";
+ } else {
+ $ret .= str_repeat( "<ul><li>\n", $diff );
+ }
+ $ret .= "<tt>$display</tt>\n";
+
+ $curIdent = $ident;
+ }
+
+ $ret .= str_repeat( '</li></ul>', $curIdent ) . "</li>\n</ul>\n";
+
+ return $ret;
}
/**
* @ingroup Deployment
*/
-require_once( dirname(__FILE__) . '/../../maintenance/Maintenance.php' );
+require_once( __DIR__ . '/../../maintenance/Maintenance.php' );
/**
* Class for handling database updates. Roughly based off of updaters.inc, with
// Load the installer's i18n file.
$wgExtensionMessagesFiles['MediawikiInstaller'] =
- dirname( __FILE__ ) . '/Installer.i18n.php';
+ __DIR__ . '/Installer.i18n.php';
// Having a user with id = 0 safeguards us from DB access via User::loadOptions().
$wgUser = User::newFromId( 0 );
*/
protected function envCheckPath() {
global $IP;
- $IP = dirname( dirname( dirname( __FILE__ ) ) );
+ $IP = dirname( dirname( __DIR__ ) );
$this->setVar( 'IP', $IP );
$this->showMessage( 'config-using-uri', $this->getVar( 'wgServer' ), $this->getVar( 'wgScriptPath' ) );
$url = $m[1];
}
return md5( serialize( array(
- 'local path' => dirname( dirname( __FILE__ ) ),
+ 'local path' => dirname( __DIR__ ),
'url' => $url,
'version' => $GLOBALS['wgVersion']
) ) );
* @return String
*/
public function getCSS( $dir ) {
- $skinDir = dirname( dirname( dirname( __FILE__ ) ) ) . '/skins';
+ $skinDir = dirname( dirname( __DIR__ ) ) . '/skins';
// All these files will be concatenated in sequence and loaded
// as one file.
}
public function getFileContents() {
- $file = dirname( __FILE__ ) . '/../../' . $this->getFileName();
+ $file = __DIR__ . '/../../' . $this->getFileName();
if( ! file_exists( $file ) ) {
return wfMessage( 'config-nofile', $file )->plain();
}
$dbw = wfGetDB( DB_MASTER );
$dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
$affected = $dbw->affectedRows();
- $dbw->commit( __METHOD__ );
if ( !$affected ) {
// Failed, someone else beat us to it
// Delete the random row
$dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
$affected = $dbw->affectedRows();
- $dbw->commit( __METHOD__ );
if ( !$affected ) {
// Random job gone before we exclusively deleted it
* @file
*/
-require_once dirname( __FILE__ ) . '/Services_JSON.php';
+require_once __DIR__ . '/Services_JSON.php';
/**
* JSON formatter wrapper class
*/
static function loadData() {
if( !isset( self::$utfCombiningClass ) ) {
- require_once( dirname(__FILE__) . '/UtfNormalData.inc' );
+ require_once( __DIR__ . '/UtfNormalData.inc' );
}
}
static function plural( $parser, $text = '' ) {
$forms = array_slice( func_get_args(), 2 );
$text = $parser->getFunctionLang()->parseFormattedNumber( $text );
+ settype( $text, ctype_digit( $text ) ? 'int' : 'float' );
return $parser->getFunctionLang()->convertPlural( $text, $forms );
}
if ( isset( $this->mNavigationBar ) ) {
return $this->mNavigationBar;
}
- $lang = $this->getLanguage();
- $fmtLimit = $lang->formatNum( $this->mLimit );
+
$linkTexts = array(
- 'prev' => $this->msg( 'pager-newer-n', $fmtLimit )->escaped(),
- 'next' => $this->msg( 'pager-older-n', $fmtLimit )->escaped(),
+ 'prev' => $this->msg( 'pager-newer-n' )->numParams( $this->mLimit )->escaped(),
+ 'next' => $this->msg( 'pager-older-n' )->numParams( $this->mLimit )->escaped(),
'first' => $this->msg( 'histlast' )->escaped(),
'last' => $this->msg( 'histfirst' )->escaped()
);
$pagingLinks = $this->getPagingLinks( $linkTexts );
$limitLinks = $this->getLimitLinks();
+ $lang = $this->getLanguage();
$limits = $lang->pipeList( $limitLinks );
$this->mNavigationBar = "(" . $lang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
* on success, false on failure
*/
function undelete( $timestamps, $comment = '', $fileVersions = array(), $unsuppress = false, User $user = null ) {
- global $wgContLang, $wgUser;
+ global $wgUser;
// If both the set of text revisions and file revisions are empty,
// restore everything. Otherwise, just restore the requested items.
if ( !count( $wgCopyUploadsDomains ) ) {
return true;
}
- $uri = new Uri( $url );
- $parsedDomain = $uri->getHost();
- if ( $parsedDomain === null ) {
+ $parsedUrl = wfParseUrl( $url );
+ if ( !$parsedUrl ) {
return false;
}
$valid = false;
foreach( $wgCopyUploadsDomains as $domain ) {
- if ( $parsedDomain === $domain ) {
+ if ( $parsedUrl['host'] === $domain ) {
$valid = true;
break;
}
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require ( 'phase3/includes/WebStart.php' );
} else {
- require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+ require ( __DIR__ . '/includes/WebStart.php' );
}
$mediaWiki = new MediaWiki();
# Read language names
global $wgLanguageNames;
-require_once( dirname( __FILE__ ) . '/Names.php' );
+require_once( __DIR__ . '/Names.php' );
if ( function_exists( 'mb_strtoupper' ) ) {
mb_internal_encoding( 'UTF-8' );
* @ingroup Language
*/
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageZh.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageZh.php' );
/**
* @ingroup Language
}
function loadDefaultTables() {
- require( dirname( __FILE__ ) . "/../../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( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
/**
* Conversion script between Latin and Syllabics for Inuktitut.
* @ingroup Language
*/
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/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( dirname(__FILE__)."/../../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( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageKu_ku.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageKu_ku.php' );
/**
* Kurdish converter routines
* @ingroup Language
*/
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
/**
* Conversion script between Latin and Tifinagh for Tachelhit.
* @ingroup Language
*/
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageSr_ec.php' );
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
/**
* Converts Tajiki to latin orthography
* @ingroup Language
*/
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
/**
* @ingroup Language
* @ingroup Language
*/
-require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
-require_once( dirname( __FILE__ ) . '/LanguageZh_hans.php' );
+require_once( __DIR__ . '/../LanguageConverter.php' );
+require_once( __DIR__ . '/LanguageZh_hans.php' );
/**
* @ingroup Language
}
function loadDefaultTables() {
- require( dirname( __FILE__ ) . "/../../includes/ZhConversion.php" );
+ require( __DIR__ . "/../../includes/ZhConversion.php" );
$this->mTables = array(
'zh-hans' => new ReplacementArray( $zh2Hans ),
'zh-hant' => new ReplacementArray( $zh2Hant ),
'note' => "'''تێبینی:'''",
'previewnote' => "'''لە بیرت نەچێت ئەمە تەنیا پێشبینینە.'''
گۆڕانکارییەکانت ھێشتا پاشەکەوت نەکراون!",
+'continue-editing' => 'بەردەوام بە لەدەستکاریکردن',
'previewconflict' => 'ئەم پێشبینینە بە تۆ نیشان ئەدات ئەو دەقەی لە شوێنی دەستکاری سەرەوە داتناوە چۆن بەرچاو ئەکەوێت ئەگەر پاشەکەوتی بکەیت.',
'session_fail_preview' => "'''ببوورە! ناتوانین دەستکارییەکەت پێواژۆ بکەین بە ھۆی لەدەستدانی session data.'''
تکایە دیسان ھەوڵبدەوە.
**لادان لە مافەکانی بڵاوکردنەوە
***پەڕگەی دووبارەکراوە',
'filedelete-edit-reasonlist' => 'دەستکاری هۆکارەکانی سڕینەوە',
+'filedelete-maintenance-title' => 'ناتوانیت پەڕگە بسڕیتەوە',
# MIME search
'mimesearch' => 'گەڕانی MIME',
ئێستا ڕەوانکەرە بۆ [[$2]].',
'double-redirect-fixer' => 'چارەسەرکەری ڕەوانکەر',
-'brokenredirects' => 'ڕەوانەکراوە شکاوەکان',
+'brokenredirects' => 'ڕەوانەکەرە شکاوەکان',
'brokenredirectstext' => 'ئەم ڕەوانەکراوانە بەستەرن بۆ ئەو پەڕانە کە بوونیان نییە:',
'brokenredirects-edit' => 'دەستکاری',
'brokenredirects-delete' => 'سڕینەوە',
'allpages-bad-ns' => '{{SITENAME}} ناوبۆشایی نیە "$1".',
'allpages-hide-redirects' => 'ڕەوانەکراوەکان بشارەوە',
+# SpecialCachedPage
+'cachedspecial-refresh-now' => 'دواترین پیشانبدە',
+
# Special:Categories
'categories' => 'پۆلەكان',
'categoriespagetext' => 'ئەم {{PLURAL:$1|پۆلە پەڕە یان پەڕگەی|پۆلانە پەڕە یان پەڕگەیان}} لەخۆگرتە.
'protectedarticle' => '«[[$1]]»ی پاراست',
'modifiedarticleprotection' => 'ئاستی پاراستنی «[[$1]]»ی گۆڕا',
'unprotectedarticle' => 'پاراستنی لەسەر «[[$1]]» لابرد',
-'movedarticleprotection' => 'ڕێککارییەکانی پاراستن لە "[[$2]]" گوازرایەوە بۆ "[[$1]]"',
+'movedarticleprotection' => 'ڕێککارییەکانی پاراستن لە «[[$2]]» گوازرایەوە بۆ «[[$1]]»',
'protect-title' => 'گۆڕینی ئاستی پاراستنی "$1"',
'prot_1movedto2' => '[[$1]] گوازرایەوە بۆ [[$2]]',
'protect-legend' => 'پاراستن تەیید بکە',
'movepagebtn' => 'ئەم پەڕەیە بگوازەوە',
'pagemovedsub' => 'گواستنەوە بە سەرکەوتوویی جێبەجێ کرا',
'movepage-moved' => "'''«$1» گوازرایەوە بۆ «$2»'''",
-'movepage-moved-redirect' => 'ڕەوانکەرێک درووستکرا.',
+'movepage-moved-redirect' => 'ڕەوانەکەرێک دروست کرا.',
'movepage-moved-noredirect' => 'لە دانانی ڕەوانەکەر بەرگری کرا.',
'articleexists' => 'پەڕەیەک بەم ناوە ھەیە یان ئەو ناوەی تۆ ھەڵتبژاردووە ڕێگەی پێنەدراوە.
تکایە ناوێکی دیکە ھەڵبژێرە.',
'movedto' => 'گواسترایەوە بۆ',
'movetalk' => 'پەڕەی وتووێژی پەیوەندیدار بگوازەوە',
'move-subpages' => 'ژێرپەڕەکانی بگوازەوە (ھەتا $1 پەڕە)',
-'move-talk-subpages' => 'ژێرپەڕەکانی پەڕەی وتووێژی بگۆزەرەوە (ھەتاکوو $1)',
+'move-talk-subpages' => 'ژێرپەڕەکانی پەڕەی وتووێژ بگوازەوە (ھەتا $1 پەڕە)',
'movepage-page-exists' => 'پەڕەی $1 هەیە و ناتوانرێت خۆکار بخرێتە جێی.',
'movepage-page-moved' => 'پەڕەی $1 گۆزرایەوە بۆ $2.',
'movepage-page-unmoved' => 'ناکرێ پەڕەی $1 بگوێزرێتەوە بۆ $2.',
'movelogpagetext' => 'لە خوارەوەدا لیستی ھەموو پەڕە گواستنەوەکان دەبینن.',
'movesubpage' => '{{PLURAL:$1|ژێرپەڕە|ژێرپەڕە}}',
'movesubpagetext' => 'ئەم لاپەڕە $1 {{PLURAL:$1|ژێرلاپەڕەی|ژێرلاپەڕەی}} هەیە کە لەخوارە نیشان دراوە.',
-'movenosubpage' => 'ئەم پەڕە ھیچ ژێرپەڕەیەکی نییە.',
+'movenosubpage' => 'ئەم پەڕەیە ھیچ ژێرپەڕەیەکی نییە.',
'movereason' => 'ھۆکار:',
'revertmove' => 'پێچەوانەکردنەوە',
'delete_and_move' => 'بیسڕەوە و بیگوازەوە',
# Info page
'pageinfo-title' => 'زانیاری بۆ «$1»',
+'pageinfo-header-basic' => 'زانیاریی سەرەتایی',
'pageinfo-header-edits' => 'دەستکاریەکان',
'pageinfo-views' => 'ژمارەی بینینەکان',
'pageinfo-watchers' => 'ژمارەی چاودێران',
+'pageinfo-firstuser' => 'دروستکەری پەڕە',
'pageinfo-edits' => 'ژمارەی دەستکارییەکان',
# Skin names
'exif-imagelength' => 'بەرزی',
'exif-imagedescription' => 'ناونیشانی وێنە',
'exif-model' => 'جۆری کامێرا',
+'exif-software' => 'نەرمەواڵەی بەکارهاتوو',
'exif-artist' => 'نووسەر',
'exif-colorspace' => 'بۆشایی رهنگ',
+'exif-pixelydimension' => 'پانی وێنە',
+'exif-pixelxdimension' => 'بەرزی وێنە',
'exif-usercomment' => 'بۆچوونەکانی بەکارهێنەر',
'exif-relatedsoundfile' => 'فایلی دهنگی لێکچوو',
'exif-lightsource' => 'سەرچاوەی ڕووناکی',
'exif-gpstrack' => 'ئاڕاستەی جوڵان',
'exif-gpsimgdirection' => 'ئاڕاستەی وێنە',
'exif-gpsdatestamp' => 'ڕێکەوتی GPS',
+'exif-objectname' => 'سەردێری کورت',
+'exif-headline' => 'سەردێر',
+'exif-source' => 'سەرچاوە',
+'exif-copyrighted' => 'ڕەوشی مافی لەبەرگرتنەوە',
# EXIF attributes
'exif-compression-1' => 'نەپەستێنراو',
'exif-gpsspeed-k' => 'کیلۆمەتر هەر کاتژمێر',
'exif-gpsspeed-m' => 'مایل هەر کاتژمێر',
+# Pseudotags used for GPSDestDistanceRef
+'exif-gpsdestdistance-k' => 'کیلۆمەتر',
+'exif-gpsdestdistance-m' => 'میل',
+'exif-gpsdestdistance-n' => 'میکی دەریایی',
+
+'exif-dc-date' => 'ڕۆژ(ەکان)',
+'exif-dc-publisher' => 'بڵاوکار',
+'exif-dc-relation' => 'پەڕگەی پەیوەندیدار',
+'exif-dc-rights' => 'مافەکان',
+'exif-dc-source' => 'سەرچاوەی پەڕگە',
+'exif-dc-type' => 'جۆری پەڕگە',
+
'exif-iimcategory-hth' => 'تەندروستی',
'exif-iimcategory-sci' => 'زانست و تەکنۆلۆژیا',
'exif-iimcategory-soi' => 'بابەتە کۆمەڵایەتییەکان',
'shared-repo' => 'yew embarê repositoryî',
'shared-repo-name-wikimediacommons' => 'Wikimedia Commons',
'filepage.css' => '/* CSS placed here is included on the file description page, also included on foreign client wikis */',
+'upload-disallowed-here' => 'Nê asengi sero theba nênusneyêno.',
# File reversion
'filerevert' => '$1 reyna biyere',
'pageinfo-authors' => 'Amarina nuştekaran pêro',
'pageinfo-recent-edits' => 'Amariya vurnayışan ($1 ra nata)',
'pageinfo-recent-authors' => 'Amarina nuştekaran pêro',
-'pageinfo-restriction' => 'Xısusiyetê pela da (<code>$1</code>)',
+'pageinfo-restriction' => 'Xısusiyetê pela (<code>{{lcfirst:$1}}</code>)',
'pageinfo-magic-words' => '{{PLURAL:$1|Çekuya|Çekuyê}} ($1) sihırini',
'pageinfo-hidden-categories' => '{{PLURAL:$1|Kategoriye|Kategoriyan}} ($1) bınımne',
'pageinfo-templates' => '{{PLURAL:$1|Şablon|Şabloni}} ($1) açarneyayê',
'file-info-size-pages' => '$1 × $2 pikse, dergeya dosyay: $3, MIME tipiya cı: $4, $5 {{PLURAL:$5|pela|pela}}',
'file-nohires' => 'Rovıleşiyayışo berzêr çıniyo.',
'svg-long-desc' => 'SVG dosya, nominalin $1 × $2 piksels, ebatê dosya: $3',
+'svg-long-desc-animated' => 'SVG dosya, nominalin $1 × $2 piksela, ebatê dosya: $3',
'show-big-image' => 'Resolosyonê temami',
'show-big-image-preview' => "Verqayd dergiya: $1'i.",
'show-big-image-other' => 'Zewmi{{PLURAL:$2|Vılêşnayış|Vılêşnayışê}}: $1.',
'file-info-png-looped' => 'atlama biyo',
'file-info-png-repeat' => '$1 {{PLURAL:$1|hew|hew}} kay biyê',
'file-info-png-frames' => '$1 {{PLURAL:$1|çerçeve|çerçeveyi}}',
+'file-no-thumb-animation' => "'''Not: Dılet tekniko limit, gırd agozneya resm de qıckek de animasyoni miyan dı nêbo.'''",
+'file-no-thumb-animation-gif' => "'''Not: Dılet tekniko limit, gırd agozneya resm de qıckek de GIF imaci de animasyon do nêbo.'''",
# Special:NewFiles
'newimages' => 'Galeriya dosyayan dê newan',
'otherlanguages' => 'Ann an cànain eile',
'redirectedfrom' => '(Air ath-sheòladh o $1)',
'redirectpagesub' => 'Ath-sheòl an duilleag',
-'lastmodifiedat' => 'Chaidh an duilleag seo a mhùthadh $1, aig $2 turas mu dheireadh.',
+'lastmodifiedat' => 'Chaidh an duilleag seo a mhùthadh $1 aig $2 turas mu dheireadh.',
'viewcount' => 'Chaidh inntrigeadh a dhèanam dhan duilleag seo {{PLURAL:$1|aon turas|$1 thuras|$1 turas|$1 turais|$1 turas}}.',
'protectedpage' => 'Duilleag fo dhìon',
'jumpto' => 'Gearr leum gu:',
'''Mas e deasachadh dligheach a tha seo, feuch ris a-rithist.'''
Mur obraich e fhathast, feuch is [[Special:UserLogout|clàraich a-mach]] is a-steach a-rithist an uairsin.",
+'token_suffix_mismatch' => "'''Dhiùlt sinn na dheasaich thu a chionn 's gun do chuir an cliant agad na caractaran puingeachaidh tro chèile san tòcan deasachaidh.'''
+Dhiùlt sinn na dheasaich thu air eagal 's gun coirbeadh e teacsa na duilleige.
+Tachraidh seo uaireannan ma chleachdar seirbheis-lìn progsaidh gun urra a tha làn de mhearachdan.",
+'edit_form_incomplete' => "'''Cha do ràinig cuid dhen fhoirm deasachaidh am frithealaichte; dèan cinnteach gu bheil gach deasachadh agad slàn is feuch ris a-rithist.'''",
'editing' => "A' deasachadh $1",
'editingsection' => "A' deasachadh $1 (earrann)",
+'editingcomment' => "A' deasachadh $1 (earrann ùr)",
'editconflict' => 'Còmhstri deasachaidh: $1',
'explainconflict' => "Tha cuideigin eile air an duilleag seo a mhùthadh on a thòisich thu fhèin air a dheasachadh.
Tha am bogsa teacsa gu h-àrd a' nochdadh na duilleige mar a tha i an-dràsta.
Cha dèid '''ach an teacsa gu h-àrd''' a shàbhaladh nuair a bhriogas tu air \"{{int:savearticle}}\".",
'yourtext' => 'An teacsa agad',
'storedversion' => 'Lethbhreac taisgte',
+'nonunicodebrowser' => "'''Rabhadh: Chan eil am brabhsair agad co-chòrdail le Unicode.'''
+Chuir sinn gleus air dòigh dhut a nì cinnteach gun urrainn dhut duilleagan a shàbhaladh gu tèarainte: Nochdaidh caractaran taobh a-muigh ASCII mar chòd sia-dheicheach sa bhogsa deasachaidh.",
'editingold' => "'''RABHADH: Tha thu a' deasachadh lethbhreac seann-aimsireil na duilleige seo.
Ma shàbhalas tu seo, thèid gach mùthadh air chall a rinneadh a-mach on mhùthadh seo.'''",
'yourdiff' => 'Caochlaidhean',
Mur eil thu ag iarraidh an sgrìobhaidh agad a dheasaichear is a sgaoilear le càch, na cuir e.<br />
Ma dh'fhoilleachas tu rudeigin an seo, bidh tu a' dearbhadh gun do sgrìobh thu fhèin e, no gur ann às an raon phòballach a thàinig e; thoir aire '''nach eil''' sin a' gabhail a-staigh duilleagan-lìn mar as àbhaist (seall $1 airson barrachd fiosrachaidh). <br />
'''NA CLEACHDAIBH SAOTHAIR FO DHLIGHE-SGRÌOBHAIDH GUN CHEAD!'''",
+'longpageerror' => "'''Mearachd: Tha an teacsa a chur thu thugainn {{PLURAL:$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|}} a dh'fhaid is tha sin nas fhaide na tha ceadaichte ({{PLURAL:$1 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|}}).'''
+Cha ghabh a shàbhaladh.",
+'readonlywarning' => "'''Rabhadh: Chaidh an stòr-dàta a ghlasadh a chum obair-ghlèidhidh agus chan urrainn dhut na còraichean-deasachaidh agad a chur gu feum an-dràsta fhèin.'''
+'S mathaid gum b' fheairrde dhut lethbhreac a dhèanamh dhen teacsa agus a shàbhaladh ann am faidhle ach an urrainn dhut a chleachdadh as a dhèidh seo.
+
+Seo am mìneachadh a thug an rianaire a ghlais e: $1",
'protectedpagewarning' => "'''Rabhadh: Chaidh an duilleag seo a dhìon 's chan urrainn ach dhan fheadhainn aig a bheil ùghdarras rianaire a dheasachadh.'''
Chì thu an clàr mu dheireadh san loga mar fhiosrachadh dhut gu h-ìosal:",
+'semiprotectedpagewarning' => "'''An aire:''' Chaidh an duilleag seo a dhìon 's chan fhaod ach cleachdaichean clàraichte a dheasachadh.
+Seo an rud mu dheireadh san loga mar fhiosrachadh dhut:",
+'cascadeprotectedwarning' => "'''Rabhadh:''' Chaidh an duilleag seo a dhìon 's chan fhaod ach rianairean a dheasachadh a chionn 's gun robh e am broinn {{PLURAL:$1|na duilleige|nan duilleagan}} a leanas a tha cascade-protected.",
+'titleprotectedwarning' => "'''Rabhadh: Chaidh an duilleag seo a dhìon 's feumar [[Special:ListGroupRights|còraichean sònraichte]] gus a dheasachadh.'''
+Seo an rud mu dheireadh san loga mar fhiosrachadh dhut:",
'templatesused' => "Tha {{PLURAL:$1|teamplaid|theamplaid||teamplaid|theamplaid|teamplaidean|teamplaid}} 'gan cleachdadh air an duilleag seo:",
'templatesusedpreview' => "Tha {{PLURAL:$1|teamplaid 'ga cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh}} san ro-shealladh seo:",
+'templatesusedsection' => "Tha {{PLURAL:$1|teamplaid 'ga cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh}} san earrann seo:",
'template-protected' => '(air a dhìon)',
'template-semiprotected' => '(air a leth-dhìon)',
'hiddencategories' => "Tha an duilleag seo 'na ball de {{PLURAL:$1|1 roinn-seòrsa fhalaichte|$1 roinn-seòrsa fhalaichte|1 roinn-seòrsa fhalaichte|$1 roinn-seòrsa fhalaichte|$1 roinnean-seòrsa falaichte|$1 roinn-seòrsa fhalaichte}}:",
L'ultimo elemento del registro dei blocchi è riportato di seguito per informazione:",
'clearyourcache' => "'''Nota:''' dopo aver salvato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti.
*'''Firefox / Safari''': tenere premuto il tasto delle maiuscole e fare clic su ''Ricarica'', oppure premere ''Ctrl-F5'' o ''Ctrl-R'' (''⌘-R'' su Mac)
-*'''Google Chrome''': premere ''Ctrl-Shift-R'' (''⌘-Shift-R'' su un Mac)
+*'''Google Chrome''': fare clic su ''Ricarica'', oppure premere ''Ctrl-R'' o ''Ctrl-Shift-R'' (''⌘-Shift-R'' su un Mac)
*'''Internet Explorer''': tenere premuto il tasto ''Ctrl'' mentre si fa clic su ''Refresh'', oppure premere ''Ctrl-F5''
*'''Opera''': svuotare completamente la cache dal menu ''Strumenti → Preferenze''",
'usercssyoucanpreview' => "'''Suggerimento:''' usa il pulsante 'Visualizza anteprima' per provare il tuo nuovo CSS prima di salvarlo.",
'resetpass_announce' => 'メールでお送りした仮パスワードでログインしました。
ログインを完了するには、ここで新しいパスワードを設定する必要があります:',
'resetpass_text' => '<!-- ここに文を挿入 -->',
-'resetpass_header' => 'ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83\91ã\82¹ã\83¯ã\83¼ã\83\89ã\82\92変更',
-'oldpassword' => '古いパスワード:',
-'newpassword' => '新しいパスワード:',
+'resetpass_header' => 'ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83\91ã\82¹ã\83¯ã\83¼ã\83\89ã\81®変更',
+'oldpassword' => '古いパスワード:',
+'newpassword' => '新しいパスワード:',
'retypenew' => '新しいパスワードを再入力:',
'resetpass_submit' => '再設定してログイン',
'resetpass_success' => 'パスワードの変更に成功しました!
手動で統合してください。'''",
'movedto' => '移動先:',
'movetalk' => '付随するトークページも移動',
-'move-subpages' => '下位ページも移動($1ページまで)',
-'move-talk-subpages' => 'トークページの下位ページも移動($1個まで)',
+'move-subpages' => '下位ページも移動($1 件まで)',
+'move-talk-subpages' => 'トークページの下位ページも移動($1 件まで)',
'movepage-page-exists' => 'ページ「$1」は既に存在するため、自動的な上書きはできませんでした。',
'movepage-page-moved' => 'ページ「$1」は「$2」に移動しました。',
'movepage-page-unmoved' => 'ページ「$1」は「$2」に移動できませんでした。',
'movelogpage' => '移動記録',
'movelogpagetext' => '以下はすべてのページ移動の一覧です。',
'movesubpage' => '{{PLURAL:$1|下位ページ}}',
-'movesubpagetext' => 'このページには{{PLURAL:$1|下位ページ}}が以下の $1 件あります。',
+'movesubpagetext' => 'このページには、以下の $1 {{PLURAL:$1|下位ページ}}があります。',
'movenosubpage' => 'このページに下位ページはありません。',
'movereason' => '理由:',
'revertmove' => '差し戻し',
'variantname-ike-latn' => 'イヌクティトゥット語 (ラテン文字)',
'variantname-iu' => 'イヌクティトゥット語',
+# Variants for Tachelhit language
+'variantname-shi-tfng' => 'シルハ語 (ティフィナグ文字)',
+'variantname-shi-latn' => 'シルハ語 (ラテン文字)',
+'variantname-shi' => 'シルハ語',
+
# Metadata
'metadata' => 'メタデータ',
'metadata-help' => 'このファイルには、追加情報があります(おそらく、作成やデジタル化する際に使用したデジタルカメラやスキャナーが追加したものです)。
* @author Junaidpv
* @author Jyothis
* @author Kaganer
+ * @author Krenair
* @author Manjith Joseph <manjithkaini@gmail.com>
* @author Naveen Sankar
* @author Praveen Prakash <me.praveen@gmail.com>
'newarticle' => '(പുതിയത്)',
'newarticletext' => 'ഇതുവരെ നിലവിലില്ലാത്ത ഒരു താൾ സൃഷ്ടിക്കാനുള്ള ശ്രമത്തിലാണ് താങ്കൾ. അതിനായി താഴെ ആവശ്യമുള്ള വിവരങ്ങൾ എഴുതിച്ചേർത്ത് സേവ് ചെയ്യുക (കൂടുതൽ വിവരങ്ങൾക്ക് [[{{MediaWiki:Helppage}}|സഹായം താൾ]] കാണുക). താങ്കളിവിടെ അബദ്ധത്തിൽ വന്നതാണെങ്കിൽ ബ്രൗസറിന്റെ ബാക്ക് ബട്ടൺ ഞെക്കിയാൽ തിരിച്ചുപോകാം.',
'anontalkpagetext' => "----
-{| class=\"messagebox standard-talk\" style=\"border: 1px solid #B3B300; background-color:#FFFFBF;\"
-|align=\"left\" |
+{| class=\"messagebox standard-talk\" style=\"border: 1px solid #B3B300; background-color:#FFFFBF; text-align: left;\"
+|
''ഇതുവരെ അംഗത്വം എടുക്കാതിരിക്കുകയോ, നിലവിലുള്ള അംഗത്വം ഉപയോഗിക്കാതിരിക്കുകയോ ചെയ്യുന്ന '''ഒരു അജ്ഞാത ഉപയോക്താവിന്റെ സംവാദം താളാണിത്'''.
അതിനാൽ അദ്ദേഹത്തെ തിരിച്ചറിയുവാൻ അക്കരൂപത്തിലുള്ള ഐ.പി. വിലാസം ഉപയോഗിക്കേണ്ടതുണ്ട്. ഇത്തരം ഒരു ഐ.പി. വിലാസം പല ഉപയോക്താക്കൾ പങ്കുവെക്കുന്നുണ്ടാവാം.
താങ്കൾ ഈ സന്ദേശം ലഭിച്ച ഒരു അജ്ഞാത ഉപയോക്താവാണെങ്കിൽ, ഭാവിയിൽ ഇതര ഉപയോക്താക്കളുമായി ഉണ്ടായേക്കാവുന്ന ആശയക്കുഴപ്പം ഒഴിവാക്കാൻ ദയവായി [[Special:UserLogin/signup|ഒരു അംഗത്വമെടുക്കുക]] അല്ലെങ്കിൽ [[Special:UserLogin|പ്രവേശിക്കുക]].
'spamprotectiontitle' => 'Spam ਸੁਰੱਖਿਆ ਫਿਲਟਰ',
# Info page
-'pageinfo-header-edits' => 'ਸੋਧਾਂ',
-'pageinfo-watchers' => 'ਨà¨\9c਼ਰ ਰੱà¨\96ਣ ਵਾਲ਼ਿà¨\86à¨\82 ਦà©\80 à¨\97ਿਣਤà©\80',
-'pageinfo-edits' => 'ਸà©\8bਧਾà¨\82 ਦà©\80 à¨\97ਿਣਤà©\80',
+'pageinfo-header-edits' => 'ਸੋਧਾਂ ਦਾ ਅਤੀਤ',
+'pageinfo-watchers' => 'ਸਫ਼à©\87 â\80\99ਤà©\87 ਨà¨\9c਼ਰ ਰੱà¨\96ਣ ਵਾਲ਼à©\87',
+'pageinfo-edits' => 'à¨\95à©\81ੱਲ ਸà©\8bਧਾà¨\82',
# Skin names
'skinname-standard' => 'ਕਲਾਸਿਕ',
'tooltip-t-permalink' => 'Anliura fissa a sta version-sì dla pàgina',
'tooltip-ca-nstab-main' => 'Vardé la pàgina ëd contnù.',
'tooltip-ca-nstab-user' => 'Vardé la pàgina Utent.',
-'tooltip-ca-nstab-media' => 'Vardé la pàgina dl',
+'tooltip-ca-nstab-media' => 'Vardé la pàgina dël mojen',
'tooltip-ca-nstab-special' => 'Costa a l',
'tooltip-ca-nstab-project' => 'Vardé la pàgina proteta.',
'tooltip-ca-nstab-image' => 'Vardé la pàgina dl',
* @ingroup Language
* @file
*
+ * @author Arjunaraoc
* @author Chaduvari
* @author Jprmvnvijay5
* @author Kaganer
# Special:ChangeEmail
'changeemail' => 'ఈ-మెయిలు చిరునామా మార్పు',
'changeemail-header' => 'ఖాతా ఈ-మెయిల్ చిరునామాని మార్చండి',
+'changeemail-text' => 'మీ ఈమెయిల్ చిరునామా మార్చుటకు ఈ ఫారము నింపండి. ఈ మార్పుని ఖచ్చితపరచుటకు మీ సంకేతపదం ప్రవేశపెట్టాలి.',
'changeemail-no-info' => 'ఈ పేజీని నేరుగా చూడటానికి మీరు లోనికి ప్రవేశించివుండాలి.',
'changeemail-oldemail' => 'ప్రస్తుత ఈ-మెయిలు చిరునామా:',
'changeemail-newemail' => 'కొత్త ఈ-మెయిలు చిరునామా:',
'contribslink' => 'kontribuisaun',
'block-log-flags-nocreate' => 'la bele kria konta foun',
'block-log-flags-noemail' => 'korreiu eletróniku blokeiu',
+'block-log-flags-nousertalk' => 'la bele edita pájina diskusaun rasik',
'ipb_already_blocked' => 'Ema ruma blokeiu "$1" tiha ona',
# Move page
'uploadlogpagetext' => 'درج ذیل میں حالیہ زبراثقال (اپ لوڈ) کی گئی املاف (فائلوں) کی فہرست دی گئی ہے۔',
'filedesc' => 'خلاصہ',
'fileuploadsummary' => 'خلاصہ :',
+'filesource' => 'ذرائع',
'uploadedfiles' => 'زبراثقال ملف (فائل اپ لوڈ)',
'ignorewarning' => 'انتباہ نظرانداز کرتے ہوۓ بہرصورت ملف (فائل) کو محفوظ کرلیا جاۓ۔',
'ignorewarnings' => 'ہر انتباہ نظرانداز کردیا جاۓ۔',
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require ( 'phase3/includes/WebStart.php' );
} else {
- require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+ require ( __DIR__ . '/includes/WebStart.php' );
}
wfProfileIn( 'load.php' );
* @defgroup Maintenance Maintenance
*/
+// Make sure we're on PHP5 or better
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
+ require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
+ wfPHPVersionError( 'cli' );
+}
+
/**
* @defgroup MaintenanceArchive Maintenance archives
* @ingroup Maintenance
*/
// Define this so scripts can easily find doMaintenance.php
-define( 'RUN_MAINTENANCE_IF_MAIN', dirname( __FILE__ ) . '/doMaintenance.php' );
+define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
$maintClass = false;
-// Make sure we're on PHP5 or better
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
- require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
- wfPHPVersionError( 'cli' );
-}
/**
* Abstract maintenance class for quickly writing and churning out
global $IP;
$IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== ''
? getenv( 'MW_INSTALL_PATH' )
- : realpath( dirname( __FILE__ ) . '/..' );
+ : realpath( __DIR__ . '/..' );
$this->addDefaultParams();
register_shutdown_function( array( $this, 'outputChanneled' ), false );
* @return string
*/
protected function getDir() {
- return dirname( __FILE__ );
+ return __DIR__;
}
/**
protected static function getCoreScripts() {
if ( !self::$mCoreScripts ) {
$paths = array(
- dirname( __FILE__ ),
- dirname( __FILE__ ) . '/language',
- dirname( __FILE__ ) . '/storage',
+ __DIR__,
+ __DIR__ . '/language',
+ __DIR__ . '/storage',
);
self::$mCoreScripts = array();
foreach ( $paths as $p ) {
* @ingroup MaintenanceArchive
*/
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
+require( __DIR__ . '/../commandLine.inc' );
class UpdateLogging {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to correct wrong values in the `page_latest` field
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/backup.inc' );
+require_once( __DIR__ . '/backup.inc' );
/**
* @ingroup Maintenance
* @ingroup Benchmark
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
abstract class Benchmarker extends Maintenance {
private $results;
* @author Platonides
*/
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
class bench_HTTP_HTTPS extends Benchmarker {
public function __construct() {
* @ingroup Benchmark
*/
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
class BenchmarkDeleteTruncate extends Benchmarker {
* @author Platonides
*/
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
class bench_if_switch extends Benchmarker {
public function __construct() {
* @ingroup Benchmark
*/
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
function bfNormalizeTitleStrTr( $str ) {
return strtr( $str, '_', ' ' );
<?php
-/**\r
- * @file\r
- * @ingroup Benchmark\r
- */\r
-\r
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );\r
+/**
+ * @file
+ * @ingroup Benchmark
+ */
+
+require_once( __DIR__ . '/Benchmarker.php' );
/**
* This little benchmark executes the regexp used in Language->checkTitleEncoding() and compares its execution time
* against that of mb_check_encoding, if available.
- */\r
+ */
class bench_utf8_title_check extends Benchmarker {
private $canRun;
private $data;
- public function __construct() {\r
+ public function __construct() {
parent::__construct();
$this->data = array (
$this->canRun = function_exists ( 'mb_check_encoding' );
- if ( $this->canRun ) {\r
+ if ( $this->canRun ) {
$this->mDescription = "Benchmark for using a regexp vs. mb_check_encoding to check for UTF-8 encoding.";
mb_internal_encoding( 'UTF-8' );
} else {
$this->mDescription = "CANNOT RUN benchmark using mb_check_encoding: function not available.";
- }\r
- }\r
-\r
+ }
+ }
+
public function execute() {
if ( !$this->canRun ) {
return;
'function' => array( $this, 'use_regexp_once_only' ),
'args' => array( rawurldecode ( $val ) )
);
- $benchmarks[] = array(\r
- 'function' => array( $this, 'use_mb_check_encoding' ),\r
- 'args' => array( rawurldecode ( $val ) )\r
+ $benchmarks[] = array(
+ 'function' => array( $this, 'use_mb_check_encoding' ),
+ 'args' => array( rawurldecode ( $val ) )
);
- }\r
+ }
$this->bench( $benchmarks );
- print $this->getFormattedResults();\r
- }\r
+ print $this->getFormattedResults();
+ }
private $isutf8;
-\r
+
function use_regexp( $s ) {
$this->isutf8 = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
- '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );\r
- }\r
-\r
+ '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
+ }
+
function use_regexp_non_capturing( $s ) {
// Same as above with a non-capturing subgroup.
$this->isutf8 = preg_match( '/^(?:[\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
'[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
}
- function use_mb_check_encoding( $s ) {\r
- $this->isutf8 = mb_check_encoding( $s, 'UTF-8' );\r
- }\r
-\r
-}\r
-\r
-$maintClass = 'bench_utf8_title_check';\r
-require_once( RUN_MAINTENANCE_IF_MAIN );\r
+ function use_mb_check_encoding( $s ) {
+ $this->isutf8 = mb_check_encoding( $s, 'UTF-8' );
+ }
+
+}
+
+$maintClass = 'bench_utf8_title_check';
+require_once( RUN_MAINTENANCE_IF_MAIN );
* @author Platonides
*/
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
class bench_wfIsWindows extends Benchmarker {
public function __construct() {
* @ingroup Benchmark
*/
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
class BenchmarkHooks extends Benchmarker {
* @ingroup Benchmark
*/
-require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
+require_once( __DIR__ . '/Benchmarker.php' );
class BenchmarkPurge extends Benchmarker {
*/
/** */
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
function cdbShowHelp( $command ) {
$commandList = array(
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to change the password of a given user.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to check classes definitions in the autoloader.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to check that pages marked as being redirects really are.
* @file
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to check images to see if they exist, are readable, etc.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to check syntax of all PHP files in MediaWiki.
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to check that database usernames are actually valid.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to cleans up old database tables, dropping old indexes
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
/**
* Maintenance script to clean up broken page links when somebody turns on $wgCapitalLinks.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
/**
* Maintenance script to clean up broken, unparseable upload filenames.
* @ingroup Maintenance\r
*/\r
\r
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );\r
+require_once( __DIR__ . '/Maintenance.php' );\r
\r
/**\r
* Maintenance script that removes hidden preferences from the database.\r
* @author Roan Kattouw
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to remove cache entries for removed ResourceLoader modules
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to cleanup all spam from a given hostname.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Generic class to cleanup a database table. Already subclasses Maintenance.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
/**
* Maintenance script to clean up broken, unparseable titles.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to remove old or broken uploads from temporary uploaded
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/cleanupTable.inc' );
+require_once( __DIR__ . '/cleanupTable.inc' );
/**
* Maintenance script to remove broken, unparseable titles in the watchlist table.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to clear the cache of interwiki prefixes for all local wikis.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to remove all statistics tracking from the cache.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
global $optionsWithArgs;
if ( !isset( $optionsWithArgs ) ) {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to convert from the old links schema (string->ID)
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to convert user options to the new `user_properties` table.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Copy all files in one container of one backend to another.
* @author Rob Church <robchur@gmail.com>
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to create an account and grant it administrator rights.
* @author Aaron Schulz
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to delete a batch of pages.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that deletes all pages in the MediaWiki namespace
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that deletes revisions which refer to a nonexisting page.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that deletes one or more revisions by moving them
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that deletes self-references to $wgServer
$optionsWithArgs = array( 'pagelist', 'start', 'end', 'revstart', 'revend');
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
-require_once( dirname( __FILE__ ) . '/backup.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
+require_once( __DIR__ . '/backup.inc' );
$dumper = new BackupDumper( $argv );
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Base class for interating over a dump.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that generates a plaintext link dump.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that generates a page name dump for SisterSites usage.
$originalDir = getcwd();
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
-require_once( dirname( __FILE__ ) . '/backupTextPass.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
+require_once( __DIR__ . '/backupTextPass.inc' );
$dumper = new TextPassDumper( $argv );
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to dump a the list of files uploaded,
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to make a page edit.
$optionsWithArgs = array( 'd' );
/** */
-require_once( dirname( __FILE__ ) . "/commandLine.inc" );
+require_once( __DIR__ . "/commandLine.inc" );
if ( isset( $options['d'] ) ) {
$d = $options['d'];
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to test fileop performance.
* @author Antoine Musso <hashar at free dot fr>
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that compares documented and actually present mismatches.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that fixes double redirects.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that fixes any entriy for protocol-relative URLs
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that fixes erroneous page_latest values
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that fixes timestamp corruption caused by one or
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that fixes the user_registration field.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) .'/Maintenance.php' );
+require_once( __DIR__ .'/Maintenance.php' );
/**
* Maintenance script that formats RELEASE-NOTE file to wiki text or HTML markup.
// ///////////////////////// COMMAND LINE HELP ////////////////////////////////////
// This is a command line script, load MediaWiki env (gives command line options);
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that generates a sitemap for the site.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that displays replication lag times.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that reports the hostname of a slave server.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that outputs page text to stdout.
<?php
define( 'MW_CONFIG_CALLBACK', 'MakeHipHop::noConfigNeeded' );
-require( dirname( __FILE__ ) . '/../Maintenance.php' );
+require( __DIR__ . '/../Maintenance.php' );
class MakeHipHop extends Maintenance {
function noConfigNeeded() {}
$startTime = time();
- $thisDir = realpath( dirname( __FILE__ ) );
+ $thisDir = realpath( __DIR__ );
$IP = realpath( "$thisDir/../.." );
if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
$buildDir = $wgHipHopBuildDirectory;
}
}
- $extraCoreFiles = array_map( 'trim', file( dirname( __FILE__ ) . '/extra-files' ) );
+ $extraCoreFiles = array_map( 'trim', file( __DIR__ . '/extra-files' ) );
foreach ( $extraCoreFiles as $file ) {
if ( $file === '' ) {
continue;
#!/usr/bin/hphpi -f
<?php
-require( dirname( __FILE__ ) . '/../Maintenance.php' );
+require( __DIR__ . '/../Maintenance.php' );
class RunHipHopServer extends Maintenance {
function __construct() {
function runCompiled() {
global $wgHipHopBuildDirectory;
- $thisDir = realpath( dirname( __FILE__ ) );
+ $thisDir = realpath( __DIR__ );
$IP = realpath( "$thisDir/../.." );
if ( strval( $wgHipHopBuildDirectory ) !== '' ) {
$buildDir = $wgHipHopBuildDirectory;
}
function runInterpreted() {
- $thisDir = realpath( dirname( __FILE__ ) );
+ $thisDir = realpath( __DIR__ );
$IP = realpath( "$thisDir/../.." );
$sourceBase = realpath( "$IP/.." );
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that imports XML dump files into the current wiki.
*/
$optionsWithArgs = array( 'extensions', 'comment', 'comment-file', 'comment-ext', 'user', 'license', 'sleep', 'limit', 'from', 'source-wiki-url' );
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to import all scripts in the MediaWiki namespace from a
}
$this->output( "Importing $page\n" );
- $uri = new Uri( $baseUrl );
- $uri->extendQuery( array(
+ $url = wfAppendQuery( $baseUrl, array(
'action' => 'raw',
'title' => "MediaWiki:{$page}" ) );
- $url = $uri->toString();
-
$text = Http::get( $url );
$wikiPage = WikiPage::factory( $title );
$pages = array();
do {
- $uri = new Uri( $baseUrl );
- $uri->extendQuery( $data );
- $url = $uri->toString();
+ $url = wfAppendQuery( $baseUrl, $data );
$strResult = Http::get( $url );
//$result = FormatJson::decode( $strResult ); // Still broken
$result = unserialize( $strResult );
$options = array( 'help', 'nooverwrite', 'norc' );
$optionsWithArgs = array( 'title', 'user', 'comment' );
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
echo( "Import Text File\n\n" );
if ( count( $args ) < 1 || isset( $options['help'] ) ) {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class InitEditCount extends Maintenance {
public function __construct() {
* @author Rob Church <robchur@gmail.com>
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to re-initialise or update the site statistics table
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
define( 'MEDIAWIKI_INSTALL', true );
-require_once( dirname( dirname( __FILE__ ) )."/maintenance/Maintenance.php" );
+require_once( dirname( __DIR__ )."/maintenance/Maintenance.php" );
/**
* Maintenance script to install and configure MediaWiki
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to do test JavaScript validity parses using jsmin+'s parser
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to show database lag.
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class AllTrans extends Maintenance {
public function __construct() {
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
-$messagesDir = dirname( __FILE__ ) . '/../../languages/messages/';
+require_once( __DIR__ . '/../commandLine.inc' );
+$messagesDir = __DIR__ . '/../../languages/messages/';
$runTest = false;
$run = false;
$runMode = 'text';
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
require_once( 'languages.inc' );
require_once( 'checkLanguage.inc' );
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
require_once( 'checkLanguage.inc' );
require_once( 'languages.inc' );
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class CountMessages extends Maintenance {
public function __construct() {
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class DateFormats extends Maintenance {
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class Digit2Html extends Maintenance {
* @todo Make this more useful, right now just dumps $wgContentLang
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class DumpMessages extends Maintenance {
public function __construct() {
* @file
*/
-require_once( dirname( __FILE__ ) .'/../Maintenance.php' );
+require_once( __DIR__ .'/../Maintenance.php' );
/**
* Generate first letter data files for Collation.php
* @ingroup MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
-require_once( dirname( __FILE__ ) . '/../../includes/normal/UtfNormalUtil.php' );
+require_once( __DIR__ . '/../../includes/normal/UtfNormalUtil.php' );
/**
* Generates normalizer data files for Arabic and Malayalam.
*/
/** This is a command line script */
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
-require_once( dirname( __FILE__ ) . '/languages.inc' );
+require_once( __DIR__ . '/../Maintenance.php' );
+require_once( __DIR__ . '/languages.inc' );
class LangMemUsage extends Maintenance {
* @param $exif bool Treat the EXIF messages?
*/
function __construct( $exif = true ) {
- require( dirname(__FILE__) . '/messageTypes.inc' );
+ require( __DIR__ . '/messageTypes.inc' );
$this->mIgnoredMessages = $wgIgnoredMessages;
if ( $exif ) {
$this->mOptionalMessages = array_merge( $wgOptionalMessages );
* @defgroup MaintenanceLanguage MaintenanceLanguage
*/
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
require_once( 'languages.inc' );
require_once( 'writeMessagesArray.inc' );
*/
$optionsWithArgs = array( 'output' );
-require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+require_once( __DIR__ . '/../commandLine.inc' );
require_once( 'languages.inc' );
-require_once( dirname( __FILE__ ) . '/StatOutputs.php' );
+require_once( __DIR__ . '/StatOutputs.php' );
if ( isset( $options['help'] ) ) {
define( 'MEDIAWIKI', 1 );
define( 'NOT_REALLY_MEDIAWIKI', 1 );
-$IP = dirname( __FILE__ ) . '/../..';
+$IP = __DIR__ . '/../..';
require_once( "$IP/includes/Defines.php" );
require_once( "$IP/languages/Language.php" );
*/
public static function writeMessagesArray( $messages, $ignoredComments = false, $prefix = false, $removeUnknown = false ) {
# Load messages
- $dir = $prefix ? $prefix : dirname( __FILE__ );
+ $dir = $prefix ? $prefix : __DIR__;
require( $dir . '/messages.inc' );
self::$messageStructure = $wgMessageStructure;
*/
/** */
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
$mcc = new MWMemcached( array( 'persistent' => true/*, 'debug' => true*/ ) );
$mcc->set_servers( $wgMemCachedServers );
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
$maintClass = 'MergeMessageFileList';
$mmfl = false;
$dirs = array(
$IP,
- dirname( dirname( __FILE__ ) ),
+ dirname( __DIR__ ),
realpath( $IP )
);
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to move a batch of pages.
}
/** Figure out the base directory for MediaWiki location */
-$mwPath = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR;
+$mwPath = dirname( __DIR__ ) . DIRECTORY_SEPARATOR;
/** doxygen binary script */
$doxygenBin = 'doxygen';
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that checks for articles to fix after
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class AlterSharedConstraints extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname(__FILE__) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to parse some wikitext.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that manually runs an SQL patch outside of the general updaters.
* @author Simetrical
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Mainteance script to populate the category table.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to populate the img_sha1 field.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that makes the required database updates for populating the
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that makes the required database updates for
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that makes the required database updates for rev_parent_id
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that populates the rev_len field for old revisions
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that fills the rev_sha1 and ar_sha1 columns of revision
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/dumpIterator.php' );
+require_once( __DIR__ . '/dumpIterator.php' );
/**
* Maintenance script that takes page text out of an XML dump file and
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
$wgHooks['BeforeParserFetchTemplateAndtitle'][] = 'PPFuzzTester::templateHook';
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that protects or unprotects a page.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that prunes file cache for pages, objects, resources, etc.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that scans the deletion log and purges affected files
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that purges old text records from the database.
* @ingroup Maintenance
*/
-require( dirname( __FILE__ ) . '/Maintenance.php' );
+require( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to remove old objects from the parser cache.
* @ingroup Maintenance Memcached
*/
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
function purgeStaleMemcachedText() {
global $wgMemc, $wgDBname;
* @licence GNU General Public Licence 2.0 or later
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that reassigns edits from a user or IP address
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that builds file cache for content pages.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to update image metadata records.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to rebuild the localisation cache.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that rebuilds link tracking tables from scratch.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that purges all languages from the message cache.
* @todo Document
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that rebuilds recent changes from scratch.
* @todo document
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that rebuilds search index table from scratch.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class RefreshImageCount extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to refresh image metadata fields.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to refresh link tables.
* @author Rob Church <robchur@gmail.com>
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that removes unused user accounts from the database.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that changes the prefix of database tables.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/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( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to reset the user_token for all users on the wiki.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to rollback all edits by a given user or IP provided
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script to run a database query in batches and wait for slaves.
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
/**
* Maintenance script that runs pending jobs.
* @author Antoine Musso
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class ShowJobs extends Maintenance {
public function __construct() {
* @license GNU General Public License 2.0 or later
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class ShowStats extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class MwSql extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class SqliteMaintenance extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class CacheStats extends Maintenance {
*/
if ( !defined( 'MEDIAWIKI' ) ) {
- require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
+ require_once( __DIR__ . '/../commandLine.inc' );
$cs = new CheckStorage;
$fix = isset( $options['fix'] );
* @ingroup Maintenance ExternalStorage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class CompressOld extends Maintenance {
/**
* @ingroup Maintenance ExternalStorage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class DumpRev extends Maintenance {
public function __construct() {
* @ingroup Maintenance ExternalStorage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class FixBug20757 extends Maintenance {
var $batchSize = 10000;
define( 'REPORTING_INTERVAL', 1 );
if ( !defined( 'MEDIAWIKI' ) ) {
- require_once( dirname( __FILE__ ) . '/../commandLine.inc' );
- require_once( dirname( __FILE__ ) . '/../../includes/ExternalStoreDB.php' );
+ require_once( __DIR__ . '/../commandLine.inc' );
+ require_once( __DIR__ . '/../../includes/ExternalStoreDB.php' );
require_once( 'resolveStubs.php' );
$fname = 'moveToExternal';
*
* @ingroup Maintenance ExternalStorage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class OrphanStats extends Maintenance {
public function __construct() {
*/
$optionsWithArgs = RecompressTracked::getOptionsWithArgs();
-require( dirname( __FILE__ ) . '/../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( dirname( __FILE__ ) . '/../commandLine.inc' );
+ require_once( __DIR__ . '/../commandLine.inc' );
resolveStubs();
}
* @ingroup Maintenance ExternalStorage
*/
-require_once( dirname( __FILE__ ) . '/../Maintenance.php' );
+require_once( __DIR__ . '/../Maintenance.php' );
class StorageTypeStats extends Maintenance {
function execute() {
*/
$optionsWithArgs = array( 'start', 'limit', 'type' );
-require( dirname( __FILE__ ) . '/../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( dirname( __FILE__ ) . '/../commandLine.inc' );
+require( __DIR__ . '/../commandLine.inc' );
if ( count( $args ) < 1 ) {
$dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_tracking' ) );
$dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_orphans' ) );
}
- $dbw->sourceFile( dirname( __FILE__ ) . '/blob_tracking.sql' );
+ $dbw->sourceFile( __DIR__ . '/blob_tracking.sql' );
}
function getTextClause() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class SyncFileBackend extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class Undelete extends Maintenance {
public function __construct() {
}
$wgUseMasterForMaintenance = true;
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class UpdateMediaWiki extends Maintenance {
* @author Rob Church <robchur@gmail.com>
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class UpdateArticleCount extends Maintenance {
#$optionsWithArgs = array( 'begin', 'max-slave-lag' );
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class UpdateCollation extends Maintenance {
const BATCH_SIZE = 50; // Number of rows to process in one batch
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class UpdateDoubleWidthSearch extends Maintenance {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class UpdateRestrictions extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class UpdateSearchIndex extends Maintenance {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class UpdateSpecialPages extends Maintenance {
public function __construct() {
* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
define( 'MW_UPGRADE_COPY', false );
define( 'MW_UPGRADE_ENCODE', true );
$options = array( 'list', 'nowarn', 'quiet', 'usage', 'dry' );
$optionsWithArgs = array( 'old', 'new' );
-require_once( dirname( __FILE__ ) . '/commandLine.inc' );
+require_once( __DIR__ . '/commandLine.inc' );
/**
* @ingroup Maintenance
* @see wfWaitForSlaves()
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
class WaitForSlave extends Maintenance {
public function __construct() {
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
define( 'MEDIAWIKI_INSTALL', true );
-chdir( dirname( dirname( __FILE__ ) ) );
+chdir( dirname( __DIR__ ) );
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require ( 'core/includes/WebStart.php' );
} else {
- require( dirname( dirname( __FILE__ ) ) . '/includes/WebStart.php' );
+ require( dirname( __DIR__ ) . '/includes/WebStart.php' );
}
wfInstallerMain();
* @file
*/
-require_once( dirname(__FILE__) . '/includes/WebStart.php' );
+require_once( __DIR__ . '/includes/WebStart.php' );
if( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
// Makes testing tweaks about a billion times easier
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require ( 'core/includes/WebStart.php' );
} else {
- require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+ require ( __DIR__ . '/includes/WebStart.php' );
}
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require ( 'phase3/includes/WebStart.php' );
} else {
- require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
+ require ( __DIR__ . '/includes/WebStart.php' );
}
global $wgArticlePath;
if ( !defined( 'MEDIAWIKI' ) ) {
$wgNoDBParam = true;
$optionsWithArgs = array( 'o' );
- require_once( dirname(__FILE__).'/../maintenance/commandLine.inc' );
+ require_once( __DIR__ .'/../maintenance/commandLine.inc' );
$stderr = fopen( 'php://stderr', 'w' );
if ( !isset( $args[0] ) ) {
die( -1 );
/** */
-require_once( dirname(__FILE__) . '/MonoBook.php' );
+require_once( __DIR__ . '/MonoBook.php' );
/**
* Inherit main code from SkinTemplate, set the CSS and template filter.
* http://www.gnu.org/copyleft/gpl.html
*/
-$IP = dirname( dirname( __FILE__ ) );
+$IP = dirname( __DIR__ );
define( 'SELENIUMTEST', true );
-//require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
-require( dirname( __FILE__ ) . '/../maintenance/Maintenance.php' );
+//require_once( __DIR__ . '/../maintenance/commandLine.inc' );
+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( dirname( __FILE__ ) . "/selenium/SeleniumServerManager.php" );
+require_once( __DIR__ . "/selenium/SeleniumServerManager.php" );
class SeleniumTester extends Maintenance {
protected $selenium;
<?php
global $wgAutoloadClasses;
-$testFolder = dirname( __FILE__ );
+$testFolder = __DIR__;
$wgAutoloadClasses += array(
//includes
'BlockTest' => "$testFolder/phpunit/includes/BlockTest.php",
- 'MockOutputPage' => "$testFolder/phpunit/includes/MockOutputPage.php",
//API
'ApiFormatTestBase' => "$testFolder/phpunit/includes/api/format/ApiFormatTestBase.php",
*
*/
-$maintenanceDir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/maintenance';
+$maintenanceDir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/maintenance';
require( "$maintenanceDir/Maintenance.php" );
$otions = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled' );
$optionsWithArgs = array( 'regex', 'filter', 'seed', 'setversion' );
-require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
+require_once( __DIR__ . '/../maintenance/commandLine.inc' );
if ( isset( $options['help'] ) ) {
echo <<<ENDS
# PHPUnit uses stream_resolve_include_path() internally
# See bug 32022
set_include_path(
- dirname( __FILE__ )
+ __DIR__
.PATH_SEPARATOR
. get_include_path()
);
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 ( dirname( __FILE__ ) . "/phpunit.php" );
+ require_once ( __DIR__ . "/phpunit.php" );
}
// Output a notice when running with older versions of PHPUnit
array( array( 'foo' => 1 ), 'foo=1' ), // number test
array( array( 'foo' => true ), 'foo=1' ), // true test
array( array( 'foo' => false ), '' ), // false test
- array( array( 'foo' => null ), 'foo' ), // null test
+ array( array( 'foo' => null ), '' ), // null test
array( array( 'foo' => 'A&B=5+6@!"\'' ), 'foo=A%26B%3D5%2B6%40%21%22%27' ), // urlencoding test
array( array( 'foo' => 'bar', 'baz' => 'is', 'asdf' => 'qwerty' ), 'foo=bar&baz=is&asdf=qwerty' ), // multi-item test
array( array( 'foo' => array( 'bar' => 'baz' ) ), 'foo%5Bbar%5D=baz' ),
function testDebugFunctionTest() {
- global $wgDebugLogFile, $wgOut, $wgShowDebug, $wgDebugTimestamps;
+ global $wgDebugLogFile, $wgDebugTimestamps;
$old_log_file = $wgDebugLogFile;
$wgDebugLogFile = tempnam( wfTempDir(), 'mw-' );
wfDebug( "\00305This has böth UTF and control chars\003" );
$this->assertEquals( " 05This has böth UTF and control chars ", file_get_contents( $wgDebugLogFile ) );
unlink( $wgDebugLogFile );
-
-
-
- $old_wgOut = $wgOut;
- $old_wgShowDebug = $wgShowDebug;
-
- $wgOut = new MockOutputPage;
-
- $wgShowDebug = true;
-
- $message = "\00305This has böth UTF and control chars\003";
-
- wfDebug( $message );
-
- if( $wgOut->message == "JAJA is a stupid error message. Anyway, here's your message: $message" ) {
- $this->assertTrue( true, 'MockOutputPage called, set the proper message.' );
- }
- else {
- $this->assertTrue( false, 'MockOutputPage was not called.' );
- }
-
- $wgOut = $old_wgOut;
- $wgShowDebug = $old_wgShowDebug;
- unlink( $wgDebugLogFile );
-
-
-
+
wfDebugMem();
$this->assertGreaterThan( 5000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) );
unlink( $wgDebugLogFile );
+++ /dev/null
-<?php
-
-class MockOutputPage {
-
- public $message;
-
- function debug( $message ) {
- $this->message = "JAJA is a stupid error message. Anyway, here's your message: $message";
- }
-}
/**
* @group Database
*/
-require dirname( __FILE__ ) . "/../../../maintenance/runJobs.php";
+require __DIR__ . "/../../../maintenance/runJobs.php";
class TemplateCategoriesTest extends MediaWikiLangTestCase {
+++ /dev/null
-<?php
-
-class UriTest extends MediaWikiTestCase {
-
- function setUp() {
- AutoLoader::loadClass( 'Uri' );
- }
-
- function dataUris() {
- return array(
- array(
- 'http://example.com/',
- array(
- 'scheme' => 'http',
- 'delimiter' => '://',
- 'user' => null,
- 'pass' => null,
- 'host' => 'example.com',
- 'port' => null,
- 'path' => '/',
- 'query' => null,
- 'fragment' => null,
- ),
- ),
- array(
- '//mediawiki.org/wiki/Main_Page',
- array(
- 'scheme' => null,
- 'delimiter' => '//',
- 'user' => null,
- 'pass' => null,
- 'host' => 'mediawiki.org',
- 'port' => null,
- 'path' => '/wiki/Main_Page',
- 'query' => null,
- 'fragment' => null,
- ),
- ),
- array(
- 'http://user:pass@example.com/',
- array(
- 'scheme' => 'http',
- 'delimiter' => '://',
- 'user' => 'user',
- 'pass' => 'pass',
- 'host' => 'example.com',
- 'port' => null,
- 'path' => '/',
- 'query' => null,
- 'fragment' => null,
- ),
- ),
- array(
- '/?asdf=asdf',
- array(
- 'scheme' => null,
- 'delimiter' => null,
- 'user' => null,
- 'pass' => null,
- 'host' => null,
- 'port' => null,
- 'path' => '/',
- 'query' => 'asdf=asdf',
- 'fragment' => null,
- ),
- ),
- array(
- '?asdf=asdf#asdf',
- array(
- 'scheme' => null,
- 'delimiter' => null,
- 'user' => null,
- 'pass' => null,
- 'host' => null,
- 'port' => null,
- 'path' => null,
- 'query' => 'asdf=asdf',
- 'fragment' => 'asdf',
- ),
- )
- );
- }
-
- /**
- * Ensure that get* methods properly match the appropriate getComponent( key ) value
- * @dataProvider dataUris
- */
- function testGetters( $uri ) {
- $uri = new Uri( $uri );
- $getterMap = array(
- 'getProtocol' => 'scheme',
- 'getUser' => 'user',
- 'getPassword' => 'pass',
- 'getHost' => 'host',
- 'getPort' => 'port',
- 'getPath' => 'path',
- 'getQueryString' => 'query',
- 'getFragment' => 'fragment',
- );
- foreach ( $getterMap as $fn => $c ) {
- $this->assertSame( $uri->{$fn}(), $uri->getComponent( $c ), "\$uri->{$fn}(); matches \$uri->getComponent( '$c' );" );
- }
- }
-
- /**
- * Ensure that Uri has the proper components for our example uris
- * @dataProvider dataUris
- */
- function testComponents( $uri, $components ) {
- $uri = new Uri( $uri );
-
- $this->assertSame( $components['scheme'], $uri->getProtocol(), 'Correct scheme' );
- $this->assertSame( $components['delimiter'], $uri->getDelimiter(), 'Correct delimiter' );
- $this->assertSame( $components['user'], $uri->getUser(), 'Correct user' );
- $this->assertSame( $components['pass'], $uri->getPassword(), 'Correct pass' );
- $this->assertSame( $components['host'], $uri->getHost(), 'Correct host' );
- $this->assertSame( $components['port'], $uri->getPort(), 'Correct port' );
- $this->assertSame( $components['path'], $uri->getPath(), 'Correct path' );
- $this->assertSame( $components['query'], $uri->getQueryString(), 'Correct query' );
- $this->assertSame( $components['fragment'], $uri->getFragment(), 'Correct fragment' );
- }
-
- /**
- * Ensure that the aliases work for various components.
- */
- function testAliases() {
- $url = "//myuser@test.com";
- $uri = new Uri( $url );
-
- // Set the aliases.
- $uri->setComponent( 'protocol', 'https' );
- $uri->setComponent( 'password', 'mypass' );
-
- // Now try getting them.
- $this->assertSame( 'https', $uri->getComponent( 'protocol' ), 'Correct protocol (alias for scheme)' );
- $this->assertSame( 'mypass', $uri->getComponent( 'password' ), 'Correct password (alias for pass)' );
-
- // Finally check their actual names.
- $this->assertSame( 'https', $uri->getProtocol(), 'Alias for scheme works' );
- $this->assertSame( 'mypass', $uri->getPassword(), 'Alias for pass works' );
- }
-
- /**
- * Ensure that Uri's helper methods return the correct data
- */
- function testHelpers() {
- $uri = new Uri( 'http://a:b@example.com:8080/path?query=value' );
-
- $this->assertSame( 'a:b', $uri->getUserInfo(), 'Correct getUserInfo' );
- $this->assertSame( 'example.com:8080', $uri->getHostPort(), 'Correct getHostPort' );
- $this->assertSame( 'a:b@example.com:8080', $uri->getAuthority(), 'Correct getAuthority' );
- $this->assertSame( '/path?query=value', $uri->getRelativePath(), 'Correct getRelativePath' );
- $this->assertSame( 'http://a:b@example.com:8080/path?query=value', $uri->toString(), 'Correct toString' );
- }
-
- /**
- * Ensure that Uri's extend method properly overrides keys
- */
- function testExtend() {
- $uri = new Uri( 'http://example.org/?a=b&hello=world' );
- $uri->extendQuery( 'a=c&foo=bar' );
- $this->assertSame( 'a=c&hello=world&foo=bar', $uri->getQueryString() );
- }
-}
var $zipDir, $entries;
function setUp() {
- $this->zipDir = dirname( __FILE__ ) . '/../data/zip';
+ $this->zipDir = __DIR__ . '/../data/zip';
}
function zipCallback( $entry ) {
foreach ( array(
'/usr/share/dict/words',
'/usr/dict/words',
- dirname( __FILE__ ) . '/words.txt' )
+ __DIR__ . '/words.txt' )
as $dictionaryFile ) {
if ( is_file( $dictionaryFile ) and is_readable( $dictionaryFile ) ) {
$this->dictionaryFile = $dictionaryFile;
*/
// Evaluate the include path relative to this file
-$IP = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) );
+$IP = dirname( dirname( dirname( dirname( __DIR__ ) ) ) );
// Start up MediaWiki in command-line mode
require_once( "$IP/maintenance/Maintenance.php" );
-require( dirname( __FILE__ ) . "/RandomImageGenerator.php" );
+require( __DIR__ . "/RandomImageGenerator.php" );
class GenerateRandomImages extends Maintenance {
}
/**
- * @dataProvider dataSQL
+ * @dataProvider dataSelectSQLText
*/
- function testSQL( $sql, $sqlText ) {
+ function testSelectSQLText( $sql, $sqlText ) {
$this->assertEquals( trim( $this->db->selectSQLText(
isset( $sql['tables'] ) ? $sql['tables'] : array(),
isset( $sql['fields'] ) ? $sql['fields'] : array(),
) ), $sqlText );
}
- function dataSQL() {
+ function dataSelectSQLText() {
return array(
array(
array(
),
);
}
+
+ /**
+ * @dataProvider dataConditional
+ */
+ function testConditional( $sql, $sqlText ) {
+ $this->assertEquals( trim( $this->db->conditional(
+ $sql['conds'],
+ $sql['true'],
+ $sql['false']
+ ) ), $sqlText );
+ }
+
+ function dataConditional() {
+ return array(
+ array(
+ array(
+ 'conds' => array( 'field' => 'text' ),
+ 'true' => 1,
+ 'false' => 'NULL',
+ ),
+ "(CASE WHEN field = 'text' THEN 1 ELSE NULL END)"
+ ),
+ array(
+ array(
+ 'conds' => 'field=1',
+ 'true' => 1,
+ 'false' => 'NULL',
+ ),
+ "(CASE WHEN field=1 THEN 1 ELSE NULL END)"
+ ),
+ );
+ }
}
\ No newline at end of file
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-require_once dirname( __FILE__ ) . "/ORMRowTest.php";
+require_once __DIR__ . "/ORMRowTest.php";
class TestORMRowTest extends ORMRowTest {
}
/** Clear log before each test */
MWDebug::clearLog();
+ wfSuppressWarnings();
+ }
+
+ function tearDown() {
+ wfRestoreWarnings();
}
function testAddLog() {
class BitmapMetadataHandlerTest extends MediaWikiTestCase {
public function setUp() {
- $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+ $this->filePath = __DIR__ . '/../../data/media/';
}
/**
function setUp() {
parent::setUp();
$this->handler = new BitmapHandler();
- $filePath = dirname( __FILE__ ) . '/../../data/media';
+ $filePath = __DIR__ . '/../../data/media';
$tmpDir = $this->getNewTempDirectory();
class ExifTest extends MediaWikiTestCase {
public function setUp() {
- $this->mediaPath = dirname( __FILE__ ) . '/../../data/media/';
+ $this->mediaPath = __DIR__ . '/../../data/media/';
if ( !wfDl( 'exif' ) ) {
$this->markTestSkipped( "This test needs the exif extension." );
if ( !wfDl( 'exif' ) ) {
$this->markTestSkipped( "This test needs the exif extension." );
}
- $filePath = dirname( __FILE__ ) . '/../../data/media';
+ $filePath = __DIR__ . '/../../data/media';
$this->backend = new FSFileBackend( array(
'name' => 'localtesting',
'lockManager' => 'nullLockManager',
class GIFMetadataExtractorTest extends MediaWikiTestCase {
public function setUp() {
- $this->mediaPath = dirname( __FILE__ ) . '/../../data/media/';
+ $this->mediaPath = __DIR__ . '/../../data/media/';
}
/**
* Put in a file, and see if the metadata coming out is as expected.
class GIFHandlerTest extends MediaWikiTestCase {
public function setUp() {
- $this->filePath = dirname( __FILE__ ) . '/../../data/media';
+ $this->filePath = __DIR__ . '/../../data/media';
$this->backend = new FSFileBackend( array(
'name' => 'localtesting',
'lockManager' => 'nullLockManager',
class JpegMetadataExtractorTest extends MediaWikiTestCase {
public function setUp() {
- $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+ $this->filePath = __DIR__ . '/../../data/media/';
}
/**
class JpegTest extends MediaWikiTestCase {
public function setUp() {
- $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+ $this->filePath = __DIR__ . '/../../data/media/';
if ( !wfDl( 'exif' ) ) {
$this->markTestSkipped( "This test needs the exif extension." );
}
class PNGMetadataExtractorTest extends MediaWikiTestCase {
function setUp() {
- $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+ $this->filePath = __DIR__ . '/../../data/media/';
}
/**
* Tests zTXt tag (compressed textual metadata)
class PNGHandlerTest extends MediaWikiTestCase {
public function setUp() {
- $this->filePath = dirname( __FILE__ ) . '/../../data/media';
+ $this->filePath = __DIR__ . '/../../data/media';
$this->backend = new FSFileBackend( array(
'name' => 'localtesting',
'lockManager' => 'nullLockManager',
}
function providerSvgFiles() {
- $base = dirname( __FILE__ ) . '/../../data/media';
+ $base = __DIR__ . '/../../data/media';
return array(
array(
"$base/Wikimedia-logo.svg",
}
function providerSvgFilesWithXMLMetadata() {
- $base = dirname( __FILE__ ) . '/../../data/media';
+ $base = __DIR__ . '/../../data/media';
$metadata =
'<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<ns4:Work xmlns:ns4="http://creativecommons.org/ns#" rdf:about="">
global $wgShowEXIF;
$this->showExif = $wgShowEXIF;
$wgShowEXIF = true;
- $this->filePath = dirname( __FILE__ ) . '/../../data/media/';
+ $this->filePath = __DIR__ . '/../../data/media/';
$this->handler = new TiffHandler;
}
}
public function dataXMPParse() {
- $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/' ;
+ $xmpPath = __DIR__ . '/../../data/xmp/' ;
$data = array();
// $xmpFiles format: array of arrays with first arg file base name,
* world example file to double check the support for this is right.
*/
function testExtendedXMP() {
- $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/';
+ $xmpPath = __DIR__ . '/../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
* and thus should only return the StandardXMP, not the ExtendedXMP.
*/
function testExtendedXMPWithWrongGUID() {
- $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/';
+ $xmpPath = __DIR__ . '/../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
* which should cause it to ignore the ExtendedXMP packet.
*/
function testExtendedXMPMissingPacket() {
- $xmpPath = dirname( __FILE__ ) . '/../../data/xmp/';
+ $xmpPath = __DIR__ . '/../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
<?php
-require_once( dirname( __FILE__ ) . '/NewParserTest.php' );
+require_once( __DIR__ . '/NewParserTest.php' );
/**
* The UnitTest must be either a class that inherits from MediaWikiTestCase
array( "{{foo|bar=|}", "<root>{{foo|bar=|}</root>"),
array( "{{Foo|} Bar=", "<root>{{Foo|} Bar=</root>"),
array( "{{Foo|} Bar=}}", "<root><template><title>Foo</title><part><name>} Bar</name>=<value></value></part></template></root>"),
- /* array( file_get_contents( dirname( __FILE__ ) . '/QuoteQuran.txt' ), file_get_contents( dirname( __FILE__ ) . '/QuoteQuranExpanded.txt' ) ), */
+ /* array( file_get_contents( __DIR__ . '/QuoteQuran.txt' ), file_get_contents( __DIR__ . '/QuoteQuranExpanded.txt' ) ), */
);
}
* @dataProvider provideFiles
*/
function testPreprocessorOutputFiles( $filename ) {
- $folder = dirname( __FILE__ ) . "/../../../parser/preprocess";
+ $folder = __DIR__ . "/../../../parser/preprocess";
$wikiText = file_get_contents( "$folder/$filename.txt" );
$output = $this->preprocessToXml( $wikiText );
parent::setUp();
// Setup a file for bug 29408
- $this->bug29408File = dirname( __FILE__ ) . '/bug29408';
+ $this->bug29408File = __DIR__ . '/bug29408';
file_put_contents( $this->bug29408File, "\x00" );
self::$users = array(
* @file
*/
-require_once dirname( dirname( __FILE__ ) ) . '/bootstrap.php';
+require_once dirname( __DIR__ ) . '/bootstrap.php';
/** Tests for MediaWiki languages/LanguageSr.php */
class LanguageSrTest extends MediaWikiTestCase {
* @file
*/
-require_once dirname( dirname( __FILE__ ) ) . '/bootstrap.php';
+require_once dirname( __DIR__ ) . '/bootstrap.php';
/** Tests for MediaWiki languages/LanguageUz.php */
class LanguageUzTest extends MediaWikiTestCase {
<?php
-require_once dirname( __FILE__ ) . "/../../../maintenance/backupPrefetch.inc";
+require_once __DIR__ . "/../../../maintenance/backupPrefetch.inc";
/**
* Tests for BaseDump
<?php
-require_once dirname( __FILE__ ) . "/../../../maintenance/backupTextPass.inc";
+require_once __DIR__ . "/../../../maintenance/backupTextPass.inc";
/**
* Tests for page dumps of BackupDumper
<?php
-require_once dirname( __FILE__ ) . "/../../../maintenance/fetchText.php";
+require_once __DIR__ . "/../../../maintenance/fetchText.php";
/**
* Mock for the input/output of FetchText
<?php
-require_once dirname( __FILE__ ) . "/../../../maintenance/getSlaveServer.php";
+require_once __DIR__ . "/../../../maintenance/getSlaveServer.php";
/**
* Tests for getSlaveServer
/* Configuration */
// Evaluate the include path relative to this file
-$IP = dirname( dirname( dirname( __FILE__ ) ) );
+$IP = dirname( dirname( __DIR__ ) );
// Set a flag which can be used to detect when other scripts have been entered through this entry point or not
define( 'MW_PHPUNIT_TEST', true );
<?php
-require_once( dirname( dirname( __FILE__ ) ) . '/includes/upload/UploadFromUrlTest.php' );
+require_once( dirname( __DIR__ ) . '/includes/upload/UploadFromUrlTest.php' );
class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
public $savedGlobals = array();
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
$this->assertTrue( $this->isElementPresent( "submit-back" ));
$this->assertTrue( $this->isElementPresent( "submit-continue" ));
}
-}
\ No newline at end of file
+}
*/
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
/**
* Test Case ID : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*
*/
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
/**
* Test Case ID : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
/**
* Test Case ID : 09 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
* Version : MediaWiki 1.18alpha
*/
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
class MediaWikiErrorsNamepageTestCase extends MediaWikiInstallationCommonFunction {
* Version : MediaWiki 1.18alpha
*/
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction {
*/
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
-require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationConfig.php' );
-require_once ( dirname(__FILE__) . '/MediaWikiInstallationMessage.php' );
-require_once ( dirname(__FILE__) . '/MediaWikiInstallationVariables.php');
+require_once ( __DIR__ . '/MediaWikiInstallationConfig.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationMessage.php' );
+require_once ( __DIR__ . '/MediaWikiInstallationVariables.php');
class MediaWikiInstallationCommonFunction extends PHPUnit_Extensions_SeleniumTestCase {
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Framework/TestSuite.php';
-require_once ( dirname( __FILE__ ) . '/MediaWikiUserInterfaceTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiButtonsAvailabilityTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiHelpFieldHintTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiRightFrameworkLinksTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiRestartInstallationTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiErrorsConnectToDatabasePageTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiErrorsNamepageTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiMySQLDataBaseTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiMySQLiteDataBaseTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiUpgradeExistingDatabaseTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiDifferntDatabasePrefixTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/MediaWikiDifferentDatabaseAccountTestCase.php' );
-require_once ( dirname( __FILE__ ) . '/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' );
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
$this->chooseCancelOnNextConfirmation();
parent::restartInstallation();
}
-}
\ No newline at end of file
+}
*
*/
-require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
+require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
/**
* Test Case ID : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
$this->login();
$this->open( $this->getUrl() .
'/index.php?title=Special:Upload' );
- $this->type( 'wpUploadFile', dirname( __FILE__ ) .
+ $this->type( 'wpUploadFile', __DIR__ .
"\\..\\data\\Wikipedia-logo-v2-de.png" );
$this->check( 'wpIgnoreWarning' );
$this->click( 'wpUpload' );
*
*/
-require_once dirname( dirname( __FILE__ ) ) . '/SeleniumTestConstants.php';
+require_once dirname( __DIR__ ) . '/SeleniumTestConstants.php';
class MyContributionsTestCase extends SeleniumTestCase {
*
*/
-require_once dirname( dirname( __FILE__ ) ) . '/SeleniumTestConstants.php';
+require_once dirname( __DIR__ ) . '/SeleniumTestConstants.php';
class MyWatchListTestCase extends SeleniumTestCase {
if ( isset( $_SERVER['MW_COMPILED'] ) ) {
require( 'core/includes/WebStart.php' );
} else {
- require( dirname( __FILE__ ) . '/includes/WebStart.php' );
+ require( __DIR__ . '/includes/WebStart.php' );
}
// Don't use fancy mime detection, just check the file extension for jpg/gif/png
}
# Just get the URI path (REDIRECT_URL/REQUEST_URI is either a full URL or a path)
if ( substr( $uriPath, 0, 1 ) !== '/' ) {
- $uri = new Uri( $uriPath );
- $uriPath = $uri->getPath();
- if ( $uriPath === null ) {
+ $bits = wfParseUrl( $uriPath );
+ if ( $bits && isset( $bits['path'] ) ) {
+ $uriPath = $bits['path'];
+ } else {
wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
return;
}
# Execute thumb.php, having set THUMB_HANDLER so that
# it knows to extract params from a thumbnail file URL.
-require( dirname( __FILE__ ) . '/thumb.php' );
+require( __DIR__ . '/thumb.php' );