Go to the source code of this file.
Enumerations | |
enum | TS_UNIX |
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC. More... | |
enum | TS_MW |
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS). More... | |
enum | TS_DB |
MySQL DATETIME (YYYY-MM-DD HH:MM:SS). More... | |
enum | TS_RFC2822 |
RFC 2822 format, for E-mail and HTTP headers. More... | |
enum | TS_ISO_8601 |
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z. More... | |
enum | TS_EXIF |
An Exif timestamp (YYYY:MM:DD HH:MM:SS). More... | |
enum | TS_ORACLE |
Oracle format time. More... | |
enum | TS_POSTGRES |
Postgres format time. More... | |
enum | TS_DB2 |
DB2 format time. More... | |
Functions | |
wfArrayDiff2 ($a, $b) | |
Like array_diff( $a, $b ) except that it works with two-dimensional arrays. | |
wfArrayDiff2_cmp ($a, $b) | |
wfSeedRandom () | |
Seed Mersenne Twister No-op for compatibility; only necessary in PHP < 4.2.0. | |
wfRandom () | |
Get a random decimal value between 0 and 1, in a way not likely to give duplicate values for any realistic number of articles. | |
wfUrlencode ($s) | |
We want some things to be included as literal characters in our title URLs for prettiness, which urlencode encodes by default. | |
wfDebug ($text, $logonly=false) | |
Sends a line to the debug log if enabled or, optionally, to a comment in output. | |
wfDebugTimer () | |
wfDebugMem ($exact=false) | |
Send a line giving PHP memory usage. | |
wfDebugLog ($logGroup, $text, $public=true) | |
Send a line to a supplementary debug log file, if configured, or main debug log if not. | |
wfLogDBError ($text) | |
Log for database errors. | |
wfErrorLog ($text, $file) | |
Log to a file without getting "file size exceeded" signals. | |
wfLogProfilingData () | |
wfReadOnly () | |
Check if the wiki read-only lock file is present. | |
wfReadOnlyReason () | |
wfGetLangObj ($langcode=false) | |
Return a Language object from $langcode. | |
wfMsg ($key) | |
Get a message from anywhere, for the current user language. | |
wfMsgNoTrans ($key) | |
Same as above except doesn't transform the message. | |
wfMsgForContent ($key) | |
Get a message from anywhere, for the current global language set with $wgLanguageCode. | |
wfMsgForContentNoTrans ($key) | |
Same as above except doesn't transform the message. | |
wfMsgNoDB ($key) | |
Get a message from the language file, for the UI elements. | |
wfMsgNoDBForContent ($key) | |
Get a message from the language file, for the content. | |
wfMsgReal ($key, $args, $useDB=true, $forContent=false, $transform=true) | |
Really get a message. | |
wfMsgWeirdKey ($key) | |
This function provides the message source for messages to be edited which are *not* stored in the database. | |
wfMsgGetKey ($key, $useDB, $langCode=false, $transform=true) | |
Fetch a message string value, but don't replace any keys yet. | |
wfMsgReplaceArgs ($message, $args) | |
Replace message parameter keys on the given formatted output. | |
wfMsgHtml ($key) | |
Return an HTML-escaped version of a message. | |
wfMsgWikiHtml ($key) | |
Return an HTML version of message Parameter replacements, if any, are done *after* parsing the wiki-text message, so parameters may contain HTML (eg links or form controls). | |
wfMsgExt ($key, $options) | |
Returns message in the requested format. | |
wfAbruptExit ($error=false) | |
Just like exit() but makes a note of it. | |
wfErrorExit () | |
wfDie ($msg='') | |
Print a simple message and die, returning nonzero to the shell if any. | |
wfDebugDieBacktrace ($msg= '') | |
Throw a debugging exception. | |
wfHostname () | |
Fetch server name for use in error reporting etc. | |
wfReportTime () | |
Returns a HTML comment with the elapsed time since request. | |
wfDebugBacktrace () | |
Safety wrapper for debug_backtrace(). | |
wfBacktrace () | |
wfShowingResults ($offset, $limit) | |
wfShowingResultsNum ($offset, $limit, $num) | |
wfViewPrevNext ($offset, $limit, $link, $query= '', $atend=false) | |
Generate (prev x| next x) (20|50|100. | |
wfNumLink ($offset, $limit, $title, $query= '') | |
Generate links for (20|50|100. | |
wfClientAcceptsGzip () | |
wfCheckLimits ($deflimit=50, $optionname= 'rclimit') | |
Obtain the offset and limit values from the request string; used in special pages. | |
wfEscapeWikiText ($text) | |
Escapes the given text so that it may be output using addWikiText() without any linking, formatting, etc. | |
wfQuotedPrintable ($string, $charset= '') | |
wfTime () | |
wfSetVar (&$dest, $source) | |
Sets dest to source and returns the original value of dest If source is NULL, it just returns the value, it doesn't set the variable. | |
wfSetBit (&$dest, $bit, $state=true) | |
As for wfSetVar except setting a bit. | |
wfArrayToCGI ($array1, $array2=null) | |
This function takes two arrays as input, and returns a CGI-style string, e.g. | |
wfCgiToArray ($query) | |
This is the logical opposite of wfArrayToCGI(): it accepts a query string as its argument and returns the same string in array form. | |
wfAppendQuery ($url, $query) | |
Append a query string to an existing URL, which may or may not already have query string parameters already. | |
wfExpandUrl ($url) | |
Expand a potentially local URL to a fully-qualified URL. | |
wfPurgeSquidServers ($urlArr) | |
This is obsolete, use SquidUpdate::purge(). | |
wfEscapeShellArg () | |
Windows-compatible version of escapeshellarg() Windows doesn't recognise single-quotes in the shell, but the escapeshellarg() function puts single quotes in regardless of OS. | |
wfMerge ($old, $mine, $yours, &$result) | |
wfMerge attempts to merge differences between three texts. | |
wfDiff ($before, $after, $params= '-u') | |
Returns unified plain-text diff of two texts. | |
wfVarDump ($var) | |
A wrapper around the PHP function var_export(). | |
wfHttpError ($code, $label, $desc) | |
Provide a simple HTTP error. | |
wfResetOutputBuffers ($resetGzipEncoding=true) | |
Clear away any user-level output buffers, discarding contents. | |
wfClearOutputBuffers () | |
More legible than passing a 'false' parameter to wfResetOutputBuffers():. | |
wfAcceptToPrefs ($accept, $def= '*/*') | |
Converts an Accept-* header into an array mapping string values to quality factors. | |
mimeTypeMatch ($type, $avail) | |
Checks if a given MIME type matches any of the keys in the given array. | |
wfNegotiateType ($cprefs, $sprefs) | |
Returns the 'best' match between a client's requested internet media types and the server's list of available types. | |
wfArrayLookup ($a, $b) | |
Array lookup Returns an array where the values in the first array are replaced by the values in the second array with the corresponding keys. | |
wfTimestampNow () | |
Convenience function; returns MediaWiki timestamp for the present time. | |
wfSuppressWarnings ($end=false) | |
Reference-counted warning suppression. | |
wfRestoreWarnings () | |
Restore error level to previous value. | |
wfTimestamp ($outputtype=TS_UNIX, $ts=0) | |
wfTimestampOrNull ($outputtype=TS_UNIX, $ts=null) | |
Return a formatted timestamp, or null if input is null. | |
wfIsWindows () | |
Check if the operating system is Windows. | |
swap (&$x, &$y) | |
Swap two variables. | |
wfGetCachedNotice ($name) | |
wfGetNamespaceNotice () | |
wfGetSiteNotice () | |
& | wfGetMimeMagic () |
BC wrapper for MimeMagic::singleton(). | |
wfTempDir () | |
Tries to get the system directory for temporary files. | |
wfMkdirParents ($dir, $mode=null, $caller=null) | |
Make directory, and make all parent directories if they don't exist. | |
wfIncrStats ($key) | |
Increment a statistics counter. | |
wfPercent ($nr, $acc=2, $round=true) | |
wfEncryptPassword ($userid, $password) | |
Encrypt a username/password. | |
wfAppendToArrayIfNotDefault ($key, $value, $default, &$changed) | |
Appends to second array if $value differs from that in $default. | |
wfEmptyMsg ($msg, $wfMsgOut) | |
Since wfMsg() and co suck, they don't return false if the message key they looked up didn't exist but a XHTML string, this function checks for the nonexistance of messages by looking at wfMsg() output. | |
in_string ($needle, $str) | |
Find out whether or not a mixed variable exists in a string. | |
wfSpecialList ($page, $details) | |
wfUrlProtocols () | |
Returns a regular expression of url protocols. | |
wfIniGetBool ($setting) | |
Safety wrapper around ini_get() for boolean settings. | |
wfShellExec ($cmd, &$retval=null) | |
Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported. | |
wfInitShellLocale () | |
Workaround for http://bugs.php.net/bug.php?id=45132 escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale. | |
wfUsePHP ($req_ver) | |
This function works like "use VERSION" in Perl, the program will die with a backtrace if the current version of PHP is less than the version provided. | |
wfUseMW ($req_ver) | |
This function works like "use VERSION" in Perl except it checks the version of MediaWiki, the program will die with a backtrace if the current version of MediaWiki is less than the version provided. | |
wfRegexReplacement ($string) | |
wfBaseName ($path, $suffix='') | |
Return the final portion of a pathname. | |
wfRelativePath ($path, $from) | |
Generate a relative path name to the given file. | |
wfArrayMerge ($array1) | |
Backwards array plus for people who haven't bothered to read the PHP manual XXX: will not darn your socks for you. | |
wfMergeErrorArrays () | |
Merge arrays in the style of getUserPermissionsErrors, with duplicate removal e.g. | |
wfParseUrl ($url) | |
parse_url() work-alike, but non-broken. | |
wfMakeUrlIndex ($url) | |
Make a URL index, appropriate for the el_index field of externallinks. | |
wfDoUpdates () | |
Do any deferred updates and clear the list TODO: This could be in Wiki.php if that class made any sense at all. | |
wfExplodeMarkup ($separator, $text) | |
wfBaseConvert ($input, $sourceBase, $destBase, $pad=1, $lowercase=true) | |
Convert an arbitrarily-long digit string from one numeric base to another, optionally zero-padding to a minimum column width. | |
wfCreateObject ($name, $p) | |
Create an object with a given name and an array of construct parameters. | |
wfGetHTTP ($url) | |
Alias for modularized function. | |
wfIsLocalURL ($url) | |
Alias for modularized function. | |
wfHttpOnlySafe () | |
wfSetupSession () | |
Initialise php session. | |
wfGetPrecompiledData ($name) | |
Get an object from the precompiled serialized directory. | |
wfGetCaller ($level=2) | |
wfGetAllCallers () | |
Return a string consisting all callers in stack, somewhat useful sometimes for profiling specific points. | |
wfFormatStackFrame ($frame) | |
Return a string representation of frame. | |
wfMemcKey () | |
Get a cache key. | |
wfForeignMemcKey ($db, $prefix) | |
Get a cache key for a foreign DB. | |
wfWikiID () | |
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys. | |
wfSplitWikiID ($wiki) | |
Split a wiki ID into DB name and table prefix. | |
& | wfGetDB ($db, $groups=array(), $wiki=false) |
wfGetLB ($wiki=false) | |
Get a load balancer object. | |
& | wfGetLBFactory () |
Get the load balancer factory object. | |
wfFindFile ($title, $options=array()) | |
Find a file. | |
wfLocalFile ($title) | |
Get an object referring to a locally registered file. | |
wfQueriesMustScale () | |
Should low-performance queries be disabled? | |
wfScript ($script= 'index') | |
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScriptExtension etc. | |
wfGetScriptUrl () | |
Get the script url. | |
wfBoolToStr ($value) | |
Convenience function converts boolean values into "true" or "false" (string) values. | |
wfLoadExtensionMessages ($extensionName, $langcode=false) | |
Load an extension messages file. | |
wfGetNull () | |
Get a platform-independent path to the null file, e.g. | |
wfMaxlagError ($host, $lag, $maxLag) | |
Displays a maxlag error. | |
wfDeprecated ($function) | |
Throws a warning that $function is deprecated. | |
wfWarn ($msg, $callerOffset=1, $level=E_USER_NOTICE) | |
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings. | |
wfWaitForSlaves ($maxLag, $wiki=false) | |
Sleep until the worst slave's replication lag is less than or equal to $maxLag, in seconds. | |
wfOut ($s) | |
Output some plain text in command-line mode or in the installer (updaters.inc). | |
wfCountDown ($n) | |
Count down from $n to zero on the terminal, with a one-second pause between showing each number. | |
wfGenerateToken ($salt= '') | |
Generate a random 32-character hexadecimal token. | |
wfStripIllegalFilenameChars ($name) | |
Replace all invalid characters with -. | |
wfArrayInsertAfter ($array, $insert, $after) | |
Insert array into another array after the specified *KEY*. | |
wfObjectToArray ($object, $recursive=true) | |
wfMemoryLimit () | |
Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit;. | |
wfShorthandToInteger ($string= '') | |
Converts shorthand byte notation to integer form. | |
wfBCP47 ($code) | |
Variables | |
if (!defined( 'MEDIAWIKI')) | |
Global functions used everywhere. |
enum TS_DB |
enum TS_DB2 |
enum TS_EXIF |
An Exif timestamp (YYYY:MM:DD HH:MM:SS).
Definition at line 1896 of file GlobalFunctions.php.
enum TS_ISO_8601 |
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
This is used by Special:Export
Definition at line 1887 of file GlobalFunctions.php.
enum TS_MW |
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS).
Definition at line 1870 of file GlobalFunctions.php.
enum TS_ORACLE |
enum TS_POSTGRES |
enum TS_RFC2822 |
enum TS_UNIX |
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
Definition at line 1865 of file GlobalFunctions.php.
in_string | ( | $ | needle, | |
$ | str | |||
) |
Find out whether or not a mixed variable exists in a string.
$needle | String | |
$str | String |
Definition at line 2268 of file GlobalFunctions.php.
Referenced by Article::isCountable().
mimeTypeMatch | ( | $ | type, | |
$ | avail | |||
) | [private] |
Checks if a given MIME type matches any of the keys in the given array.
Basic wildcards are accepted in the array keys.
Returns the matching MIME type (or wildcard) if a match, otherwise NULL if no match.
$type | String | |
$avail | Array |
Definition at line 1747 of file GlobalFunctions.php.
Referenced by GlobalTest::testMimeTypeMatch(), and wfNegotiateType().
swap | ( | &$ | x, | |
&$ | y | |||
) |
wfAbruptExit | ( | $ | error = false |
) |
Just like exit() but makes a note of it.
Commits open transactions except if the error parameter is set
Definition at line 918 of file GlobalFunctions.php.
References $i, wfDebug(), wfDebugBacktrace(), wfGetLB(), and wfLogProfilingData().
Referenced by wfErrorExit().
wfAcceptToPrefs | ( | $ | accept, | |
$ | def = '*/*' | |||
) |
Converts an Accept-* header into an array mapping string values to quality factors.
Definition at line 1711 of file GlobalFunctions.php.
Referenced by RdfMetaData::setup().
wfAppendQuery | ( | $ | url, | |
$ | query | |||
) |
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.
$url | String | |
$query | Mixed: string or associative array |
Definition at line 1385 of file GlobalFunctions.php.
References $url, and wfArrayToCGI().
Referenced by OutputPage::addScriptFile(), FileRepo::getDescriptionRenderUrl(), Title::getFullURL(), Title::getLocalURL(), Linker::getUploadUrl(), Linker::link(), and Linker::makeThumbLink2().
wfAppendToArrayIfNotDefault | ( | $ | key, | |
$ | value, | |||
$ | default, | |||
&$ | changed | |||
) |
Appends to second array if $value differs from that in $default.
Definition at line 2239 of file GlobalFunctions.php.
References $changed.
Referenced by wfSpecialWatchlist().
wfArrayDiff2 | ( | $ | a, | |
$ | b | |||
) |
Like array_diff( $a, $b ) except that it works with two-dimensional arrays.
Definition at line 243 of file GlobalFunctions.php.
Referenced by Article::doRollback(), EditPage::getEditPermissionErrors(), and UploadBase::verifyPermissions().
wfArrayDiff2_cmp | ( | $ | a, | |
$ | b | |||
) |
Definition at line 246 of file GlobalFunctions.php.
wfArrayInsertAfter | ( | $ | array, | |
$ | insert, | |||
$ | after | |||
) |
Insert array into another array after the specified *KEY*.
$array | Array: The array. | |
$insert | Array: The array to insert. | |
$after | Mixed: The key to insert after |
Definition at line 3261 of file GlobalFunctions.php.
wfArrayLookup | ( | $ | a, | |
$ | b | |||
) |
Array lookup Returns an array where the values in the first array are replaced by the values in the second array with the corresponding keys.
Definition at line 1818 of file GlobalFunctions.php.
wfArrayMerge | ( | $ | array1 | ) |
Backwards array plus for people who haven't bothered to read the PHP manual XXX: will not darn your socks for you.
$array1 | Array | |
[$array2,[...]] | Arrays |
Definition at line 2543 of file GlobalFunctions.php.
References $out.
wfArrayToCGI | ( | $ | array1, | |
$ | array2 = null | |||
) |
This function takes two arrays as input, and returns a CGI-style string, e.g.
"days=7&limit=100". Options in the first array override options in the second. Options set to "" will not be output.
Definition at line 1317 of file GlobalFunctions.php.
Referenced by WebRequest::appendQueryArray(), QueryPage::doQuery(), HttpRequest::execute(), SpecialPage::executePath(), Title::getFullURL(), Title::getLocalURL(), ImageHandler::getScriptedTransform(), SkinTemplate::outputPage(), SpecialNewpages::setSyndicated(), SpecialContributions::setSyndicated(), setupUserCss(), SpecialSearch::showResults(), GlobalTest::testArrayToCGI(), wfAppendQuery(), and wfSpecialWatchlist().
wfBacktrace | ( | ) |
Definition at line 1053 of file GlobalFunctions.php.
References $msg, $wgCommandLineMode, and wfDebugBacktrace().
Referenced by ApiBase::debugPrint().
wfBaseConvert | ( | $ | input, | |
$ | sourceBase, | |||
$ | destBase, | |||
$ | pad = 1 , |
|||
$ | lowercase = true | |||
) |
Convert an arbitrarily-long digit string from one numeric base to another, optionally zero-padding to a minimum column width.
Supports base 2 through 36; digit values 10-36 are represented as lowercase letters a-z. Input is case-insensitive.
$input | String: of digits | |
$sourceBase | Integer: 2-36 | |
$destBase | Integer: 2-36 | |
$pad | Integer: 1 or greater | |
$lowercase | Boolean |
Definition at line 2696 of file GlobalFunctions.php.
References $i, $input, and $n.
Referenced by ApiQueryBlocks::execute(), ApiQueryImageInfo::getInfo(), ForeignAPIFile::getSha1(), Block::normaliseRange(), ApiQueryAllimages::run(), and File::sha1Base36().
wfBaseName | ( | $ | path, | |
$ | suffix = '' | |||
) |
Return the final portion of a pathname.
Reimplemented because PHP5's basename() is buggy with multibyte text. http://bugs.php.net/bug.php?id=33898
PHP's basename() only considers '\' a pathchar on Windows and Netware. We'll consider it so always, as we don't want in our Unix paths either.
$path | String | |
$suffix | String: to remove if present |
Definition at line 2478 of file GlobalFunctions.php.
References $path.
Referenced by Exif::__construct(), ImageBuilder::checkMissingImage(), GlobalTest::testBasename(), wfRelativePath(), and wfStripIllegalFilenameChars().
wfBCP47 | ( | $ | code | ) |
Definition at line 3344 of file GlobalFunctions.php.
References $code.
Referenced by Preferences::profilePreferences().
wfBoolToStr | ( | $ | value | ) |
Convenience function converts boolean values into "true" or "false" (string) values.
$value | Boolean |
Definition at line 3080 of file GlobalFunctions.php.
wfCgiToArray | ( | $ | query | ) |
This is the logical opposite of wfArrayToCGI(): it accepts a query string as its argument and returns the same string in array form.
This allows compa- tibility with legacy functions that accept raw query strings instead of nice arrays. Of course, keys and values are urldecode()d. Don't try passing in- valid query strings, or it will explode.
$query | String: query string |
Definition at line 1359 of file GlobalFunctions.php.
Referenced by Linker::makeBrokenLinkObj(), Linker::makeKnownLinkObj(), and Linker::makeLinkObj().
wfCheckLimits | ( | $ | deflimit = 50 , |
|
$ | optionname = 'rclimit' | |||
) |
Obtain the offset and limit values from the request string; used in special pages.
$deflimit | Default limit if none supplied | |
$optionname | Name of a user preference to check against |
Definition at line 1232 of file GlobalFunctions.php.
References $wgRequest.
Referenced by wfSpecialAncientpages(), wfSpecialBrokenRedirects(), wfSpecialDeadendpages(), wfSpecialDisambiguations(), wfSpecialDoubleRedirects(), wfSpecialFewestrevisions(), wfSpecialFileDuplicateSearch(), wfSpecialLinkSearch(), wfSpecialListredirects(), wfSpecialLonelypages(), wfSpecialLongpages(), wfSpecialMIMEsearch(), wfSpecialMostcategories(), wfSpecialMostimages(), wfSpecialMostlinked(), wfSpecialMostlinkedCategories(), wfSpecialMostlinkedtemplates(), wfSpecialMostrevisions(), wfSpecialPopularpages(), wfSpecialShortpages(), wfSpecialUncategorizedcategories(), wfSpecialUncategorizedimages(), wfSpecialUncategorizedpages(), wfSpecialUncategorizedtemplates(), wfSpecialUnusedCategories(), wfSpecialUnusedimages(), wfSpecialUnusedtemplates(), wfSpecialUnwatchedpages(), wfSpecialWantedCategories(), wfSpecialWantedFiles(), wfSpecialWantedpages(), wfSpecialWantedTemplates(), and wfSpecialWithoutinterwiki().
wfClearOutputBuffers | ( | ) |
More legible than passing a 'false' parameter to wfResetOutputBuffers():.
Clear away output buffers, but keep the Content-Encoding header produced by ob_gzhandler, if any.
This should be used for HTTP 304 responses, where you need to preserve the Content-Encoding header of the real result, but also need to suppress the output of ob_gzhandler to keep to spec and avoid breaking Firefox in rare cases where the headers and body are broken over two packets.
Definition at line 1703 of file GlobalFunctions.php.
References wfResetOutputBuffers().
Referenced by OutputPage::checkLastModified().
wfClientAcceptsGzip | ( | ) |
FIXME: we may want to blacklist some broken browsers
Definition at line 1207 of file GlobalFunctions.php.
References wfDebug().
Referenced by HTMLFileCache::loadFromFileCache(), HTMLFileCache::saveToFileCache(), and wfGzipHandler().
wfCountDown | ( | $ | n | ) |
Count down from $n to zero on the terminal, with a one-second pause between showing each number.
For use in command-line scripts.
Definition at line 3220 of file GlobalFunctions.php.
Referenced by userOptions::warn().
wfCreateObject | ( | $ | name, | |
$ | p | |||
) |
Create an object with a given name and an array of construct parameters.
$name | String | |
$p | Array: parameters |
Definition at line 2774 of file GlobalFunctions.php.
References $name.
Referenced by StubObject::_newObject(), and SpecialPage::getPage().
wfDebug | ( | $ | text, | |
$ | logonly = false | |||
) |
Sends a line to the debug log if enabled or, optionally, to a comment in output.
In normal operation this is a NOP.
Controlling globals: $wgDebugLogFile - points to the log file $wgProfileOnly - if set, normal debug messages will not be recorded. $wgDebugRawPage - if false, 'action=raw' hits will not result in debug output. $wgDebugComments - if on, some debug items may appear in comments in the HTML output.
$text | String | |
$logonly | Bool: set true to avoid appearing in HTML when $wgDebugComments is set |
Definition at line 331 of file GlobalFunctions.php.
References $wgDebugComments, $wgDebugLogFile, $wgDebugLogPrefix, $wgDebugRawPage, $wgOut, $wgProfileOnly, $wgShowDebug, StubObject::isRealObject(), wfDebugTimer(), and wfErrorLog().
Referenced by Parser::__construct(), MimeMagic::__construct(), LocalisationCache::__construct(), DifferenceEngine::__construct(), DBABagOStuff::__construct(), ApiMain::__construct(), MemCachedClientforWiki::_debugprint(), MathRenderer::_getHashPath(), StubUserLang::_newObject(), StubObject::_unstub(), LogPage::actionText(), EmailNotification::actuallyNotifyOnPageChange(), ImageGallery::add(), LoginForm::addNewAccountInternal(), LinkBatch::addObj(), LocalFileMoveBatch::addOlds(), Parser::addTrackingCategory(), afterContentHook(), LoginForm::attemptAutoCreate(), LoginForm::authenticateUserData(), AutoLoader::autoload(), Parser::braceSubstitution(), OutputPage::checkLastModified(), AjaxResponse::checkLastModified(), UploadBase::checkSvgScriptCallback(), LocalRepo::cleanupDeletedBatch(), UploadBase::cleanupTempFile(), Revision::compressRevisionText(), Article::confirmDelete(), DjVuImage::convertDumpToXML(), UploadBase::createFromRequest(), RecompressTracked::debug(), BaseDump::debug(), Profiler::debug(), WikiImporter::debug(), BagOStuff::debug(), DBABagOStuff::delete(), Block::deleteIfExpired(), User::deleteNewtalk(), MimeMagic::detectMimeType(), UploadBase::detectScript(), UploadBase::detectVirus(), MimeMagic::detectZipType(), WikiDiff3::diff(), Parser::disableCache(), Block::doAutoblock(), Article::doDeleteArticle(), Article::doEdit(), MimeMagic::doGuessMimeType(), WikiImporter::doImport(), ImagePage::doPurge(), DatabaseOracle::doQuery(), Block::doRetroactiveAutoblock(), UserrightsPage::doSaveUserGroups(), DjVuHandler::doTransform(), BitmapHandler::doTransform(), HTMLCacheUpdate::doUpdate(), LoadBalancer::doWait(), WikiRevision::downloadSource(), EditPage::edit(), Article::editUpdates(), SpecialUpload::execute(), CurlHttpRequest::execute(), LocalFileRestoreBatch::execute(), ChangesFeed::execute(), ExternalStoreDB::fetchBlob(), Article::fetchContent(), HTMLFileCache::fileCacheName(), WikiDiff3::find_middle_snake(), Parser::findColonNoLinks(), RepoGroup::findFile(), FSRepo::freeTemp(), ParserCache::get(), DBABagOStuff::get(), User::getBlockedStatus(), LoadBalancer::getConnection(), File::getDescriptionText(), ParserCache::getDirty(), WebRequest::getFileName(), DoubleRedirectJob::getFinalDestination(), MediaHandler::getHandler(), DjVuImage::getInfo(), Interwiki::getInterwikiCacheEntry(), DatabaseBase::getLag(), BacklinkCache::getLinks(), LoadBalancer::getMasterPos(), GIFHandler::getMetadata(), DjVuHandler::getMetadata(), DjVuHandler::getMetaTree(), DjVuImage::getMultiPageInfo(), DjVuImage::getPageInfo(), Article::getParserOutput(), EmailUserForm::getPermissionsError(), File::getPropsFromPath(), LoadBalancer::getRandomNonLagged(), DBABagOStuff::getReader(), LoadBalancer::getReaderIndex(), DatabaseBase::getSlavePos(), DisambiguationsPage::getSQL(), ForeignAPIRepo::getThumbUrl(), ForeignAPIRepo::getThumbUrlFromCache(), OutputPage::getTitle(), Parser::getUserSig(), Parser::getVariableValue(), File::getViewURL(), DBABagOStuff::getWriter(), MimeMagic::guessMimeType(), SqlBagOStuff::handleWriteError(), OutputPage::haveCacheVaryCookies(), MacBinary::hexdump(), SquidUpdate::HTCPPurge(), EditPage::importFormData(), WikiRevision::importLogItem(), WikiRevision::importOldRevision(), WikiRevision::importUpload(), User::inDnsBlacklist(), ChronologyProtector::initLB(), Block::insert(), HTMLCacheUpdate::insertJobsFromTitles(), ExternalStore::insertToDefault(), DatabaseIbm_db2::installPrint(), EditPage::internalAttemptSave(), User::isBlocked(), User::isBlockedFrom(), SvgHandler::isEnabled(), DjVuHandler::isEnabled(), LocalisationCache::isExpired(), FileDependency::isExpired(), Block::isExpired(), HTMLFileCache::isFileCacheGood(), BitmapHandler::isMetadataValid(), Title::isValidMoveTarget(), Block::isWhitelistedFromAutoblocks(), MessageCache::load(), Block::load(), SiteStats::loadAndLazyInit(), ChangesFeed::loadFromCache(), HTMLFileCache::loadFromFileCache(), User::loadFromId(), AjaxResponse::loadFromMemcached(), User::loadFromSession(), MacBinary::loadHeader(), User::loadOptions(), Revision::loadText(), DatabaseMysql::lock(), Linker::makeBrokenLink(), Linker::makeExternalImage(), Linker::makeExternalLink(), Linker::makeImageLink2(), Linker::makeKnownLink(), Linker::makeStubLink(), DatabaseBase::masterPosWait(), User::matchEditToken(), Skin::newFromKey(), ImportStreamSource::newFromURL(), DatabasePostgres::open(), DatabaseOracle::open(), DatabaseMysql::open(), DatabaseMssql::open(), CdbWriter::open(), CdbReader::open(), LoadBalancer::openConnection(), DatabaseSqlite::openFile(), LoadBalancer::openForeignConnection(), UploadDumper::outputItem(), SkinTemplate::outputPage(), SearchSqlite::parseQuery(), SearchPostgres::parseQuery(), SearchMySQL::parseQuery(), BacklinkCache::partition(), DiffHistoryBlob::patch(), AjaxDispatcher::performAction(), UploadBase::performUpload(), RemoteTestRecorder::ping(), DatabaseMysql::ping(), User::pingLimiter(), SpecialUpload::processUpload(), FSRepo::publishBatch(), DatabaseBase::query(), SvgHandler::rasterize(), TextPassDumper::readDump(), LoadBalancer::reallyOpenConnection(), LocalisationCache::recache(), EnhancedChangesList::recentChangesLine(), LocalFile::recordUpload2(), MathRenderer::render(), Article::replaceSection(), Parser::replaceVariables(), DatabasePostgres::reportQueryError(), DatabaseBase::reportQueryError(), Http::request(), MediaWiki::restInPeace(), DjVuImage::retrieveMetaData(), LoadBalancer::reuseConnection(), DoubleRedirectJob::run(), ParserCache::save(), HTMLFileCache::saveToFileCache(), MessageCache::saveToLocal(), MessageCache::saveToScript(), SearchPostgres::searchQuery(), SearchUpdate::SearchUpdate(), UserMailer::send(), OutputPage::sendCacheControl(), ApiMain::sendCacheHeaders(), RecentChange::sendToUDP(), UserMailer::sendWithPear(), DBABagOStuff::set(), ApiMain::setCacheMode(), MediaWikiParserTestSuite::setupUploadDir(), ParserTest::setupUploadDir(), ChronologyProtector::shutdown(), ChronologyProtector::shutdownLB(), LoadBalancer::sleep(), User::spreadBlock(), WikiImporter::throwXmlError(), MWTidy::tidy(), File::transform(), LocalisationCache_BulkLoad::trimCache(), RepoGroup::trimCache(), Article::tryDirtyCache(), Article::tryFileCache(), PageArchive::undelete(), PageArchive::undeleteRevisions(), Block::update(), User::updateNewtalk(), Article::updateRestrictions(), OldLocalFile::upgradeRow(), LocalFile::upgradeRow(), Revision::userCanBitfield(), LogEventsList::userCanBitfield(), EmailUserForm::validateEmailTarget(), ImageHandler::validateThumbParams(), UploadBase::verifyExtension(), UploadBase::verifyFile(), RawPage::view(), Article::view(), wfAbruptExit(), wfClientAcceptsGzip(), wfDebugBacktrace(), wfDebugLog(), wfDebugMem(), wfDiff(), wfGetCachedNotice(), wfGetIP(), wfGetLangObj(), wfMemoryLimit(), wfMerge(), wfMkdirParents(), wfShellExec(), wfSpecialUserlogout(), wfTimestamp(), wfWarn(), and WikiXmlError::WikiXmlError().
wfDebugBacktrace | ( | ) |
Safety wrapper for debug_backtrace().
With Zend Optimizer 3.2.0 loaded, this causes segfaults under somewhat murky circumstances, which may be triggered in part by stub objects or other fancy talkin'.
Will return an empty array if Zend Optimizer is detected or if debug_backtrace is disabled, otherwise the output from debug_backtrace() (trimmed).
Definition at line 1028 of file GlobalFunctions.php.
References wfDebug().
Referenced by Profiler::getCaller(), wfAbruptExit(), wfBacktrace(), wfGetAllCallers(), wfGetCaller(), and wfWarn().
wfDebugDieBacktrace | ( | $ | msg = '' |
) |
Throw a debugging exception.
This function previously once exited the process, but now throws an exception instead, with similar results.
$msg | String: message shown when dieing. |
Definition at line 967 of file GlobalFunctions.php.
References $msg.
Referenced by Language::checkTitleEncoding(), and ApiBase::dieDebug().
wfDebugLog | ( | $ | logGroup, | |
$ | text, | |||
$ | public = true | |||
) |
Send a line to a supplementary debug log file, if configured, or main debug log if not.
$wgDebugLogGroups[$logGroup] should be set to a filename to send to a separate log.
$logGroup | String | |
$text | String | |
$public | Bool: whether to log the event in the public log if no private log file is specified, (default true) |
Definition at line 410 of file GlobalFunctions.php.
References $wgDebugLogGroups, $wgShowHostnames, wfDebug(), wfErrorLog(), wfHostname(), wfTimestamp(), and wfWikiID().
Referenced by Exif::debug(), Exif::debugFile(), MediaWiki::doJobs(), DjVuHandler::doTransform(), BitmapHandler::doTransform(), CheckUsernames::execute(), LocalFileMoveBatch::execute(), ApiMain::executeActionWithErrorHandling(), ExternalStoreDB::fetchBlob(), LocalFileMoveBatch::getMoveTriplets(), Article::getOutputFromWikitext(), LoadBalancer::getReaderIndex(), ExternalStore::insertToDefault(), EditPage::internalAttemptSave(), User::isValidUserName(), MagicWord::load(), User::loadFromSession(), SquidPurgeClient::log(), LocalFile::move(), Preprocessor_Hash::preprocessToObj(), Preprocessor_DOM::preprocessToObj(), SvgHandler::rasterize(), MediaHandler::removeBadFile(), LocalFileMoveBatch::removeNonexistentFiles(), MWException::report(), SquidPurgeClientPool::run(), RunJobs::runJobsLog(), WebResponse::setcookie(), Article::tryDirtyCache(), wfForbidden(), wfSetupSession(), and wfShellExec().
wfDebugMem | ( | $ | exact = false |
) |
Send a line giving PHP memory usage.
$exact | Bool: print exact values instead of kilobytes (default: false) |
Definition at line 391 of file GlobalFunctions.php.
References wfDebug().
wfDebugTimer | ( | ) |
Definition at line 372 of file GlobalFunctions.php.
References $wgDebugTimestamps.
Referenced by wfDebug().
wfDeprecated | ( | $ | function | ) |
Throws a warning that $function is deprecated.
$function | String |
Definition at line 3128 of file GlobalFunctions.php.
References wfWarn().
Referenced by LogViewer::__construct(), LogReader::__construct(), Image::__construct(), MessageCache::addMessage(), MessageCache::addMessages(), MessageCache::addMessagesByLang(), OutputPage::addPrimaryWikiText(), OutputPage::addSecondaryWikiText(), SiteStats::admins(), dbsource(), MessageCache::disableTransform(), Linker::editSectionLink(), Linker::editSectionLinkForOther(), MessageCache::enableTransform(), OutputPage::errorpage(), OutputPage::fatalError(), OutputPage::fileCopyError(), OutputPage::fileDeleteError(), OutputPage::fileNotFoundError(), OutputPage::fileRenameError(), Article::getDB(), Language::getDefaultUserOptions(), Article::getRobotPolicyForView(), MessageCache::getTransform(), HTMLnamespaceselector(), Image::imageUrl(), User::isBot(), Linker::makeImage(), LinkFilter::makeLike(), Linker::makeStubLink(), Linker::makeStubLinkObj(), Image::newFromName(), Image::newFromTitle(), OutputPage::reportTime(), SpecialPage::restrictions(), User::setLoaded(), DatabaseBase::setOutputPage(), OutputPage::setParserOptions(), MessageCache::setTransform(), User::SetupSession(), Article::showArticle(), OutputPage::tryParserCache(), OutputPage::unexpectedValueError(), wfAttrib(), wfBuildForm(), wfCheck(), wfCheckLabel(), wfCloseElement(), wfElement(), wfElementClean(), wfEncryptPassword(), wfEscapeJsString(), wfGetHTTP(), wfHidden(), wfInput(), wfInputLabel(), wfIsLocalURL(), wfIsWellFormedXml(), wfIsWellFormedXmlFragment(), wfLabel(), wfOpenElement(), wfRadio(), wfRadioLabel(), wfSpan(), and wfSubmitButton().
wfDie | ( | $ | msg = '' |
) |
Print a simple message and die, returning nonzero to the shell if any.
Plain die() fails to return nonzero to the shell if you pass a string.
$msg | String |
Definition at line 956 of file GlobalFunctions.php.
References $msg.
Referenced by TestFileIterator::__construct(), ParserTest::addArticle(), TextPassDumper::dump(), getMediawikiMessages(), getRebuildInterwikiDump(), LanguageConverter::loadDefaultTables(), makeInterwikiSQL(), BackupDumper::processArgs(), TestFileIterator::readNextTest(), TestRecorder::report(), ParserTest::requireFunctionHook(), ParserTest::requireHook(), TestFileIterator::rewind(), and ParserUnitTest::run().
wfDiff | ( | $ | before, | |
$ | after, | |||
$ | params = '-u' | |||
) |
Returns unified plain-text diff of two texts.
Useful for machine processing of diffs.
$before | String: the text before the changes. | |
$after | String: the text after the changes. | |
$params | String: command-line options for the diff command. |
Definition at line 1547 of file GlobalFunctions.php.
References $wgDiff, wfDebug(), and wfTempDir().
Referenced by Parser_DiffTest::__call().
wfDoUpdates | ( | ) |
Do any deferred updates and clear the list TODO: This could be in Wiki.php if that class made any sense at all.
Definition at line 2662 of file GlobalFunctions.php.
References $wgDeferredUpdateList, and $wgPostCommitUpdateList.
Referenced by CleanupSpam::cleanupArticle(), Article::doEdit(), and HttpSessionDownload::execute().
wfEmptyMsg | ( | $ | msg, | |
$ | wfMsgOut | |||
) |
Since wfMsg() and co suck, they don't return false if the message key they looked up didn't exist but a XHTML string, this function checks for the nonexistance of messages by looking at wfMsg() output.
$msg | String: the message key looked up | |
$wfMsgOut | String: the output of wfMsg*() |
Definition at line 2257 of file GlobalFunctions.php.
Referenced by addToSidebar(), ProtectionForm::buildForm(), SpecialContributions::contributionsSub(), LanguageConverter::convertTitle(), MonoBookTemplate::customBox(), ModernTemplate::customBox(), ApiQueryTags::doTag(), SpecialTags::doTagRow(), EditPage::edit(), SpecialStatistics::execute(), SpecialListGroupRights::execute(), DeletedContributionsPage::execute(), SpecialContributions::execute(), ApiQueryAllmessages::execute(), LogPage::formatBlockFlag(), SpecialVersion::formatCredits(), SpecialStatistics::formatRow(), Preferences::generateSkinOptions(), Skin::generateUserJs(), RawPage::getArticleText(), EditPage::getContent(), Article::getContent(), Interwiki::getDescription(), FileRepo::getDisplayName(), UploadBase::getFilenamePrefixBlacklist(), SpecialContributions::getForm(), SpecialPage::getGroup(), User::getGroupMember(), User::getGroupName(), User::getGroupPage(), SpecialStatistics::getGroupStats(), Interwiki::getName(), ProtectionForm::getOptionLabel(), User::getRightDescription(), DeletedContributionsPage::getSubTitle(), SpecialUpload::getUploadForm(), LoginForm::makeLanguageSelector(), Licenses::msg(), SpecialRecentChanges::optionsPanel(), SpecialPage::outputHeader(), Parser::pstPass2(), VectorTemplate::renderPortals(), Article::setOldSubtitle(), Article::showNamespaceHeader(), EditPage::showTosSummary(), Parser::statelessFetchTemplate(), SkinTemplate::tabAction(), ChangeTags::tagDescription(), ImagePage::view(), wfGetCachedNotice(), and wfMsgWeirdKey().
wfEncryptPassword | ( | $ | userid, | |
$ | password | |||
) |
Encrypt a username/password.
$userid | Integer: ID of the user | |
$password | String: password of the user |
Definition at line 2230 of file GlobalFunctions.php.
References User::oldCrypt(), and wfDeprecated().
wfErrorExit | ( | ) |
Definition at line 947 of file GlobalFunctions.php.
References wfAbruptExit().
wfErrorLog | ( | $ | text, | |
$ | file | |||
) |
Log to a file without getting "file size exceeded" signals.
Can also log to TCP or UDP with the syntax udp://host:port/prefix. This will send lines to the specified port, prefixed by the specified prefix and a space.
Definition at line 446 of file GlobalFunctions.php.
References $size, IP::isIPv4(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by RecompressTracked::logToFile(), wfDebug(), wfDebugLog(), wfLogDBError(), and wfLogProfilingData().
wfEscapeShellArg | ( | ) |
Windows-compatible version of escapeshellarg() Windows doesn't recognise single-quotes in the shell, but the escapeshellarg() function puts single quotes in regardless of OS.
Also fixes the locale problems on Linux in PHP 5.2.6+ (bug backported to earlier distro releases of PHP)
Definition at line 1435 of file GlobalFunctions.php.
References wfInitShellLocale(), and wfIsWindows().
Referenced by CheckSyntax::buildFileList(), CheckSyntax::checkFileWithCli(), MimeMagic::detectMimeType(), UploadBase::detectVirus(), DjVuHandler::doTransform(), BitmapHandler::doTransform(), Dump7ZipOutput::Dump7ZipOutput(), DumpPipeOutput::DumpPipeOutput(), PopulateSha1::execute(), DifferenceEngine::generateDiffBody(), SvgHandler::rasterize(), readlineEmulation(), MathRenderer::render(), CheckStorage::restoreText(), DjVuImage::retrieveMetaData(), RecompressTracked::startSlaveProcs(), SevenZipStream::stream_open(), and wfMerge().
wfEscapeWikiText | ( | $ | text | ) |
Escapes the given text so that it may be output using addWikiText() without any linking, formatting, etc.
making its way through. This is achieved by substituting certain characters with HTML entities. As required by the callers, <nowiki> is not used. It currently does not filter out characters which have special meaning only at the start of a line, such as "*".
$text | String: text to be escaped |
Definition at line 1247 of file GlobalFunctions.php.
Referenced by Parser::braceSubstitution(), MergehistoryForm::execute(), SpecialSearch::formHeader(), CoreParserFunctions::fullpagename(), Parser::getUserSig(), Parser::getVariableValue(), ImagePage::openShowImage(), CoreParserFunctions::pagename(), SpecialSearch::showCreateLink(), UserrightsPage::showEditUserGroupsForm(), SpecialSearch::showResults(), EditPage::spamPage(), CoreParserFunctions::subjectpagename(), and CoreParserFunctions::talkpagename().
wfExpandUrl | ( | $ | url | ) |
Expand a potentially local URL to a fully-qualified URL.
Assumes $wgServer is correct. Also doesn't handle any type of relative URL except one starting with a single "/": this won't work with current-path-relative URLs like "subdir/foo.html", protocol-relative URLs like "//en.wikipedia.org/wiki/", etc. TODO: improve this!
$url | String: either fully-qualified or a local path + query |
Definition at line 1410 of file GlobalFunctions.php.
References $url, and $wgServer.
Referenced by FileRevertForm::execute(), File::getFullUrl(), ApiQueryImageInfo::getInfo(), User::getTokenUrl(), OutputPage::output(), ChannelFeed::outXmlHeader(), FileDeleteForm::prepareMessage(), and FileRevertForm::showForm().
wfExplodeMarkup | ( | $ | separator, | |
$ | text | |||
) |
wfFindFile | ( | $ | title, | |
$ | options = array() | |||
) |
Find a file.
Shortcut for RepoGroup::singleton()->findFile()
$title | Either a string or Title object | |
$options | Associative array of options: time: requested time for an archived image, or false for the current version. An image object will be returned which was created at the specified time. |
private: If true, return restricted (deleted) files if the current user is allowed to view them. Otherwise, such files will not be found.
bypassCache: If true, do not use the process-local cache of File objects
Definition at line 3012 of file GlobalFunctions.php.
References $options, $title, and RepoGroup::singleton().
Referenced by SearchResult::__construct(), SpecialUpload::ajaxGetExistsWarning(), ApiDelete::deleteFile(), MovePageForm::doSubmit(), DeleteBatch::execute(), ApiMove::execute(), CoreParserFunctions::filepath(), SearchEngine::getNearMatchInternal(), Image::imageUrl(), Title::isAlwaysKnown(), Title::isValidMoveOperation(), ImagePage::loadFile(), Linker::makeBrokenImageLinkObj(), Parser::makeImage(), Linker::makeImageLinkObj(), Linker::makeMediaLinkObj(), Linker::makeThumbLink2(), Image::newFromName(), Image::newFromTitle(), UploadDumper::outputItem(), pageTitleLinks(), ImageQueryPage::prepareImage(), SpecialSearch::showHit(), talkLink(), ImageGallery::toHTML(), wfAjaxGetFileUrl(), wfAjaxGetThumbnailUrl(), wfSpecialFileDuplicateSearch(), wfSpecialFilepath(), and XmlDumpWriter::writeUploads().
wfForeignMemcKey | ( | $ | db, | |
$ | prefix | |||
) |
Get a cache key for a foreign DB.
Definition at line 2922 of file GlobalFunctions.php.
Referenced by UserRightsProxy::invalidateCache().
wfFormatStackFrame | ( | $ | frame | ) |
Return a string representation of frame.
Definition at line 2903 of file GlobalFunctions.php.
Referenced by wfGetCaller().
wfGenerateToken | ( | $ | salt = '' |
) |
Generate a random 32-character hexadecimal token.
$salt | Mixed: some sort of salt, if necessary, to add to random characters before hashing. |
Definition at line 3238 of file GlobalFunctions.php.
Referenced by User::crypt().
wfGetAllCallers | ( | ) |
Return a string consisting all callers in stack, somewhat useful sometimes for profiling specific points.
Definition at line 2896 of file GlobalFunctions.php.
References wfDebugBacktrace().
wfGetCachedNotice | ( | $ | name | ) |
Definition at line 2020 of file GlobalFunctions.php.
References $fname, $name, $parserMemc, $wgOut, $wgRenderHashAppend, $wgSiteNotice, wfDebug(), wfEmptyMsg(), wfMemcKey(), wfMsgForContentNoTrans(), wfProfileIn(), and wfProfileOut().
Referenced by wfGetNamespaceNotice(), and wfGetSiteNotice().
wfGetCaller | ( | $ | level = 2 |
) |
Definition at line 2882 of file GlobalFunctions.php.
References wfDebugBacktrace(), and wfFormatStackFrame().
Referenced by StubObject::_unstub(), and Parser::parse().
& wfGetDB | ( | $ | db, | |
$ | groups = array() , |
|||
$ | wiki = false | |||
) |
Definition at line 2972 of file GlobalFunctions.php.
References wfGetLB().
Referenced by MergeHistoryPager::__construct(), ImageListPager::__construct(), DeletedContribsPager::__construct(), ContribsPager::__construct(), SiteStatsInit::__construct(), IndexPager::__construct(), MathRenderer::_recall(), OutputPage::addCategoryLinks(), User::addGroup(), LinkCache::addLinkObj(), LogPage::addRelations(), ChangeTags::addTags(), User::addToDatabase(), Article::addTrackbacks(), WatchedItem::addWatch(), Job::batchInsert(), SpecialRecentChanges::buildMainQueryConds(), MediaWiki_Setup::buildTestDatabase(), SiteStatsUpdate::cacheUpdate(), TitleListDependency::calculateTimestamps(), userOptions::CHANGER(), CheckStorage::check(), checkDupes(), SpecialRecentChanges::checkLastModified(), User::checkNewtalk(), Orphans::checkOrphans(), Orphans::checkSeparation(), RecompressTracked::checkTrackingTable(), Orphans::checkWidows(), CleanupSpam::cleanupArticle(), User::clearAllNotifications(), User::clearNotification(), WatchlistEditor::clearWatchlist(), CgzCopyTransaction::commit(), Article::commitRollback(), compressOldPages(), compressPage(), compressWithConcat(), convertLinks(), UpdateArticleCount::count(), Title::countRevisionsBetween(), WatchlistEditor::countWatchlist(), SearchEngine::create(), User::createNew(), dbsource(), Block::delete(), Article::delete(), RefreshLinks::deleteLinksFromNonexistent(), User::deleteNewtalk(), NukePage::deleteRevisions(), Title::deleteTitleProtection(), Article::deletetrackback(), FixSlaveDesync::desyncFixPage(), SiteStatsInit::doAllAndCommit(), RecompressTracked::doAllOrphans(), RecompressTracked::doAllPages(), Article::doCascadeProtectionUpdates(), CategoryViewer::doCategoryQuery(), DeleteOldRevisions::doDelete(), Article::doDeleteArticle(), WatchedItem::doDuplicateEntries(), Article::doEdit(), SpecialExport::doExport(), QueryPage::doFeed(), SpecialRecentchangeslinked::doMainQuery(), SpecialRecentChanges::doMainQuery(), RecompressTracked::doOrphanList(), RecompressTracked::doPage(), PopulateCategory::doPopulateCategory(), Article::doPurge(), QueryPage::doQuery(), LinkBatch::doQuery(), ReassignEdits::doReassignEdits(), RefreshLinks::doRefreshLinks(), Block::doRetroactiveAutoblock(), MovePageForm::doSubmit(), SiteStatsUpdate::doUpdate(), MediaWiki::doUpdates(), UpdateSearchIndex::doUpdateSearchIndex(), LinkHolderArray::doVariants(), User::edits(), Article::editUpdates(), Article::estimateRevisionCount(), UpdateSpecialPages::execute(), UpdateRestrictions::execute(), UpdateArticleCount::execute(), StorageTypeStats::execute(), OrphanStats::execute(), FixBug20757::execute(), DumpRev::execute(), SqliteMaintenance::execute(), MwSql::execute(), ShowStats::execute(), ShowJobs::execute(), RunJobs::execute(), RenameDbPrefix::execute(), RemoveUnusedAccounts::execute(), RefreshImageCount::execute(), RebuildTextIndex::execute(), RebuildFileCache::execute(), PopulateSha1::execute(), PopulateParentId::execute(), PopulateLogUsertext::execute(), PopulateLogSearch::execute(), PatchSql::execute(), NukePage::execute(), NukeNS::execute(), NamespaceConflictChecker::execute(), MoveBatch::execute(), MigrateUserGroup::execute(), InitEditCount::execute(), GetTextMaint::execute(), GetSlaveServer::execute(), GenerateSitemap::execute(), FixUserRegistration::execute(), FixTimestamps::execute(), FixSlaveDesync::execute(), FetchText::execute(), DumpSisterSites::execute(), DumpLinks::execute(), DeleteSelfExternals::execute(), DeleteRevision::execute(), DeleteOrphanedRevisions::execute(), DeleteImageCache::execute(), DeleteBatch::execute(), DeleteArchivedRevisions::execute(), DeleteArchivedFiles::execute(), ConvertUserOptions::execute(), ConvertLinks::execute(), ClearInterwikiCache::execute(), CleanupSpam::execute(), CheckUsernames::execute(), CheckImages::execute(), CheckBadRedirects::execute(), AttachLatest::execute(), UpdateLogging::execute(), AddWiki::execute(), SpecialTags::execute(), SpecialStatistics::execute(), ApiUndelete::execute(), ApiFeedWatchlist::execute(), Article::fetchContent(), UploadDumper::fetchLocal(), Revision::fetchRevision(), HistoryPage::fetchRevisions(), Parser::fetchScaryTemplateMaybeFromCache(), UploadDumper::fetchUsed(), TitleCleanup::fileExists(), TrackBlobs::findOrphanBlobs(), FixSlaveDesync::findPageLatestCorruption(), RecompressTracked::finishIncompleteMoves(), fixDupes(), RefreshLinks::fixLinksFromArticle(), RefreshLinks::fixRedirect(), DoubleRedirectJob::fixRedirects(), DoubleRedirectsPage::formatResult(), Article::generateReason(), LCStore_DB::get(), EditPage::getBaseRevision(), Title::getBrokenLinksFrom(), Title::getCascadeProtectionSources(), Article::getContributors(), Article::getCount(), RevDel_RevisionList::getCurrent(), AllmessagesTablePager::getCustomisedStatuses(), UserRightsProxy::getDB(), SqlBagOStuff::getDB(), BacklinkCache::getDB(), Article::getDB(), ApiQuery::getDB(), Block::getDBOptions(), Title::getEarliestRevTime(), DoubleRedirectJob::getFinalDestination(), User::getFirstEditTimestamp(), Title::getFirstRevision(), Article::getHiddenCategories(), DeleteImageCache::getImageCount(), EditPage::getLastDelete(), Article::getLastNAuthors(), PageArchive::getLastRevisionText(), Title::getLatestRevID(), SpecialExport::getLinks(), Title::getLinksTo(), File::getLinksTo(), LocalRepo::getMasterDB(), ForeignDBViaLBRepo::getMasterDB(), User::getMaxID(), Category::getMembers(), SpecialStatistics::getMostViewedPages(), ApiQuery::getNamedDB(), Title::getNextRevisionID(), Title::getNotificationTimestamp(), SpecialExport::getPagesFromCategory(), SpecialExport::getPagesFromNamespace(), Title::getParentCategories(), nextJobDB::getPendingDbs(), PageArchive::getPreviousRevision(), Title::getPreviousRevisionID(), UsersPager::getQueryInfo(), ImageListPager::getQueryInfo(), ActiveUsersPager::getQueryInfo(), Title::getRedirectsHere(), Article::getRedirectTarget(), PageArchive::getRevision(), Parser::getRevisionTimestamp(), FixBug20757::getRevTextMap(), RollbackEdits::getRollbackTitles(), LocalRepo::getSlaveDB(), ForeignDBViaLBRepo::getSlaveDB(), WithoutInterwikiPage::getSQL(), WantedTemplatesPage::getSQL(), WantedPagesPage::getSQL(), WantedFilesPage::getSQL(), WantedCategoriesPage::getSQL(), UnwatchedpagesPage::getSQL(), UnusedtemplatesPage::getSQL(), UnusedimagesPage::getSQL(), UnusedCategoriesPage::getSQL(), UncategorizedPagesPage::getSQL(), UncategorizedImagesPage::getSQL(), ShortPagesPage::getSQL(), PopularPagesPage::getSQL(), MostrevisionsPage::getSQL(), SpecialMostlinkedtemplates::getSql(), MostlinkedCategoriesPage::getSQL(), MostlinkedPage::getSQL(), MostimagesPage::getSQL(), MostcategoriesPage::getSQL(), MIMEsearchPage::getSQL(), LonelyPagesPage::getSQL(), ListredirectsPage::getSQL(), LinkSearchPage::getSQL(), FileDuplicateSearchPage::getSQL(), FewestrevisionsPage::getSql(), DoubleRedirectsPage::getSQL(), DisambiguationsPage::getSQL(), DeadendPagesPage::getSQL(), BrokenRedirectsPage::getSQL(), AncientPagesPage::getSQL(), Title::getSubpages(), HistoryBlobCurStub::getText(), HistoryBlobStub::getText(), TrackBlobs::getTextClause(), PageArchive::getTextFromRow(), Revision::getTimestampFromId(), Revision::getTitle(), Title::getTitleProtection(), Title::getTouched(), Article::getUsedTemplates(), WatchlistEditor::getWatchlist(), WatchlistEditor::getWatchlistInfo(), BackupReader::handleUpload(), User::idForName(), User::idFromName(), ImagePage::imageLinks(), WikiImporter::importLogItem(), WikiRevision::importLogItem(), WikiRevision::importOldRevision(), CheckStorage::importRevision(), WikiImporter::importRevision(), User::incEditCount(), Article::incViewCount(), Article::info(), Category::initialize(), MediaWiki::initializeArticle(), BackupDumper::initProgress(), TrackBlobs::initTrackingTable(), Job::insert(), Block::insert(), Job::insertFields(), Article::insertNewArticle(), Article::insertRedirect(), User::invalidateCache(), Title::invalidateCache(), HTMLCacheUpdate::invalidateTitles(), Title::isDeleted(), PageArchive::isDeleted(), Title::isDeletedQuick(), RemoveUnusedAccounts::isInactiveAccount(), Title::isNewPage(), Title::isSingleRevRedirect(), Revision::isUnpatrolled(), Title::isValidMoveTarget(), WatchedItem::isWatched(), SiteStats::jobs(), ImageCleanup::killRow(), LinksUpdate::LinksUpdate(), ExternalUser::linkToLocal(), PageArchive::listAllPages(), ChangeTags::listDefinedTags(), PageArchive::listFiles(), PageArchive::listPagesByPrefix(), PageArchive::listRevisions(), SiteStats::load(), Interwiki::load(), ArchivedFile::load(), SiteStats::loadAndLazyInit(), User::loadFromDatabase(), MessageCache::loadFromDB(), User::loadGroups(), Article::loadLastEdit(), User::loadOptions(), Article::loadPageData(), Title::loadRestrictions(), Title::loadRestrictionsFromResultWrapper(), Title::loadRestrictionsFromRows(), Revision::loadText(), Profiler::logToDB(), LinkFilter::makeLike(), LinkFilter::makeLikeArray(), makeLink(), Article::markpatrolled(), MergehistoryForm::merge(), EditPage::mergeChangesInto(), SearchMySQL::minSearchLength(), TitleCleanup::moveIllegalPage(), TitleCleanup::moveInconsistentPage(), Title::moveOverExistingRedirect(), RecompressTracked::moveTextRow(), Title::moveTo(), moveToExternal(), Title::moveToNewTitle(), Title::nameOf(), Revision::newFromConds(), RecentChange::newFromConds(), User::newFromConfirmationCode(), Title::newFromID(), RecentChange::newFromId(), Block::newFromID(), UserArray::newFromIDs(), Title::newFromIDs(), SquidUpdate::newFromLinksTo(), Revision::newFromTitle(), ExternalUser::newFromUser(), EmailNotification::notifyOnPageChange(), SiteStats::numberingroup(), SkinTemplate::outputPage(), Article::pageCountInfo(), SiteStats::pagesInNs(), pageStats(), ImageCleanup::pokeFile(), Job::pop(), Job::pop_type(), populateCategory(), Block::purgeExpired(), Title::purgeExpiredRestrictions(), PurgeRedundantText(), Maintenance::purgeRedundantText(), Article::quickEdit(), DeleteDefaultMessages::reallyExecute(), RecentChange::reallyMarkPatrolled(), RebuildRecentchanges::rebuildRecentChangesTablePass1(), RebuildRecentchanges::rebuildRecentChangesTablePass2(), RebuildRecentchanges::rebuildRecentChangesTablePass3(), RebuildRecentchanges::rebuildRecentChangesTablePass4(), QueryPage::recache(), SiteStatsInit::refresh(), Category::refreshCounts(), RevDel_List::reloadFromMaster(), User::removeGroup(), WatchlistCleanup::removeWatch(), WatchedItem::removeWatch(), MathRenderer::render(), LinkHolderArray::replaceInternal(), Article::replaceSection(), ImportReporter::reportPage(), RevDel_List::reset(), resolveStub(), resolveStubs(), CheckStorage::restoreText(), TableCleanup::runTable(), RecentChange::save(), LogPage::saveContent(), User::saveOptions(), User::saveSettings(), RandomPage::selectRandomPageFromDB(), RevDel_LogItem::setBits(), RevDel_ArchivedFileItem::setBits(), RevDel_FileItem::setBits(), RevDel_ArchiveItem::setBits(), RevDel_RevisionItem::setBits(), DatabaseTest::setUp(), ParserTest::setupDatabase(), IPBlockForm::setUsernameBitfields(), RevDel_List::setVisibility(), SpecialAllpages::showChunk(), DifferenceEngine::showDiffPage(), MovePageForm::showForm(), SpecialWhatLinksHere::showIndirectLinks(), IPUnblockForm::showList(), SpecialPrefixindex::showPrefixChunk(), SpecialAllpages::showToplevel(), SpecialVersion::softwareInformation(), LCStore_DB::startWrite(), RecompressTracked::syncDBs(), TrackBlobs::trackOrphanText(), TrackBlobs::trackRevisions(), PageArchive::undeleteRevisions(), WatchlistEditor::unwatchTitles(), SiteStatsInit::update(), SearchSqlite::update(), SearchOracle::update(), SearchMySQL::update(), SearchIBM_DB2::update(), Block::update(), update_row_exists(), Article::updateArticle(), Article::updateCategoryCounts(), User::updateNewtalk(), Article::updateRestrictions(), Block::updateTimestamp(), SearchSqlite::updateTitle(), SearchOracle::updateTitle(), SearchMySQL::updateTitle(), SearchIBM_DB2::updateTitle(), Title::updateTitleProtection(), userOptions::USAGER(), EditPage::userWasLastToEdit(), WatchlistEditor::watchTitles(), SpecialRecentChanges::webOutput(), wfAffectedRows(), wfAjaxWatch(), wfDataSeek(), wfFetchObject(), wfFetchRow(), wfFieldExists(), wfFieldName(), wfFreeResult(), wfGetArray(), wfGetSQL(), wfIgnoreSQLErrors(), wfIndexExists(), wfInsertArray(), wfInsertId(), wfLastDBquery(), wfLastErrno(), wfLastError(), wfNextSequenceValue(), wfNumFields(), wfNumRows(), wfQuery(), wfSetSQL(), wfSingleQuery(), wfSpecialFileDuplicateSearch(), wfSpecialNewimages(), wfSpecialWatchlist(), wfStrencode(), wfTableName(), wfUpdateArray(), wfUseIndexClause(), User::whoIs(), User::whoIsReal(), and wlCountItems().
wfGetHTTP | ( | $ | url | ) |
Alias for modularized function.
Definition at line 2800 of file GlobalFunctions.php.
References $url, Http::get(), and wfDeprecated().
wfGetLangObj | ( | $ | langcode = false |
) |
Return a Language object from $langcode.
$langcode | Mixed: either:
|
Definition at line 569 of file GlobalFunctions.php.
References $wgContLang, $wgLang, Language::factory(), Language::getLanguageNames(), and wfDebug().
Referenced by SpecialAllmessages::execute(), MessageCache::get(), EditPage::getPreviewText(), wfMsgExt(), and wfMsgGetKey().
wfGetLB | ( | $ | wiki = false |
) |
Get a load balancer object.
$wiki | String: wiki ID, or false for the current wiki |
Definition at line 2982 of file GlobalFunctions.php.
References wfGetLBFactory().
Referenced by ApiQuerySiteinfo::appendDbReplLagInfo(), MediaWiki::checkMaxLag(), UpdateSpecialPages::execute(), DatabaseLag::execute(), GetSlaveServer::execute(), GetLagTimes::execute(), FixSlaveDesync::execute(), ApiMain::executeAction(), nextJobDB::getPendingDbs(), Revision::getTimestampFromId(), lastModified(), Revision::loadText(), Revision::newFromConds(), Revision::newFromTitle(), ParserTest::setupDatabase(), SearchMySQLTest::tearDown(), RecompressTracked::waitForSlaves(), wfAbruptExit(), wfGetDB(), and wfWaitForSlaves().
& wfGetLBFactory | ( | ) |
Get the load balancer factory object.
Definition at line 2989 of file GlobalFunctions.php.
References LBFactory::singleton().
Referenced by DbTestPreviewer::__construct(), BackupDumper::backupDb(), ParserTest::changePrefix(), RefreshLinks::deleteLinksFromNonexistent(), SpecialExport::doExport(), HttpSessionDownload::execute(), MediaWiki::finalCleanup(), TrackBlobs::findOrphanBlobs(), OrphanStats::getDB(), SqlBagOStuff::getDB(), RecompressTracked::getExtDB(), ExternalStoreDB::getLoadBalancer(), ForkController::prepareEnvironment(), MediaWiki::restInPeace(), and wfGetLB().
& wfGetMimeMagic | ( | ) |
BC wrapper for MimeMagic::singleton().
Definition at line 2124 of file GlobalFunctions.php.
References MimeMagic::singleton().
wfGetNamespaceNotice | ( | ) |
Definition at line 2071 of file GlobalFunctions.php.
References $fname, $wgTitle, wfGetCachedNotice(), wfProfileIn(), and wfProfileOut().
wfGetNull | ( | ) |
Get a platform-independent path to the null file, e.g.
/dev/null
Definition at line 3097 of file GlobalFunctions.php.
References wfIsWindows().
Referenced by Dump7ZipOutput::Dump7ZipOutput(), MWTidy::execExternalTidy(), and wfProxyCheck().
wfGetPrecompiledData | ( | $ | name | ) |
Get an object from the precompiled serialized directory.
Definition at line 2869 of file GlobalFunctions.php.
Referenced by Language::getCaseMaps(), and Language::transformUsingPairFile().
wfGetScriptUrl | ( | ) |
wfGetSiteNotice | ( | ) |
Definition at line 2093 of file GlobalFunctions.php.
References $fname, $wgSiteNotice, $wgUser, wfGetCachedNotice(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by SkinNostalgia::doBeforeContent(), SkinCologneBlue::doBeforeContent(), doBeforeContent(), and SkinTemplate::outputPage().
wfHostname | ( | ) |
Fetch server name for use in error reporting etc.
Use real server name if available, so we know which machine in a server farm generated the current page.
Definition at line 977 of file GlobalFunctions.php.
Referenced by DifferenceEngine::debug(), DjVuHandler::doTransform(), BitmapHandler::doTransform(), Profiler::logToDB(), RecompressTracked::logToFile(), DatabaseMysql::open(), DatabaseMssql::open(), LoadBalancer::openForeignConnection(), SvgHandler::rasterize(), wfDebugLog(), wfReportTime(), and wfThumbError().
wfHttpError | ( | $ | code, | |
$ | label, | |||
$ | desc | |||
) |
Provide a simple HTTP error.
Definition at line 1624 of file GlobalFunctions.php.
Referenced by FeedUtils::checkFeedOutput(), MediaWiki::handleSpecialCases(), MediaWiki::performAction(), AjaxDispatcher::performAction(), RdfMetaData::setup(), RawPage::view(), and wfSpecialUserlogout().
wfHttpOnlySafe | ( | ) |
Definition at line 2814 of file GlobalFunctions.php.
References $wgHttpOnlyBlacklist.
Referenced by WebResponse::setcookie(), and wfSetupSession().
wfIncrStats | ( | $ | key | ) |
Increment a statistics counter.
Definition at line 2187 of file GlobalFunctions.php.
References $wgDBname, $wgMemc, $wgStatsMethod, $wgUDPProfilerHost, $wgUDPProfilerPort, and wfMemcKey().
Referenced by OutputPage::addWikiTextTitle(), ParserCache::get(), DifferenceEngine::getDiffBody(), LoadMonitor_MySQL::getLagTimes(), Article::getParserOutput(), and Article::view().
wfIniGetBool | ( | $ | setting | ) |
Safety wrapper around ini_get() for boolean settings.
The values returned from ini_get() are pre-normalized for settings set via php.ini or php_flag/php_admin_flag... but *not* for those set via php_value/php_admin_value.
It's fairly common for people to use php_value instead of php_flag, which can leave you with an 'off' setting giving a false positive for code that just takes the ini_get() return value as a boolean.
To make things extra interesting, setting via php_value accepts "true" and "yes" as true, but php.ini and php_flag consider them false. :) Unrecognized values go false... again opposite PHP's own coercion from string to bool.
Luckily, 'properly' set settings will always come back as '0' or '1', so we only have to worry about them and the 'improper' settings.
I frickin' hate PHP... :P
$setting | String |
Definition at line 2327 of file GlobalFunctions.php.
Referenced by HttpRequest::factory(), UploadBase::isEnabled(), mw_have_dl(), HttpTest::setup(), wfInitShellLocale(), and wfShellExec().
wfInitShellLocale | ( | ) |
Workaround for http://bugs.php.net/bug.php?id=45132 escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale.
Definition at line 2406 of file GlobalFunctions.php.
References $wgShellLocale, and wfIniGetBool().
Referenced by wfEscapeShellArg(), and wfShellExec().
wfIsLocalURL | ( | $ | url | ) |
Alias for modularized function.
Definition at line 2809 of file GlobalFunctions.php.
References $url, Http::isLocalURL(), and wfDeprecated().
wfIsWindows | ( | ) |
Check if the operating system is Windows.
Definition at line 2003 of file GlobalFunctions.php.
Referenced by CdbWriter_PHP::close(), CdbWriter_DBA::close(), BitmapHandler::escapeMagickPath(), RebuildLocalisationCache::execute(), findExecutable(), getVars(), ParserTest::ParserTest(), readlineEmulation(), MathRenderer::render(), UserMailer::send(), FSRepo::storeBatch(), SevenZipStream::stream_open(), MailAddress::toString(), FileRepo::validateFilename(), wfEscapeShellArg(), and wfGetNull().
wfLoadExtensionMessages | ( | $ | extensionName, | |
$ | langcode = false | |||
) |
wfLocalFile | ( | $ | title | ) |
Get an object referring to a locally registered file.
Returns a valid placeholder object if the file does not exist.
$title | Either a string or Title object |
Definition at line 3022 of file GlobalFunctions.php.
References $title, and RepoGroup::singleton().
Referenced by ImageBuilder::addMissingImage(), SpecialUpload::ajaxGetExistsWarning(), RevDel_FileList::doPostCommitUpdates(), MovePageForm::doSubmit(), ExternalEdit::edit(), PopulateSha1::execute(), ImageListPager::formatValue(), UploadBase::getLocalFile(), SpecialUpload::getWatchCheck(), Image::imageUrl(), WikiRevision::importUpload(), Title::isValidMoveOperation(), Title::isValidMoveTarget(), ImagePage::loadFile(), Title::moveTo(), Image::newFromName(), Image::newFromTitle(), PageArchive::undelete(), and wfThumbMain().
wfLogDBError | ( | $ | text | ) |
Log for database errors.
$text | String: database error message. |
Definition at line 431 of file GlobalFunctions.php.
References $wgDBerrorLog, $wgDBname, and wfErrorLog().
Referenced by DatabaseMysql::open(), DatabaseMssql::open(), DatabaseBase::query(), LoadBalancer::reportConnectionError(), and DatabaseBase::reportQueryError().
wfLogProfilingData | ( | ) |
Definition at line 495 of file GlobalFunctions.php.
References $wgDebugLogFile, $wgDebugRawPage, $wgProfileLimit, $wgRequest, $wgRequestTime, $wgUser, StubObject::isRealObject(), wfErrorLog(), wfGetProfilingOutput(), and wfTime().
Referenced by PPFuzzTester::execute(), HttpSessionDownload::execute(), MediaWiki::restInPeace(), wfAbruptExit(), wfExceptionHandler(), and wfForbidden().
wfMakeUrlIndex | ( | $ | url | ) |
Make a URL index, appropriate for the el_index field of externallinks.
Definition at line 2621 of file GlobalFunctions.php.
References $url, and wfParseUrl().
Referenced by LinksUpdate::getExternalInsertions().
wfMaxlagError | ( | $ | host, | |
$ | lag, | |||
$ | maxLag | |||
) |
Displays a maxlag error.
$host | String: server that lags the most | |
$lag | Integer: maxlag (actual) | |
$maxLag | Integer: maxlag (requested) |
Definition at line 3110 of file GlobalFunctions.php.
References $maxLag, and $wgShowHostnames.
Referenced by MediaWiki::checkMaxLag().
wfMemcKey | ( | ) |
Get a cache key.
Definition at line 2912 of file GlobalFunctions.php.
References wfWikiID().
Referenced by LanguageConverter::__construct(), LoginForm::addNewAccountInternal(), LoginForm::authenticateUserData(), buildSidebar(), MessageCache::clear(), User::clearSharedCache(), CacheStats::execute(), DeleteImageCache::execute(), SpecialStatistics::execute(), ChangesFeed::execute(), DifferenceEngine::getDiffBody(), DateFormatter::getInstance(), Interwiki::getInterwikiCacheEntry(), ParserCache::getKey(), LoadMonitor_MySQL::getLagTimes(), MessageCache::getMsgFromNamespace(), User::getNewtalk(), Block::isWhitelistedFromAutoblocks(), ChangeTags::listDefinedTags(), MessageCache::load(), Interwiki::load(), User::loadFromId(), Revision::loadText(), ApiMain::makeHelpMsg(), memsess_key(), SiteStats::numberingroup(), BacklinkCache::partition(), User::pingLimiter(), Preprocessor_Hash::preprocessToObj(), Preprocessor_DOM::preprocessToObj(), LoginForm::processLogin(), RebuildRecentchanges::purgeFeeds(), MessageCache::replace(), User::saveToCache(), MessageCache::saveToCaches(), User::setNewtalk(), SpecialAllpages::showToplevel(), wfGetCachedNotice(), wfIncrStats(), and wfProxyCheck().
wfMemoryLimit | ( | ) |
Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit;.
Definition at line 3296 of file GlobalFunctions.php.
References $wgMemoryLimit, wfDebug(), wfRestoreWarnings(), wfShorthandToInteger(), and wfSuppressWarnings().
wfMerge | ( | $ | old, | |
$ | mine, | |||
$ | yours, | |||
&$ | result | |||
) |
wfMerge attempts to merge differences between three texts.
Returns true for a clean merge and false for failure or a conflict.
Definition at line 1483 of file GlobalFunctions.php.
References $result, $wgDiff3, wfDebug(), wfEscapeShellArg(), and wfTempDir().
Referenced by Article::getUndoText(), and EditPage::mergeChangesInto().
wfMergeErrorArrays | ( | ) |
Merge arrays in the style of getUserPermissionsErrors, with duplicate removal e.g.
wfMergeErrorArrays( array( array( 'x' ) ), array( array( 'x', '2' ) ), array( array( 'x' ) ), array( array( 'y') ) ); returns: array( array( 'x', '2' ), array( 'x' ), array( 'y' ) )
Definition at line 2569 of file GlobalFunctions.php.
References $out.
Referenced by SpecialImport::execute(), and Title::isValidMoveOperation().
wfMkdirParents | ( | $ | dir, | |
$ | mode = null , |
|||
$ | caller = null | |||
) |
Make directory, and make all parent directories if they don't exist.
$dir | String: full path to directory to create | |
$mode | Integer: chmod value to use, default is $wgDirectoryMode | |
$caller | String: optional caller param for debugging. |
Definition at line 2161 of file GlobalFunctions.php.
References $mode, $ok, $wgDirectoryMode, and wfDebug().
Referenced by MathRenderer::_recall(), HTMLFileCache::checkCacheDirs(), FSRepo::deleteBatch(), SvgHandler::doTransform(), DjVuHandler::doTransform(), BitmapHandler::doTransform(), ForeignAPIRepo::getThumbUrlFromCache(), GenerateSitemap::init_path(), ImageCleanup::pokeFile(), FSRepo::publishBatch(), MathRenderer::render(), MessageCache::saveToLocal(), MessageCache::saveToScript(), MediaWikiParserTestSuite::setupUploadDir(), ParserTest::setupUploadDir(), LCStore_CDB::startWrite(), and FSRepo::storeBatch().
wfMsg | ( | $ | key | ) |
Get a message from anywhere, for the current user language.
Use wfMsgForContent() instead if the message should NOT change depending on the user preferences.
$key | String: lookup key for the message, usually defined in languages/Language.php |
Definition at line 610 of file GlobalFunctions.php.
References wfMsgReal().
Referenced by UploadForm::__construct(), IPBlockForm::__construct(), AllmessagesTablePager::__construct(), TransformParameterError::__construct(), HTMLSelectOrOtherField::__construct(), ErrorPageError::__construct(), MathRenderer::_error(), LogPage::actionText(), MediaHandler::addMeta(), LoginForm::addNewAccountInternal(), LoginForm::addNewAccountMailPassword(), Article::addTrackbacks(), SpecialResetpass::attemptReset(), RdfMetaData::basics(), ImageHistoryList::beginImageHistoryList(), OutputPage::blockedPage(), SpecialRevisionDelete::buildCheckBoxes(), ProtectionForm::buildCleanupScript(), SkinTemplate::buildContentActionUrls(), Xml::buildForm(), SpecialAllmessages::buildForm(), ProtectionForm::buildForm(), SkinVector::buildNavigationUrls(), SkinTemplate::buildNavUrls(), SkinTemplate::buildPersonalUrls(), Linker::buildRollbackLink(), ChangeTags::buildTagFilterSelector(), SpecialRecentChanges::categoryFilterForm(), CleanupSpam::cleanupArticle(), commentLink(), EmailNotification::composeCommonMailtext(), Article::confirmDelete(), SpecialContributions::contributionsSub(), MonoBookTemplate::customBox(), ModernTemplate::customBox(), Xml::dateMenu(), CoreParserFunctions::defaultsort(), Article::delete(), deleteThisPage(), UploadBase::detectVirus(), LoginForm::displaySuccessfulLogin(), SkinCologneBlue::doAfterContent(), SkinCologneBlue::doBeforeContent(), Article::doDelete(), Linker::doEditSectionLink(), SpecialRecentChanges::doHeader(), SpecialRecentchangeslinked::doMainQuery(), DBUnlockForm::doSubmit(), MovePageForm::doSubmit(), DBLockForm::doSubmit(), EmailUserForm::doSubmit(), ApiQueryTags::doTag(), SvgHandler::doTransform(), DjVuHandler::doTransform(), BitmapHandler::doTransform(), EnhancedChangesList::downArrow(), Preferences::editingPreferences(), editThisPage(), emailUserLink(), MoveBatch::execute(), DumpMessages::execute(), CleanupSpam::execute(), WatchlistEditor::execute(), SpecialWhatLinksHere::execute(), UndeleteForm::execute(), SpecialTags::execute(), SpecialResetpass::execute(), SpecialPrefixindex::execute(), SpecialListGroupRights::execute(), FilepathForm::execute(), SpecialExport::execute(), SpecialContributions::execute(), SpecialAllpages::execute(), SpecialActiveUsers::execute(), FileDeleteForm::execute(), SpecialVersion::extensionCredits(), SpecialRevisionDelete::failure(), Parser::fetchScaryTemplateMaybeFromCache(), OutputPage::fileCopyError(), OutputPage::fileDeleteError(), OutputPage::fileNotFoundError(), OutputPage::fileRenameError(), SpecialNewpages::form(), LogPage::formatBlockFlag(), SpecialVersion::formatCredits(), FeedUtils::formatDiffRow(), UndeleteForm::formatFileRow(), MIMEsearchPage::formatResult(), DoubleRedirectsPage::formatResult(), DisambiguationsPage::formatResult(), BrokenRedirectsPage::formatResult(), ProtectedTitlesForm::formatRow(), ProtectedPagesForm::formatRow(), UsersPager::formatRow(), DeletedContribsPager::formatRow(), ContribsPager::formatRow(), Linker::formatTemplates(), Language::formatTimePeriod(), ImageListPager::formatValue(), SpecialSearch::formHeader(), Preferences::generateSkinOptions(), User::getBlockedStatus(), IPBlockForm::getBlockListLink(), ProtectedPagesForm::getCascadeCheck(), EditPage::getCheckboxes(), Credits::getContributors(), SpecialPage::getDescription(), ImageHandler::getDimensionsString(), FileRepo::getDisplayName(), EditPage::getEditButtons(), EditPage::getEditToolbar(), ProtectedPagesForm::getExpiryCheck(), LogEventsList::getExtraInputs(), SpecialRecentchangeslinked::getExtraOptions(), ImageListPager::getFieldNames(), AllmessagesTablePager::getFieldNames(), SpecialWhatLinksHere::getFilterPanel(), ImageListPager::getForm(), DeletedContributionsPage::getForm(), SpecialContributions::getForm(), FormatExif::getFormattedData(), Preferences::getFormObject(), SpecialPage::getGroup(), User::getGroupMember(), User::getGroupName(), SpecialStatistics::getGroupStats(), OutputPage::getHeadLinks(), RevDel_FileItem::getHTML(), CategoryViewer::getImageSection(), Preferences::getImageSizes(), Licenses::getInputHTML(), ProtectedTitlesForm::getLevelMenu(), ProtectedPagesForm::getLevelMenu(), ProtectedTitlesForm::getNamespaceMenu(), ProtectedPagesForm::getNamespaceMenu(), ProtectionForm::getOptionLabel(), WithoutInterwikiPage::getPageHeader(), UsersPager::getPageHeader(), ActiveUsersPager::getPageHeader(), CategoryViewer::getPagesSection(), MWException::getPageTitle(), EditPage::getPreviewText(), User::getRightDescription(), ProtectedPagesForm::getSizeLimit(), AllmessagesTablePager::getStartBody(), TablePager::getStartBody(), HistoryPager::getStartBody(), CategoryPager::getStartForm(), CategoryViewer::getSubcategorySection(), DeletedContributionsPage::getSubTitle(), DBQueryError::getText(), ImageHistoryList::getThumbForLine(), Preferences::getThumbSizes(), Preferences::getTimezoneOptions(), LogEventsList::getTitleInput(), LogEventsList::getTitlePattern(), ProtectedPagesForm::getTypeMenu(), IPBlockForm::getUnblockLink(), getUndeleteLink(), LogEventsList::getUserInput(), Title::getUserPermissionsErrors(), Title::getUserPermissionsErrorsInternal(), SpecialVersion::getVersion(), SpecialVersion::getVersionLinked(), UserrightsPage::groupCheckboxes(), OutputPage::headElement(), HistoryPage::history(), HistoryPager::historyLine(), ImagePage::imageDupes(), Article::info(), ChangesList::insertMove(), Parser::interwikiTransclude(), Xml::languageSelector(), lastModified(), Linker::linkAttribs(), DifferenceEngine::loadRevisionData(), OutputPage::loginToUse(), LogEventsList::logLine(), LogPage::logName(), logoText(), Parser::magicLinkCallback(), LoginForm::mailPassword(), LoginForm::mailPasswordInternal(), LoginForm::mainLoginForm(), mainPageLink(), PatrolLog::makeActionText(), SpecialBookSources::makeForm(), Skin::makeGlobalVariablesScript(), SpecialSearch::makeSearchLink(), Linker::makeThumbLink2(), Article::markpatrolled(), SpecialVersion::MediaWikiCredits(), SkinCologneBlue::menuHead(), Xml::monthSelector(), moveThisPage(), Licenses::msg(), FormatExif::msg(), nameAndLogin(), SpecialRecentChanges::namespaceFilterForm(), SpecialAllpages::namespaceForm(), SpecialPrefixindex::namespacePrefixForm(), SearchEngine::namespacesAsText(), Xml::namespaceSelector(), EditPage::noCreatePermission(), EditPage::noSuchSectionPage(), LoginForm::onCookieRedirectCheck(), ImagePage::openShowImage(), SpecialRecentChanges::optionsPanel(), otherLanguages(), OutputPage::output(), SkinTemplate::outputPage(), pageTitleLinks(), MediaWiki::performAction(), OutputPage::permissionRequired(), RdfMetaData::person(), SpecialSearch::powerSearchBox(), SpecialResetpass::pretty(), printableLink(), printSource(), LoginForm::processLogin(), Preferences::profilePreferences(), protectThisPage(), SkinStandard::quickBar(), SkinCologneBlue::quickBar(), OutputPage::rateLimited(), OutputPage::readOnlyPage(), EnhancedChangesList::recentChangesBlockGroup(), EnhancedChangesList::recentChangesLine(), Preferences::renderingPreferences(), VectorTemplate::renderPortals(), Article::rollback(), ProtectionForm::save(), SkinCologneBlue::searchForm(), IPUnblockForm::searchForm(), searchForm(), Preferences::searchPreferences(), User::sendConfirmationMail(), FileRevertForm::setHeaders(), FileDeleteForm::setHeaders(), EditPage::setHeaders(), Article::setOldSubtitle(), OutputPage::setPageTitle(), User::setPassword(), SpecialRecentchangeslinked::setTopText(), RdfMetaData::setup(), SpecialSearch::setupPage(), SpecialSearch::shortDialog(), ProtectionForm::show(), SpecialAllpages::showChunk(), EditPage::showConflict(), DifferenceEngine::showDiffPage(), EditPage::showEditForm(), UserrightsPage::showEditUserGroupsForm(), ImagePage::showError(), OutputPage::showErrorPage(), OutputPage::showFatalError(), UndeleteForm::showFileConfirmationForm(), OutputPage::showFileCopyError(), OutputPage::showFileDeleteError(), OutputPage::showFileNotFoundError(), OutputPage::showFileRenameError(), DifferenceEngine::showFirstRevision(), DBUnlockForm::showForm(), SpecialRevisionDelete::showForm(), SpecialResetpass::showForm(), MovePageForm::showForm(), DBLockForm::showForm(), IPUnblockForm::showForm(), SpecialImport::showForm(), EmailUserForm::showForm(), IPBlockForm::showForm(), FileRevertForm::showForm(), FileDeleteForm::showForm(), UndeleteForm::showHistory(), MergehistoryForm::showHistory(), SpecialSearch::showHit(), SpecialSearch::showInterwiki(), SpecialSearch::showInterwikiHit(), IPUnblockForm::showList(), MergehistoryForm::showMergeForm(), WatchlistEditor::showNormalForm(), ProtectedTitlesForm::showOptions(), ProtectedPagesForm::showOptions(), LogEventsList::showOptions(), Credits::showPage(), OutputPage::showPermissionsErrorPage(), WatchlistEditor::showRawForm(), SpecialUpload::showRecoverableUploadError(), EmailConfirmation::showRequestForm(), SpecialPreferences::showResetForm(), SpecialSearch::showResults(), UndeleteForm::showRevision(), UndeleteForm::showSearchForm(), EditPage::showStandardInputs(), DBUnlockForm::showSuccess(), DBLockForm::showSuccess(), EmailUserForm::showSuccess(), IPBlockForm::showSuccess(), EditPage::showTosSummary(), OutputPage::showUnexpectedValueError(), SpecialUpload::showUploadWarning(), EnhancedChangesList::sideArrow(), SpecialVersion::softwareInformation(), EditPage::spamPage(), Linker::specialLink(), specialPagesList(), SpecialRevisionDelete::success(), UserrightsPage::switchForm(), SkinCologneBlue::sysLinks(), SkinTemplate::tabAction(), CoreParserFunctions::tagObj(), talkLink(), Linker::tocList(), trackbackLink(), MediaWiki_I18N::translate(), Preferences::tryFormSubmit(), SpecialRevisionDelete::tryShowFile(), UndeleteForm::undelete(), OutputPage::unexpectedValueError(), Article::unwatch(), ImagePage::uploadLinksBox(), LoginForm::userBlockedMessage(), EditPage::userNotLoggedInPage(), LoginForm::userNotPrivilegedMessage(), Preferences::validateSignature(), OutputPage::versionRequired(), ImagePage::view(), Article::watch(), watchPageLinksLink(), watchThisPage(), wfForbidden(), wfSpecialBlockme(), wfSpecialEmailuser(), wfSpecialFileDuplicateSearch(), wfSpecialIpblocklist(), wfSpecialLinkSearch(), wfSpecialMIMEsearch(), wfSpecialNewimages(), wfSpecialUserlogout(), wfSpecialWatchlist(), wfThumbMain(), SpecialVersion::wgHooks(), and SpecialWhatLinksHere::whatlinkshereForm().
wfMsgExt | ( | $ | key, | |
$ | options | |||
) |
Returns message in the requested format.
$key | String: key of the message | |
$options | Array: processing rules. Can take the following options: parse: parses wikitext to html parseinline: parses wikitext to html and removes the surrounding p's added by parser or tidy escape: filters message through htmlspecialchars escapenoentities: same, but allows entity references like through replaceafter: parameters are substituted after parsing or escaping parsemag: transform the message using magic phrases content: fetch message for content language instead of interface Also can accept a single associative argument, of the form 'language' => 'xx': language: Language object or language code to fetch message for (overriden by content), its behaviour with parser, parseinline and parsemag is undefined. Behavior for conflicting options (e.g., parse+parseinline) is undefined. |
Definition at line 844 of file GlobalFunctions.php.
References $options, $wgMessageCache, $wgOut, Sanitizer::escapeHtmlAllowEntities(), wfGetLangObj(), wfMsgGetKey(), wfMsgReplaceArgs(), and wfWarn().
Referenced by DeletedContribsPager::__construct(), ContribsPager::__construct(), LogPage::actionText(), LoginForm::addNewAccountInternal(), addToSidebar(), OutputPage::addWikiMsgArray(), bottomLinks(), SkinTemplate::buildContentActionUrls(), Xml::buildForm(), SkinVector::buildNavigationUrls(), ChangeTags::buildTagFilterSelector(), Language::commaList(), Article::confirmDelete(), Article::delete(), Article::doDelete(), MovePageForm::doSubmit(), EmailUserForm::doSubmit(), SpecialTags::doTagRow(), WatchlistEditor::execute(), SpecialTags::execute(), SpecialStatistics::execute(), MergehistoryForm::execute(), SpecialExport::execute(), DeletedContributionsPage::execute(), SpecialContributions::execute(), SpecialActiveUsers::execute(), FileRevertForm::execute(), ApiQueryAllmessages::execute(), extensionTabLinks(), SpecialNewpages::feed(), SpecialContributions::feed(), QueryPage::feedDesc(), Article::fetchContent(), ChangesList::flag(), ChangesList::flagLegend(), ChangesList::flagLine(), footerLink(), Linker::formatAutocommentsCallback(), Linker::formatHiddenCategories(), SpecialListGroupRights::formatPermissions(), WantedCategoriesPage::formatResult(), ShortPagesPage::formatResult(), PopularPagesPage::formatResult(), MostrevisionsPage::formatResult(), MostlinkedCategoriesPage::formatResult(), MostlinkedPage::formatResult(), MostcategoriesPage::formatResult(), MIMEsearchPage::formatResult(), FewestrevisionsPage::formatResult(), DoubleRedirectsPage::formatResult(), DisambiguationsPage::formatResult(), Linker::formatRevisionSize(), SpecialStatistics::formatRow(), SpecialNewpages::formatRow(), UsersPager::formatRow(), IPUnblockForm::formatRow(), CategoryPager::formatRow(), ActiveUsersPager::formatRow(), Linker::formatTemplates(), SpecialSearch::formHeader(), Skin::generateUserJs(), Credits::getAuthor(), EditPage::getCancelLink(), getCategoryLinks(), MostimagesPage::getCellHtml(), EditPage::getCheckboxes(), Article::getContent(), IPBlockForm::getContribsLink(), Credits::getContributors(), CategoryViewer::getCountMessage(), ImageHandler::getDimensionsString(), SpecialUpload::getDupeWarning(), SpecialStatistics::getEditStats(), SpecialUpload::getExistsWarning(), DeletedContributionsPage::getForm(), SpecialContributions::getForm(), MediaHandler::getGeneralLongDesc(), MediaHandler::getGeneralShortDesc(), RevDel_FileItem::getHTML(), CategoryViewer::getHTML(), RevisionDeleter::getLogMessage(), SvgHandler::getLongDesc(), GIFHandler::getLongDesc(), ImageHandler::getLongDesc(), MediaHandler::getLongDesc(), Language::getMessageFromDB(), SpecialStatistics::getMostViewedPages(), DifferenceEngine::getMultiNotice(), DeletedContribsPager::getNavigationBar(), ReverseChronologicalPager::getNavigationBar(), AlphabeticPager::getNavigationBar(), SpecialStatistics::getOtherStats(), UnusedtemplatesPage::getPageHeader(), UnusedimagesPage::getPageHeader(), UnusedCategoriesPage::getPageHeader(), LonelyPagesPage::getPageHeader(), DoubleRedirectsPage::getPageHeader(), DisambiguationsPage::getPageHeader(), DeadendPagesPage::getPageHeader(), BrokenRedirectsPage::getPageHeader(), SpecialStatistics::getPageStats(), SpecialWhatLinksHere::getPrevNext(), ImageHandler::getShortDesc(), MediaHandler::getShortDesc(), UploadForm::getSourceSection(), EditPage::getSummaryPreview(), HTMLEditTools::getTableRow(), getUndeleteLink(), SpecialUpload::getUploadForm(), Parser::getUserSig(), SpecialStatistics::getUserStats(), SpecialStatistics::getViewsStats(), Article::info(), Parser::limitationWarn(), SpecialWhatLinksHere::listItem(), DifferenceEngine::localiseLineNumbersCb(), LogPage::logHeader(), LoginForm::mailPassword(), LoginForm::mailPasswordInternal(), SpecialMostlinkedtemplates::makeWlhLink(), WantedQueryPage::makeWlhLink(), MergehistoryForm::merge(), Title::moveToNewTitle(), EditPage::noSuchSectionPage(), ChangesList::numberofWatchingusers(), LoginForm::onCookieRedirectCheck(), ImagePage::openShowImage(), SpecialRecentChanges::optionsPanel(), otherLanguages(), SkinTemplate::outputPage(), pageStats(), pageSubtitle(), CategoryViewer::pagingLinks(), RdfMetaData::person(), Language::pipeList(), SpecialSearch::powerSearchBox(), MergehistoryForm::preCacheMessages(), LogEventsList::preCacheMessages(), HistoryPage::preCacheMessages(), ChangesList::preCacheMessages(), FileDeleteForm::prepareMessage(), LoginForm::processLogin(), SpecialUpload::processVerificationError(), Preferences::profilePreferences(), Article::purge(), Preferences::rcPreferences(), EnhancedChangesList::recentChangesBlockGroup(), OldChangesList::recentChangesLine(), ImportReporter::reportPage(), Article::rollback(), Language::semicolonList(), Article::setOldSubtitle(), User::setPassword(), ChangesList::showCharacterDifference(), SpecialAllpages::showChunk(), Article::showCssOrJsPage(), EditPage::showDiff(), DifferenceEngine::showDiffPage(), UserrightsPage::showEditUserGroupsForm(), DifferenceEngine::showFirstRevision(), SpecialRevisionDelete::showForm(), SpecialResetpass::showForm(), MovePageForm::showForm(), SpecialImport::showForm(), EmailUserForm::showForm(), FileRevertForm::showForm(), LogEventsList::showHeader(), MergehistoryForm::showHistory(), SpecialSearch::showHit(), WatchlistEditor::showItemCount(), UndeleteForm::showList(), IPUnblockForm::showList(), LogEventsList::showLogExtract(), WatchlistEditor::showNormalForm(), SpecialPrefixindex::showPrefixChunk(), WatchlistEditor::showRawForm(), Article::showRedirectedFromHeader(), EditPage::showStandardInputs(), IPBlockForm::showSuccess(), EditPage::showSummaryInput(), SpecialUpload::showUploadWarning(), SpecialUpload::showViewDeletedLinks(), subPageSubtitle(), ChangeTags::tagDescription(), LoginForm::throttleHit(), ImageGallery::toHTML(), topLinks(), Language::truncate(), PageArchive::undelete(), ImagePage::uploadLinksBox(), Credits::userLink(), HTMLRadioField::validate(), HTMLMultiSelectField::validate(), HTMLSelectField::validate(), Preferences::validateEmail(), Preferences::validateSignature(), wfAjaxWatch(), wfForbidden(), wfNumLink(), wfShowingResults(), wfShowingResultsNum(), wfSpecialCategories(), wfSpecialFileDuplicateSearch(), wfSpecialNewimages(), wfSpecialRemoveRestrictions(), wfSpecialUserlogout(), wfSpecialWatchlist(), wfViewPrevNext(), wlCutoffLinks(), and OutputPage::wrapWikiMsg().
wfMsgForContent | ( | $ | key | ) |
Get a message from anywhere, for the current global language set with $wgLanguageCode.
Use this if the message should NOT change dependent on the language set in the user's preferences. This is the case for most text written into logs, as well as link targets (such as the name of the copyright policy page). Link titles, on the other hand, should be shown in the UI language.
Note that MediaWiki allows users to change the user interface language in their preferences, but a single installation typically only contains content in one language.
Be wary of this distinction: If you use wfMsg() where you should use wfMsgForContent(), a user of the software may have to customize over 70 messages in order to, e.g., fix a link in every possible language.
$key | String: lookup key for the message, usually defined in languages/Language.php |
Definition at line 647 of file GlobalFunctions.php.
References $wgForceUIMsgAsContentMsg, and wfMsgReal().
Referenced by Licenses::__construct(), LogPage::actionText(), User::addNewUserLogEntry(), addToSidebar(), Parser::addTrackingCategory(), ApiQuerySiteinfo::appendGeneralInfo(), Parser::braceSubstitution(), ProtectionForm::buildForm(), Article::commitRollback(), EmailNotification::composeCommonMailtext(), Article::confirmDelete(), Article::delete(), Block::doAutoblock(), FileDeleteForm::doDelete(), MovePageForm::doSubmit(), EditPage::edit(), SpecialListGroupRights::execute(), FileDeleteForm::execute(), ApiFeedWatchlist::execute(), ApiEditPage::execute(), HistoryPage::feed(), HistoryPage::feedEmpty(), HistoryPage::feedItem(), SpecialNewpages::feedItemDesc(), SpecialContributions::feedItemDesc(), footerLink(), Linker::formatAutocommentsCallback(), LogPage::formatBlockFlag(), FeedUtils::formatDiffRow(), Article::generateReason(), Article::getAutosummary(), getCategoryLinks(), RevisionDeleter::getChanges(), EditPage::getContent(), getCopyright(), EditPage::getCopywarn(), Interwiki::getDescription(), SpecialRecentchangeslinked::getFeedObject(), SpecialRecentChanges::getFeedObject(), UploadBase::getFilenamePrefixBlacklist(), User::getGroupPage(), SpecialStatistics::getGroupStats(), SpecialUpload::getInitialPageText(), RevisionDeleter::getLogMessage(), Interwiki::getName(), RandomPage::getNsList(), LogPage::getRcComment(), DisambiguationsPage::getSQL(), EditPage::getSummaryPreview(), DoubleRedirectJob::getUser(), Skin::initPage(), Article::insertNewArticle(), EditPage::internalAttemptSave(), User::isUsableName(), LogEventsList::logLine(), PatrolLog::makeActionText(), Skin::makeGlobalVariablesScript(), UserrightsPage::makeGroupNameList(), makeI18nUrl(), LoginForm::makeLanguageSelector(), Parser::maybeMakeExternalImage(), MergehistoryForm::merge(), Title::moveOverExistingRedirect(), Title::moveTo(), Title::moveToNewTitle(), nameAndLogin(), Title::newMainPage(), Parser::pstPass2(), SkinCologneBlue::quickBar(), LanguageConverter::recursiveConvertRule(), Parser::replaceInternalLinks2(), SearchEngine::replacePrefixes(), Article::replaceSection(), ImportReporter::reportPage(), DoubleRedirectJob::run(), ProtectionForm::save(), EmailNotification::sendImpersonal(), SpecialRevisionDelete::showForm(), FileRevertForm::showForm(), FileDeleteForm::showForm(), SpecialSearch::showHit(), SpecialBookSources::showList(), EditPage::showStandardInputs(), CoreParserFunctions::special(), SpecialSearch::startsWithAll(), SpecialRevisionDelete::submit(), SkinCologneBlue::sysLinks(), PageArchive::undelete(), Article::updateRestrictions(), Title::updateTitleProtection(), Article::view(), and BitmapHandler::visibleMetadataFields().
wfMsgForContentNoTrans | ( | $ | key | ) |
Same as above except doesn't transform the message.
Definition at line 661 of file GlobalFunctions.php.
References $wgForceUIMsgAsContentMsg, and wfMsgReal().
Referenced by LanguageConverter::convertTitle(), RawPage::getArticleText(), Block::isWhitelistedFromAutoblocks(), SpecialRecentChanges::setTopText(), Parser::statelessFetchTemplate(), wfGetCachedNotice(), and wfIsBadImage().
wfMsgGetKey | ( | $ | key, | |
$ | useDB, | |||
$ | langCode = false , |
|||
$ | transform = true | |||
) |
Fetch a message string value, but don't replace any keys yet.
$key | String | |
$useDB | Bool | |
$langCode | String: Code of the language to get the message for, or behaves as a content language switch if it is a boolean. | |
$transform | Boolean: whether to parse magic words, etc. |
Definition at line 735 of file GlobalFunctions.php.
References $wgContLang, $wgMessageCache, wfGetLangObj(), and wfRunHooks().
Referenced by MediaTransformError::__construct(), ApiQueryAllmessages::execute(), EditPage::getContent(), Article::getContent(), CoreParserFunctions::intFunction(), AllmessagesTablePager::reallyDoQuery(), wfMsgExt(), wfMsgHtml(), wfMsgReal(), wfMsgWeirdKey(), and wfMsgWikiHtml().
wfMsgHtml | ( | $ | key | ) |
Return an HTML-escaped version of a message.
Parameter replacements, if any, are done *after* the HTML-escaping, so parameters may contain HTML (eg links or form controls). Be sure to pre-escape them if you really do want plaintext, or just wrap the whole thing in htmlspecialchars().
$key | String | |
string | ... parameters |
Definition at line 802 of file GlobalFunctions.php.
References wfMsgGetKey(), and wfMsgReplaceArgs().
Referenced by LogPage::actionText(), LoginForm::addNewAccount(), OutputPage::addReturnTo(), ImageHistoryList::beginImageHistoryList(), Linker::blockLink(), SpecialRevisionDelete::buildCheckBoxes(), ProtectionForm::buildForm(), WatchlistEditor::buildRemoveLine(), Linker::buildRollbackLink(), WatchlistEditor::buildTools(), CategoryViewer::columnList(), Article::confirmDelete(), SpecialContributions::contributionsSub(), Article::delete(), UndeleteForm::diffHeader(), Linker::doEditSectionLink(), WikiImporter::doImport(), QueryPage::doQuery(), MovePageForm::doSubmit(), SpecialTags::doTagRow(), MergehistoryForm::execute(), SpecialListGroupRights::execute(), SpecialContributions::execute(), EmailConfirmation::execute(), SpecialNewpages::filterLinks(), FeedUtils::formatDiff(), Block::formatExpiry(), UnwatchedpagesPage::formatResult(), UnusedtemplatesPage::formatResult(), ShortPagesPage::formatResult(), MIMEsearchPage::formatResult(), LinkSearchPage::formatResult(), FewestrevisionsPage::formatResult(), BrokenRedirectsPage::formatResult(), WantedQueryPage::formatResult(), UndeleteForm::formatRevisionRow(), ProtectedTitlesForm::formatRow(), ProtectedPagesForm::formatRow(), SpecialNewpages::formatRow(), IPUnblockForm::formatRow(), DeletedContribsPager::formatRow(), ContribsPager::formatRow(), ChangesFeed::generateFeed(), Preferences::generateSkinOptions(), PreferencesForm::getButtons(), RevDel_FileItem::getComment(), IPBlockForm::getConvenienceLinks(), Preferences::getDateOptions(), RevDel_ArchiveItem::getDiffLink(), RevDel_RevisionItem::getDiffLink(), TablePager::getEmptyBody(), SpecialUpload::getExistsWarning(), SpecialRecentchangeslinked::getExtraOptions(), UndeleteForm::getFileComment(), UndeleteForm::getFileUser(), LogEventsList::getFilterLinks(), SpecialWhatLinksHere::getFilterPanel(), ImageListPager::getForm(), SpecialStatistics::getGroupStats(), RevDel_LogItem::getHTML(), EditPage::getLastDelete(), TablePager::getLimitForm(), WikiXmlError::getMessage(), WatchlistEditor::getNamespaceHeading(), DeletedContribsPager::getNavigationBar(), TablePager::getNavigationBar(), ReverseChronologicalPager::getNavigationBar(), AlphabeticPager::getNavigationBar(), SpecialWhatLinksHere::getPrevNext(), ImageHandler::getShortDesc(), UploadForm::getSourceSection(), DeletedContributionsPage::getSubTitle(), ImageHistoryList::getThumbForLine(), SpecialStatistics::getUserStats(), RevDel_FileItem::getUserTools(), HistoryPage::history(), HistoryPager::historyLine(), historyLink(), ImageHistoryList::imageHistoryLine(), Article::info(), ChangesList::insertAction(), ChangesList::insertComment(), ChangesList::insertUserRelatedLinks(), DifferenceEngine::loadRevisionData(), OutputPage::loginToUse(), LogEventsList::logLine(), LoginForm::mainLoginForm(), PatrolLog::makeActionText(), SpecialBookSources::makeForm(), LoginForm::makeLanguageSelector(), ImagePage::openShowImage(), SpecialRecentChanges::optionsPanel(), Credits::othersLink(), SkinTemplate::outputPage(), pageTitleLinks(), SpecialResetpass::pretty(), printableLink(), SpecialUpload::processVerificationError(), Preferences::profilePreferences(), EnhancedChangesList::recentChangesBlockGroup(), EnhancedChangesList::recentChangesBlockLine(), EnhancedChangesList::recentChangesLine(), DifferenceEngine::renderNewRevision(), ImportReporter::reportPage(), Linker::revComment(), Linker::revUserLink(), Linker::revUserTools(), IPUnblockForm::searchForm(), Article::setOldSubtitle(), ProtectionForm::show(), SpecialAllpages::showChunk(), SpecialRevisionDelete::showConvenienceLinks(), DifferenceEngine::showDiffPage(), UserrightsPage::showEditUserGroupsForm(), DifferenceEngine::showFirstRevision(), SpecialRevisionDelete::showForm(), MovePageForm::showForm(), IPUnblockForm::showForm(), IPBlockForm::showForm(), FileRevertForm::showForm(), FileDeleteForm::showForm(), MergehistoryForm::showHistory(), SpecialAllpages::showline(), ProtectedTitlesForm::showList(), ProtectedPagesForm::showList(), WatchlistEditor::showNormalForm(), Article::showPatrolFooter(), SpecialPrefixindex::showPrefixChunk(), WatchlistEditor::showRawForm(), SpecialUpload::showRecoverableUploadError(), WatchlistEditor::showTitles(), ImagePage::showTOC(), SpecialAllpages::showToplevel(), SpecialUpload::showUploadError(), SpecialUpload::showUploadWarning(), Linker::tocList(), ImageGallery::toHTML(), SkinNostalgia::topLinks(), UndeleteForm::undelete(), ImagePage::uploadLinksBox(), userContribsLink(), EditPage::userNotLoggedInPage(), Linker::userTalkLink(), Linker::userToolLinks(), Article::viewRedirect(), Preferences::watchlistPreferences(), wfSpecialNewimages(), wfSpecialRemoveRestrictions(), wfSpecialWatchlist(), wfThumbMain(), wfViewPrevNext(), whatLinksHere(), wlDaysLink(), and wlShowHideLink().
wfMsgNoDB | ( | $ | key | ) |
Get a message from the language file, for the UI elements.
Definition at line 675 of file GlobalFunctions.php.
References wfMsgReal().
Referenced by DBQueryError::getHTML(), and wfQuery().
wfMsgNoDBForContent | ( | $ | key | ) |
Get a message from the language file, for the content.
Definition at line 684 of file GlobalFunctions.php.
References $wgForceUIMsgAsContentMsg, and wfMsgReal().
Referenced by LoadBalancer::getReaderIndex().
wfMsgNoTrans | ( | $ | key | ) |
Same as above except doesn't transform the message.
Definition at line 619 of file GlobalFunctions.php.
References wfMsgReal().
Referenced by ImageHistoryList::beginImageHistoryList(), Article::doDelete(), DeletedContributionsPage::execute(), SpecialContributions::execute(), Article::fetchContent(), OutputPage::formatPermissionsErrorMessage(), EditPage::getContent(), SpecialUpload::getUploadForm(), Status::getWikiText(), ImagePage::makeMetadataTable(), ImagePage::openShowImage(), SpecialPage::outputHeader(), ImagePage::printSharedImageText(), ChangesList::showCharacterDifference(), Article::showMissingArticle(), Article::showNamespaceHeader(), and ImagePage::view().
wfMsgReal | ( | $ | key, | |
$ | args, | |||
$ | useDB = true , |
|||
$ | forContent = false , |
|||
$ | transform = true | |||
) |
Really get a message.
$key | String: key to get. | |
$args | ||
$useDB | Boolean | |
$transform | Boolean: Whether or not to transform the message. | |
$forContent | Mixed: Language code, or false for user lang, true for content lang. |
Definition at line 705 of file GlobalFunctions.php.
References wfMsgGetKey(), wfMsgReplaceArgs(), wfProfileIn(), and wfProfileOut().
Referenced by MediaTransformError::__construct(), IPUnblockForm::doSubmit(), Status::getItemXML(), Status::getWikiText(), MWException::msg(), IPBlockForm::showForm(), wfMsg(), wfMsgForContent(), wfMsgForContentNoTrans(), wfMsgNoDB(), wfMsgNoDBForContent(), wfMsgNoTrans(), and WikiErrorMsg::WikiErrorMsg().
wfMsgReplaceArgs | ( | $ | message, | |
$ | args | |||
) |
Replace message parameter keys on the given formatted output.
$message | String | |
$args | Array |
Definition at line 771 of file GlobalFunctions.php.
References $n.
Referenced by MediaTransformError::__construct(), Article::commitRollback(), ApiQueryAllmessages::execute(), Block::formatExpiry(), IPUnblockForm::formatRow(), CoreParserFunctions::intFunction(), MWException::msg(), ApiBase::parseMsg(), ApiMain::reallyMakeHelpMsg(), wfMsgExt(), wfMsgHtml(), wfMsgReal(), and wfMsgWikiHtml().
wfMsgWeirdKey | ( | $ | key | ) |
This function provides the message source for messages to be edited which are *not* stored in the database.
$key | String: |
Definition at line 717 of file GlobalFunctions.php.
References wfEmptyMsg(), and wfMsgGetKey().
Referenced by AddWiki::execute(), Article::info(), and Title::isAlwaysKnown().
wfMsgWikiHtml | ( | $ | key | ) |
Return an HTML version of message Parameter replacements, if any, are done *after* parsing the wiki-text message, so parameters may contain HTML (eg links or form controls).
Be sure to pre-escape them if you really do want plaintext, or just wrap the whole thing in htmlspecialchars().
$key | String | |
string | ... parameters |
Definition at line 819 of file GlobalFunctions.php.
References $wgOut, wfMsgGetKey(), and wfMsgReplaceArgs().
Referenced by LoginForm::addNewAccount(), EmailConfirmation::execute(), SpecialUpload::getExistsWarning(), UploadForm::getExtensionsMessage(), OutputPage::loginToUse(), LoginForm::mailPassword(), LoginForm::mainLoginForm(), LoginForm::processLogin(), SpecialAllpages::showChunk(), UndeleteForm::showHistory(), SpecialPrefixindex::showPrefixChunk(), UndeleteForm::showRevision(), UndeleteForm::undelete(), EditPage::userNotLoggedInPage(), and wfSpecialWatchlist().
wfNegotiateType | ( | $ | cprefs, | |
$ | sprefs | |||
) |
Returns the 'best' match between a client's requested internet media types and the server's list of available types.
Each list should be an associative array of type to preference (preference is a float between 0.0 and 1.0). Wildcards in the types are acceptable.
$cprefs | Array: client's acceptable type list | |
$sprefs | Array: server's offered types |
Definition at line 1775 of file GlobalFunctions.php.
References mimeTypeMatch().
Referenced by RdfMetaData::setup(), and GlobalTest::testNegotiateType().
wfNumLink | ( | $ | offset, | |
$ | limit, | |||
$ | title, | |||
$ | query = '' | |||
) |
Generate links for (20|50|100.
..) items-per-page links
$offset | String | |
$limit | Integer | |
$title | Title | |
$query | String: optional URL query parameter string |
Definition at line 1187 of file GlobalFunctions.php.
References $s, $title, $wgLang, and wfMsgExt().
Referenced by wfViewPrevNext().
wfObjectToArray | ( | $ | object, | |
$ | recursive = true | |||
) |
wfOut | ( | $ | s | ) |
Output some plain text in command-line mode or in the installer (updaters.inc).
Do not use it in any other context, its behaviour is subject to change.
Definition at line 3205 of file GlobalFunctions.php.
References $s, and $wgCommandLineMode.
Referenced by add_field(), add_index(), add_table(), check_bin(), UserDupes::checkDupes(), convertLinks(), createTempTable(), do_active_users_init(), do_all_updates(), do_archive_user_index(), do_backlinking_indices_update(), do_category_population(), do_categorylinks_indices_update(), do_copy_newtalk_to_watchlist(), do_drop_img_type(), do_filearchive_indices_update(), do_image_index_update(), do_image_name_unique_update(), do_image_user_index(), do_index_update(), do_interwiki_update(), do_inverse_timestamp(), do_log_search_population(), do_logging_timestamp_index(), do_namespace_size_on(), do_old_links_update(), do_oldimage_user_index(), do_page_random_update(), do_pagelinks_namespace(), do_pagelinks_update(), do_populate_parent_id(), do_postgres_updates(), do_rc_indices_update(), do_restrictions_update(), do_schema_restructuring(), do_stats_init(), do_templatelinks_update(), do_text_id(), do_unique_pl_tl_il(), do_update_mime_minor_field(), do_update_transcache_field(), do_user_groups_reformat(), do_user_groups_update(), do_user_unique_update(), do_user_update(), do_watchlist_null(), do_watchlist_update(), PopulateCategory::doPopulateCategory(), UserDupes::examine(), fix_ancient_imagelinks(), UserDupes::hasUniqueIndex(), index_has_field(), maybe_do_profiling_memory_update(), migrate_log_params(), modify_field(), populate_rev_parent_id(), populateCategory(), purge_cache(), UserDupes::reassignEditsOn(), rename_eu_wiki_id(), rename_table(), sqlite_initial_indexes(), sqlite_setup_searchindex(), and UserDupes::trimAccount().
wfParseUrl | ( | $ | url | ) |
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:) correctly 3) Adds a "delimiter" element to the array, either '://' or ':' (see (2))
$url | String: a URL to parse |
Definition at line 2591 of file GlobalFunctions.php.
References $url, $wgUrlProtocols, wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by Parser::getExternalLinkAttribs(), and wfMakeUrlIndex().
wfPercent | ( | $ | nr, | |
$ | acc = 2 , |
|||
$ | round = true | |||
) |
$nr | Mixed: the number to format | |
$acc | Integer: the number of digits after the decimal point, default 2 | |
$round | Boolean: whether or not to round the value, default true |
Definition at line 2217 of file GlobalFunctions.php.
Referenced by DeleteImageCache::execute(), and TestRecorder::reportPercentage().
wfPurgeSquidServers | ( | $ | urlArr | ) |
This is obsolete, use SquidUpdate::purge().
Definition at line 1423 of file GlobalFunctions.php.
References SquidUpdate::purge().
wfQueriesMustScale | ( | ) |
Should low-performance queries be disabled?
Definition at line 3031 of file GlobalFunctions.php.
References $wgMiserMode, SiteStats::edits(), SiteStats::pages(), and SiteStats::users().
wfQuotedPrintable | ( | $ | string, | |
$ | charset = '' | |||
) |
Definition at line 1258 of file GlobalFunctions.php.
References $out, and $wgInputEncoding.
Referenced by UserMailer::send(), GlobalTest::testQuotedPrintable(), and MailAddress::toString().
wfRandom | ( | ) |
Get a random decimal value between 0 and 1, in a way not likely to give duplicate values for any realistic number of articles.
Definition at line 279 of file GlobalFunctions.php.
Referenced by RandomPage::getRandomTitle(), Article::insertOn(), ApiQueryRandom::run(), and GlobalTest::testRandom().
wfReadOnly | ( | ) |
Check if the wiki read-only lock file is present.
This can be used to lock off editing functions, but doesn't guarantee that the database will not be modified.
Definition at line 532 of file GlobalFunctions.php.
References $wgReadOnly, and $wgReadOnlyFile.
Referenced by ProtectionForm::__construct(), LoginForm::addNewAccountInternal(), ApiQuerySiteinfo::appendGeneralInfo(), User::clearNotification(), Article::commitRollback(), Block::delete(), Article::delete(), Article::doCascadeProtectionUpdates(), MediaWiki::doJobs(), EditPage::edit(), WatchlistEditor::execute(), UserrightsPage::execute(), SpecialUpload::execute(), SpecialRevisionDelete::execute(), SpecialPreferences::execute(), SpecialImport::execute(), FileRevertForm::execute(), FileDeleteForm::execute(), ApiMain::executeAction(), LocalFile::getSha1(), EditPage::internalAttemptSave(), User::invalidateCache(), Title::invalidateCache(), Profiler::logToDB(), LoginForm::mailPassword(), LoginForm::mainLoginForm(), LocalFile::maybeUpgradeRow(), Category::refreshCounts(), MathRenderer::render(), ApiMain::requestWriteMode(), User::saveSettings(), User::setNewtalk(), ProtectionForm::show(), EditPage::showHeader(), GlobalTest::testReadOnlyEmpty(), GlobalTest::testReadOnlySet(), UndeleteForm::undelete(), PageArchive::undeleteRevisions(), Article::unwatch(), Article::updateRestrictions(), LocalFile::upgradeRow(), Article::viewUpdates(), Article::watch(), wfAjaxWatch(), wfReadOnlyReason(), wfSpecialBlockip(), wfSpecialIpblocklist(), and wfSpecialMovepage().
wfReadOnlyReason | ( | ) |
Definition at line 550 of file GlobalFunctions.php.
References $wgReadOnly, and wfReadOnly().
Referenced by ApiQuerySiteinfo::appendGeneralInfo(), ApiBase::dieReadOnly(), OutputPage::readOnlyPage(), and EditPage::showHeader().
wfRegexReplacement | ( | $ | string | ) |
Definition at line 2462 of file GlobalFunctions.php.
References StringUtils::escapeRegexReplacement().
wfRelativePath | ( | $ | path, | |
$ | from | |||
) |
Generate a relative path name to the given file.
May explode on non-matching case-insensitive paths, funky symlinks, etc.
$path | String: absolute destination path including target filename | |
$from | String: Absolute source path, directory only |
Definition at line 2499 of file GlobalFunctions.php.
References $path, and wfBaseName().
Referenced by TestFileIterator::__construct(), and UploadDumper::outputItem().
wfReportTime | ( | ) |
Returns a HTML comment with the elapsed time since request.
This method has no side effects.
Definition at line 1004 of file GlobalFunctions.php.
References $wgRequestTime, $wgShowHostnames, wfHostname(), and wfTime().
Referenced by ApiMain::executeActionWithErrorHandling(), SkinTemplate::outputPage(), Skin::outputPage(), and OutputPage::reportTime().
wfResetOutputBuffers | ( | $ | resetGzipEncoding = true |
) |
Clear away any user-level output buffers, discarding contents.
Suitable for 'starting afresh', for instance when streaming relatively large amounts of data without buffering, or wanting to output image files without ob_gzhandler's compression.
The optional $resetGzipEncoding parameter controls suppression of the Content-Encoding header sent by ob_gzhandler; by default it is left. See comments for wfClearOutputBuffers() for why it would be used.
Note that some PHP configuration options may add output buffer layers which cannot be removed; these are left in place.
$resetGzipEncoding | Bool |
Definition at line 1659 of file GlobalFunctions.php.
References $wgDisableOutputCompression.
Referenced by SpecialExport::execute(), wfClearOutputBuffers(), and wfStreamFile().
wfRestoreWarnings | ( | ) |
Restore error level to previous value.
Definition at line 1856 of file GlobalFunctions.php.
References wfSuppressWarnings().
Referenced by Exif::__construct(), OutputPage::checkLastModified(), FSRepo::chmod(), SquidPurgeClient::close(), TextPassDumper::closeSpawn(), ZhClient::connect(), DiffHistoryBlob::diff(), SpecialExport::doExport(), MimeMagic::doGuessMimeType(), SquidPurgeClient::doReads(), SquidPurgeClient::doWrites(), MonoBookTemplate::execute(), ModernTemplate::execute(), PhpHttpRequest::execute(), FSRepo::freeTemp(), ImageHandler::getImageSize(), DjVuImage::getInfo(), SquidPurgeClient::getIP(), DjVuHandler::getMetaTree(), SquidPurgeClient::getSocket(), SpecialVersion::getSvnInfo(), TextPassDumper::getTextSpawned(), Language::iconv(), DifferenceEngine::initDiffEngines(), DatabaseOracle::insertOneRow(), DatabaseMysql::lastError(), MessageCache::loadFromLocal(), DiffHistoryBlob::patch(), Preprocessor_DOM::preprocessToObj(), FSRepo::publishBatch(), DjVuImage::retrieveMetaData(), SquidPurgeClientPool::run(), MessageCache::saveToLocal(), MessageCache::saveToScript(), File::sha1Base36(), RecompressTracked::startSlaveProcs(), MediaWiki_I18N::translate(), Language::userAdjust(), wfErrorLog(), wfMemoryLimit(), wfParseUrl(), wfSetupSession(), and wfThumbMain().
wfScript | ( | $ | script = 'index' |
) |
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScriptExtension etc.
$script | String: script filename, sans extension |
Definition at line 3046 of file GlobalFunctions.php.
References $wgScriptExtension, and $wgScriptPath.
Referenced by Skin::initPage(), ApiFormatBase::initPrinter(), and wfSpecialWatchlist().
wfSeedRandom | ( | ) |
Seed Mersenne Twister No-op for compatibility; only necessary in PHP < 4.2.0.
Definition at line 268 of file GlobalFunctions.php.
wfSetBit | ( | &$ | dest, | |
$ | bit, | |||
$ | state = true | |||
) |
As for wfSetVar except setting a bit.
Definition at line 1300 of file GlobalFunctions.php.
Referenced by DatabaseBase::bufferResults(), DatabaseBase::debug(), and DatabaseBase::ignoreErrors().
wfSetupSession | ( | ) |
Initialise php session.
Definition at line 2833 of file GlobalFunctions.php.
References $wgCookieDomain, $wgCookieHttpOnly, $wgCookiePath, $wgCookieSecure, $wgSessionHandler, $wgSessionsInMemcached, wfDebugLog(), wfHttpOnlySafe(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by ApiLogin::execute(), MediaWiki::performAction(), User::SetupSession(), and wfSpecialUserlogin().
wfSetVar | ( | &$ | dest, | |
$ | source | |||
) |
Sets dest to source and returns the original value of dest If source is NULL, it just returns the value, it doesn't set the variable.
Definition at line 1289 of file GlobalFunctions.php.
Referenced by OutputPage::enableClientCache(), DatabaseBase::errorCount(), DatabaseBase::failFunction(), SpecialPage::file(), LinkCache::forUpdate(), Block::forUpdate(), Article::forUpdate(), Block::fromMaster(), SpecialPage::func(), SpecialPage::includable(), SpecialPage::including(), SpecialPage::listed(), SpecialPage::name(), Parser::Options(), Parser::OutputType(), LoadBalancer::parentInfo(), OutputPage::parserOptions(), SpecialPage::restriction(), SpecialPage::restrictions(), ParserOutput::setCacheTime(), ParserOutput::setCategoryLinks(), ParserOutput::setContainsOldMagic(), ParserOutput::setIndexPolicy(), ParserOutput::setLanguageLinks(), SpecialPage::setListed(), OutputPage::setRevisionId(), ParserOutput::setSections(), ParserOutput::setText(), ParserOutput::setTitleText(), ParserOutput::setTOCHTML(), DatabaseBase::tablePrefix(), Parser::Title(), DatabaseBase::trxLevel(), and LoadBalancer::waitTimeout().
wfShellExec | ( | $ | cmd, | |
&$ | retval = null | |||
) |
Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported.
$cmd | Command line, properly escaped for shell. | |
&$retval | optional, will receive the program's exit code. (non-zero is usually failure) |
Definition at line 2344 of file GlobalFunctions.php.
References $IP, $output, $script, $wgMaxShellFileSize, $wgMaxShellMemory, $wgMaxShellTime, wfDebug(), wfDebugLog(), wfIniGetBool(), and wfInitShellLocale().
Referenced by CheckSyntax::buildFileList(), UploadBase::detectVirus(), DjVuHandler::doTransform(), BitmapHandler::doTransform(), InstallerResource::extract(), SVNInstallerResource::fetch(), DifferenceEngine::generateDiffBody(), SVNInstallerRepository::printListing(), SvgHandler::rasterize(), readlineEmulation(), and DjVuImage::retrieveMetaData().
wfShorthandToInteger | ( | $ | string = '' |
) |
Converts shorthand byte notation to integer form.
$string | String |
Definition at line 3323 of file GlobalFunctions.php.
Referenced by UploadForm::getSourceSection(), and wfMemoryLimit().
wfShowingResults | ( | $ | offset, | |
$ | limit | |||
) |
Definition at line 1104 of file GlobalFunctions.php.
References $wgLang, and wfMsgExt().
Referenced by QueryPage::doQuery(), and SpecialSearch::formHeader().
wfShowingResultsNum | ( | $ | offset, | |
$ | limit, | |||
$ | num | |||
) |
Definition at line 1113 of file GlobalFunctions.php.
References $wgLang, and wfMsgExt().
Referenced by SpecialSearch::formHeader().
wfSpecialList | ( | $ | page, | |
$ | details | |||
) |
Definition at line 2272 of file GlobalFunctions.php.
References $page, and $wgContLang.
Referenced by WantedCategoriesPage::formatResult(), UnwatchedpagesPage::formatResult(), UnusedtemplatesPage::formatResult(), PopularPagesPage::formatResult(), MostrevisionsPage::formatResult(), SpecialMostlinkedtemplates::formatResult(), MostlinkedCategoriesPage::formatResult(), MostlinkedPage::formatResult(), MostcategoriesPage::formatResult(), FewestrevisionsPage::formatResult(), AncientPagesPage::formatResult(), WantedQueryPage::formatResult(), ProtectedTitlesForm::formatRow(), ProtectedPagesForm::formatRow(), UsersPager::formatRow(), and ActiveUsersPager::formatRow().
wfSplitWikiID | ( | $ | wiki | ) |
Split a wiki ID into DB name and table prefix.
Definition at line 2948 of file GlobalFunctions.php.
Referenced by ForeignDBViaLBRepo::__construct(), LBFactory_Multi::getDBNameAndPrefix(), nextJobDB::getPendingDbs(), and LoadBalancer::openForeignConnection().
wfStripIllegalFilenameChars | ( | $ | name | ) |
Replace all invalid characters with -.
$name | Mixed: filename to process |
Definition at line 3248 of file GlobalFunctions.php.
References $name, $wgIllegalFileChars, Title::legalChars(), and wfBaseName().
Referenced by UploadBase::getTitle(), and Title::isValidMoveOperation().
wfSuppressWarnings | ( | $ | end = false |
) |
Reference-counted warning suppression.
Definition at line 1834 of file GlobalFunctions.php.
Referenced by Exif::__construct(), SqliteMaintenance::backup(), OutputPage::checkLastModified(), FSRepo::chmod(), SquidPurgeClient::close(), TextPassDumper::closeSpawn(), ZhClient::connect(), DiffHistoryBlob::diff(), SpecialExport::doExport(), MimeMagic::doGuessMimeType(), SquidPurgeClient::doReads(), SquidPurgeClient::doWrites(), MonoBookTemplate::execute(), ModernTemplate::execute(), PhpHttpRequest::execute(), FSRepo::freeTemp(), ImageHandler::getImageSize(), DjVuImage::getInfo(), SquidPurgeClient::getIP(), DjVuHandler::getMetaTree(), SquidPurgeClient::getSocket(), SpecialVersion::getSvnInfo(), TextPassDumper::getTextSpawned(), Language::iconv(), DifferenceEngine::initDiffEngines(), DatabaseOracle::insertOneRow(), DatabaseMysql::lastError(), MessageCache::loadFromLocal(), DiffHistoryBlob::patch(), Preprocessor_DOM::preprocessToObj(), FSRepo::publishBatch(), DjVuImage::retrieveMetaData(), SquidPurgeClientPool::run(), MessageCache::saveToLocal(), MessageCache::saveToScript(), File::sha1Base36(), RecompressTracked::startSlaveProcs(), MediaWiki_I18N::translate(), Language::userAdjust(), wfErrorLog(), wfMemoryLimit(), wfParseUrl(), wfRestoreWarnings(), wfSetupSession(), and wfThumbMain().
wfTempDir | ( | ) |
Tries to get the system directory for temporary files.
For PHP >= 5.2.1, we'll use sys_get_temp_dir(). The TMPDIR, TMP, and TEMP environment variables are then checked in sequence, and if none are set /tmp is returned as the generic Unix default.
NOTE: When possible, use the tempfile() function to create temporary files to avoid race conditions on file creation, etc.
Definition at line 2139 of file GlobalFunctions.php.
Referenced by WikiRevision::downloadSource(), WebInstallerResource::fetch(), ParserTest::quickDiff(), HttpTest::setup(), GlobalTest::setUp(), MediaWikiParserTestSuite::setupUploadDir(), ParserTest::setupUploadDir(), wfDiff(), and wfMerge().
wfTime | ( | ) |
Definition at line 1281 of file GlobalFunctions.php.
Referenced by BenchmarkPurge::benchSquid(), MediaWiki::doJobs(), DumpRenderer::execute(), Article::getOutputFromWikitext(), BackupReader::importFromHandle(), ImageBuilder::init(), TableCleanup::init(), BackupDumper::initProgress(), ImageBuilder::progress(), TableCleanup::progress(), BackupReader::showReport(), TextPassDumper::showReport(), BackupDumper::showReport(), GlobalTest::testTime(), wfLogProfilingData(), and wfReportTime().
wfTimestamp | ( | $ | outputtype = TS_UNIX , |
|
$ | ts = 0 | |||
) |
$outputtype | Mixed: A timestamp in one of the supported formats, the function will autodetect which format is supplied and act accordingly. | |
$ts | Mixed: the timestamp to convert or 0 for the current timestamp |
Definition at line 1920 of file GlobalFunctions.php.
References wfDebug().
Referenced by Block::__construct(), ApiQueryLogEvents::addLogParams(), ApiQuerySiteinfo::appendGeneralInfo(), OutputPage::blockedPage(), SpecialRecentChanges::buildMainQueryConds(), OutputPage::checkLastModified(), AjaxResponse::checkLastModified(), User::checkTemporaryPassword(), Article::commitRollback(), User::confirmationToken(), ApiQueryContributions::continueStr(), Article::createUpdates(), DifferenceEngine::debug(), Block::decodeExpiry(), LocalFile::decodeRow(), UndeleteForm::diffHeader(), do_schema_restructuring(), UpdateSearchIndex::execute(), RemoveUnusedAccounts::execute(), GenerateSitemap::execute(), FixTimestamps::execute(), SpecialExport::execute(), LocalFileRestoreBatch::execute(), ApiUndelete::execute(), ApiQueryContributions::execute(), ApiQueryRecentChanges::execute(), ApiQueryLogEvents::execute(), ApiQueryImageInfo::execute(), ApiQueryDeletedrevs::execute(), ApiQueryBlocks::execute(), ApiQueryAllUsers::execute(), ApiProtect::execute(), ApiFeedWatchlist::execute(), ApiEditPage::execute(), ApiBlock::execute(), ApiQueryInfo::extractPageInfo(), ApiQueryWatchlist::extractRowInfo(), ApiQueryContributions::extractRowInfo(), ApiQueryRevisions::extractRowInfo(), ApiQueryRecentChanges::extractRowInfo(), ApiQueryLogEvents::extractRowInfo(), HistoryPage::feedEmpty(), Article::fetchContent(), HTMLFileCache::fileCacheTime(), FeedUtils::formatDiff(), UndeleteForm::formatFileRow(), AncientPagesPage::formatResult(), UndeleteForm::formatRevisionRow(), MergehistoryForm::formatRevisionRow(), UsersPager::formatRow(), ContribsPager::formatRow(), AtomFeed::formatTime(), RSSFeed::formatTime(), GenerateSitemap::generateLimit(), RawPage::getArticleText(), Block::getAutoblockExpiry(), ApiQueryUserInfo::getCurrentUserInfo(), ProtectionForm::getExpiry(), User::getFirstEditTimestamp(), FormatExif::getFormattedData(), ApiQueryImageInfo::getInfo(), ApiBase::getParameterFromSettings(), PageArchive::getPreviousRevision(), Parser::getRevisionTimestamp(), ImageHistoryList::getThumbForLine(), RevDel_Item::getTimestamp(), Revision::getTimestamp(), ForeignAPIFile::getTimestamp(), File::getTimestamp(), ArchivedFile::getTimestamp(), Article::getTimestamp(), Revision::getTimestampFromId(), Title::getUserPermissionsErrors(), Parser::getVariableValue(), ImageHistoryList::imageHistoryLine(), Block::initFromRow(), User::isEmailConfirmationPending(), SqlBagOStuff::isExpired(), User::isPasswordReminderThrottled(), User::loadDefaults(), ChangesFeed::loadFromCache(), RecentChange::loadFromCurRow(), User::loadFromRow(), RecentChange::loadFromRow(), Article::loadPageData(), LogEventsList::logLine(), GenerateSitemap::main(), MergehistoryForm::merge(), User::newTouchedTimestamp(), OutputPage::output(), ExtensionInstaller::patchLocalSettings(), User::pingLimiter(), ApiQueryContributions::prepareQuery(), ImageBuilder::progress(), TableCleanup::progress(), Parser::pstPass2(), LocalFile::recordUpload2(), Revision::Revision(), HistoryPager::revLink(), ApiQueryWatchlistRaw::run(), ApiQueryWatchlist::run(), ApiQuerySearch::run(), ApiQueryProtectedTitles::run(), ApiQueryDuplicateFiles::run(), ApiQueryCategoryMembers::run(), ApiQueryCategories::run(), RunJobs::runJobsLog(), ChangesFeed::saveToCache(), ApiMain::sendCacheHeaders(), WikiRevision::setTimestamp(), TextPassDumper::showReport(), BackupDumper::showReport(), Language::sprintfDate(), UpdateLogging::sync(), GlobalTest::testTimestamp(), Language::timeanddate(), DatabasePostgres::timestamp(), DatabaseMssql::timestamp(), DatabaseIbm_db2::timestamp(), DatabaseBase::timestamp(), UndeleteForm::UndeleteForm(), Article::updateIfNewerOn(), Block::updateTimestamp(), EditPage::wasDeletedSinceLastEdit(), wfDebugLog(), wfSpecialNewimages(), wfTimestampNow(), wfTimestampOrNull(), and XmlDumpWriter::writeTimestamp().
wfTimestampNow | ( | ) |
Convenience function; returns MediaWiki timestamp for the present time.
Definition at line 1826 of file GlobalFunctions.php.
References wfTimestamp().
Referenced by User::confirmEmail(), Preferences::datetimePreferences(), Block::doAutoblock(), Article::doEdit(), User::doLogout(), IPBlockForm::doMassUserBlock(), DBLockForm::doSubmit(), UpdateSearchIndex::execute(), PPFuzzTest::execute(), GenerateSitemap::execute(), SpecialExport::execute(), ApiProtect::execute(), Title::getCascadeProtectionSources(), Preferences::getDateOptions(), EditPage::importFormData(), Block::isExpired(), Title::loadRestrictions(), Title::loadRestrictionsFromRows(), Title::moveOverExistingRedirect(), SpecialRecentChanges::optionsPanel(), AtomFeed::outHeader(), RSSFeed::outHeader(), ProtectionForm::save(), ParserCache::save(), LogPage::saveContent(), HTMLFileCache::saveToFileCache(), User::setNewpassword(), AjaxResponse::storeInMemcached(), Title::updateTitleProtection(), wfSpecialBlockme(), wfSpecialNewimages(), and wfSpecialWatchlist().
wfTimestampOrNull | ( | $ | outputtype = TS_UNIX , |
|
$ | ts = null | |||
) |
Return a formatted timestamp, or null if input is null.
For dealing with nullable timestamp columns in the database.
$outputtype | Integer | |
$ts | String |
Definition at line 1990 of file GlobalFunctions.php.
References wfTimestamp().
Referenced by Autopromote::checkCondition(), ApiQueryUsers::execute(), Title::getEarliestRevTime(), and User::loadFromRow().
wfUrlencode | ( | $ | s | ) |
We want some things to be included as literal characters in our title URLs for prettiness, which urlencode encodes by default.
According to RFC 1738, all of the following should be safe:
;:&=$-_.+!*'(),
But + is not safe because it's used to indicate a space; &= are only safe in paths and not in queries (and we don't distinguish here); ' seems kind of scary; and urlencode() doesn't touch -_. to begin with. Plus, although / is reserved, we don't care. So the list we unescape is:
;:$!*(),/
2F in the page titles seems to fatally break for some reason.
$s | String: |
Definition at line 307 of file GlobalFunctions.php.
References $s.
Referenced by FileRepo::getDescriptionRenderUrl(), FileRepo::getDescriptionUrl(), Title::getFullURL(), Title::getLocalURL(), Title::getPrefixedURL(), Title::getSubpageUrlForm(), Parser::getVariableValue(), LoginForm::mainLoginForm(), Title::makeTitle(), CoreParserFunctions::namespacee(), CoreParserFunctions::nse(), SkinTemplate::outputPage(), Title::secureAndSplit(), CoreParserFunctions::subjectspacee(), CoreParserFunctions::talkspacee(), GlobalTest::testUrlencode(), and wfSpecialEmailuser().
wfUrlProtocols | ( | ) |
Returns a regular expression of url protocols.
Definition at line 2283 of file GlobalFunctions.php.
References $wgUrlProtocols.
Referenced by Parser::__construct(), addToSidebar(), Parser::armorLinks(), Skin::makeGlobalVariablesScript(), makeInternalOrExternalUrl(), Parser::replaceExternalLinks(), Parser::replaceInternalLinks2(), Parser_LinkHooks::replaceInternalLinksCallback(), and Parser::stripSectionName().
wfUseMW | ( | $ | req_ver | ) |
This function works like "use VERSION" in Perl except it checks the version of MediaWiki, the program will die with a backtrace if the current version of MediaWiki is less than the version provided.
This is useful for extensions which due to their nature are not kept in sync with releases
$req_ver | Mixed: the version to check, can be a string, an integer, or a float |
Definition at line 2452 of file GlobalFunctions.php.
References $wgVersion.
wfUsePHP | ( | $ | req_ver | ) |
This function works like "use VERSION" in Perl, the program will die with a backtrace if the current version of PHP is less than the version provided.
This is useful for extensions which due to their nature are not kept in sync with releases, and might depend on other versions of PHP than the main code
Note: PHP might die due to parsing errors in some cases before it ever manages to call this function, such is life
$req_ver | Mixed: the version to check, can be a string, an integer, or a float |
Definition at line 2432 of file GlobalFunctions.php.
wfVarDump | ( | $ | var | ) |
A wrapper around the PHP function var_export().
Either print it or add it to the regular output ($wgOut).
$var | A PHP variable to dump. |
Definition at line 1611 of file GlobalFunctions.php.
wfViewPrevNext | ( | $ | offset, | |
$ | limit, | |||
$ | link, | |||
$ | query = '' , |
|||
$ | atend = false | |||
) |
Generate (prev x| next x) (20|50|100.
..) type links for paging
$offset | String | |
$limit | Integer | |
$link | String | |
$query | String: optional URL query parameter string | |
$atend | Bool: optional param for specified if this is the last page |
Definition at line 1127 of file GlobalFunctions.php.
References $title, $wgLang, Title::newFromText(), wfMsgExt(), wfMsgHtml(), and wfNumLink().
Referenced by QueryPage::doQuery(), and SpecialSearch::showResults().
wfWaitForSlaves | ( | $ | maxLag, | |
$ | wiki = false | |||
) |
Sleep until the worst slave's replication lag is less than or equal to $maxLag, in seconds.
Use this when updating very large numbers of rows, as in maintenance scripts, to avoid causing too much lag. Of course, this is a no-op if there are no slaves.
Every time the function has to wait for a slave, it will print a message to that effect (and then sleep for a little while), so it's probably not best to use this outside maintenance scripts in its present form.
$maxLag | Integer | |
$wiki | mixed Wiki identifier accepted by wfGetLB |
Definition at line 3185 of file GlobalFunctions.php.
References $maxLag, $name, print, and wfGetLB().
Referenced by compressWithConcat(), RefreshLinks::deleteLinksFromNonexistent(), do_restrictions_update(), do_templatelinks_update(), IPBlockForm::doMassUserBlock(), PopulateCategory::doPopulateCategory(), RefreshLinks::doRefreshLinks(), WaitForSlave::execute(), UpdateSpecialPages::execute(), UpdateRestrictions::execute(), RunJobs::execute(), BatchedQueryRunner::execute(), RebuildFileCache::execute(), PopulateSha1::execute(), PopulateParentId::execute(), PopulateLogUsertext::execute(), PopulateLogSearch::execute(), MoveBatch::execute(), MigrateUserGroup::execute(), InitEditCount::execute(), DeleteSelfExternals::execute(), DeleteBatch::execute(), ConvertUserOptions::execute(), migrate_log_params(), moveToExternal(), populate_rev_parent_id(), populateCategory(), DeleteDefaultMessages::reallyExecute(), resolveStubs(), RefreshLinksJob2::run(), BackupReader::showReport(), UpdateLogging::sync(), TrackBlobs::trackOrphanText(), TrackBlobs::trackRevisions(), FixBug20757::waitForSlaves(), and wfGearmanMonitor().
wfWarn | ( | $ | msg, | |
$ | callerOffset = 1 , |
|||
$ | level = E_USER_NOTICE | |||
) |
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
$msg | String: message to send | |
$callerOffset | Integer: number of itmes to go back in the backtrace to find the correct caller (1 = function calling wfWarn, ...) | |
$level | Integer: PHP error level; only used when $wgDevelopmentWarnings is true |
Definition at line 3146 of file GlobalFunctions.php.
References $msg, $wgDevelopmentWarnings, wfDebug(), and wfDebugBacktrace().
Referenced by SpecialPage::getLocalNameFor(), wfDeprecated(), and wfMsgExt().
wfWikiID | ( | ) |
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
Definition at line 2936 of file GlobalFunctions.php.
References $wgDBname, and $wgDBprefix.
Referenced by DBABagOStuff::__construct(), ApiQuerySiteinfo::appendGeneralInfo(), UserDupes::checkDupes(), checkDupes(), RefreshImageCount::execute(), InitEditCount::execute(), GenerateSitemap::execute(), DeleteRevision::execute(), DeleteImageCache::execute(), CreateAndPromote::execute(), CheckUsernames::execute(), AttachLatest::execute(), UserrightsPage::fetchUser(), LoadBalancer::getConnection(), Interwiki::getInterwikiCacheEntry(), User::getNewMessageLinks(), ProfilerSimple::getProfileID(), MessageCache::loadFromLocal(), RecompressTracked::logToFile(), SkinTemplate::outputPage(), User::pingLimiter(), TableCleanup::progress(), MWGearmanJob::run(), MessageCache::saveToLocal(), MessageCache::saveToScript(), User::setToken(), TextPassDumper::showReport(), BackupDumper::showReport(), RecompressTracked::startSlaveProcs(), MediaWikiParserTestSuite::suite(), wfDebugLog(), and wfMemcKey().