MediaWiki  REL1_19
GlobalFunctions.php File Reference

Global functions used everywhere. More...

Go to the source code of this file.

Enumerations

enum  TS_DB
 MySQL DATETIME (YYYY-MM-DD HH:MM:SS) More...
enum  TS_DB2
 DB2 format time. More...
enum  TS_EXIF
 An Exif timestamp (YYYY:MM:DD HH:MM:SS) More...
enum  TS_ISO_8601
 ISO 8601 format with no timezone: 1986-02-09T20:00:00Z. More...
enum  TS_ISO_8601_BASIC
 ISO 8601 basic format with no timezone: 19860209T200000Z. More...
enum  TS_MW
 MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS) More...
enum  TS_ORACLE
 Oracle format time. More...
enum  TS_POSTGRES
 Postgres format time. More...
enum  TS_RFC2822
 RFC 2822 format, for E-mail and HTTP headers. More...
enum  TS_UNIX
 Unix time - the number of seconds since 1970-01-01 00:00:00 UTC. More...

Functions

 in_string ($needle, $str, $insensitive=false)
 Find out whether or not a mixed variable exists in a string.
 mimeTypeMatch ($type, $avail)
 Checks if a given MIME type matches any of the keys in the given array.
 swap (&$x, &$y)
 Swap two variables.
 wfAcceptToPrefs ($accept, $def= '*/*')
 Converts an Accept-* header into an array mapping string values to quality factors.
 wfAppendQuery ($url, $query)
 Append a query string to an existing URL, which may or may not already have query string parameters already.
 wfAppendToArrayIfNotDefault ($key, $value, $default, &$changed)
 Appends to second array if $value differs from that in $default.
if(!defined( 'MEDIAWIKI')) wfArrayDiff2 ($a, $b)
 Like array_diff( $a, $b ) except that it works with two-dimensional arrays.
 wfArrayDiff2_cmp ($a, $b)
 wfArrayInsertAfter ($array, $insert, $after)
 Insert array into another array after the specified *KEY*.
 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.
 wfArrayMap ($function, $input)
 Wrapper around array_map() which also taints variables.
 wfArrayMerge ($array1)
 Backwards array plus for people who haven't bothered to read the PHP manual XXX: will not darn your socks for you.
 wfArrayToCGI ($array1, $array2=null, $prefix= '')
 This function takes two arrays as input, and returns a CGI-style string, e.g.
 wfAssembleUrl ($urlParts)
 This function will reassemble a URL parsed with wfParseURL.
 wfBacktrace ()
 Get a debug backtrace as a string.
 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.
 wfBaseName ($path, $suffix= '')
 Return the final portion of a pathname.
 wfBCP47 ($code)
 Get the normalised IETF language tag See unit test for examples.
 wfBoolToStr ($value)
 Convenience function converts boolean values into "true" or "false" (string) values.
 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.
 wfCheckEntropy ()
 Check if there is sufficent entropy in php's built-in session generation PHP's built-in session entropy is enabled if:
 wfCheckLimits ($deflimit=50, $optionname= 'rclimit')
 Obtain the offset and limit values from the request string; used in special pages.
 wfClearOutputBuffers ()
 More legible than passing a 'false' parameter to wfResetOutputBuffers():
 wfClientAcceptsGzip ($force=false)
 wfCountDown ($n)
 Count down from $n to zero on the terminal, with a one-second pause between showing each number.
 wfCreateObject ($name, $p)
 Create an object with a given name and an array of construct parameters.
 wfDebug ($text, $logonly=false)
 Sends a line to the debug log if enabled or, optionally, to a comment in output.
 wfDebugBacktrace ($limit=0)
 Safety wrapper for debug_backtrace().
 wfDebugDieBacktrace ($msg= '')
 Throw a debugging exception.
 wfDebugLog ($logGroup, $text, $public=true)
 Send a line to a supplementary debug log file, if configured, or main debug log if not.
 wfDebugMem ($exact=false)
 Send a line giving PHP memory usage.
 wfDebugTimer ()
 Get microsecond timestamps for debug logs.
 wfDeprecated ($function, $version=false, $component=false)
 Throws a warning that $function is deprecated.
 wfDiff ($before, $after, $params= '-u')
 Returns unified plain-text diff of two texts.
 wfDl ($extension, $fileName=null)
 Wrapper function for PHP's dl().
 wfDoUpdates ($commit= '')
 Do any deferred updates and clear the list.
 wfEmptyMsg ($key)
 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 checking the MessageCache::get() result directly.
 wfErrorLog ($text, $file)
 Log to a file without getting "file size exceeded" signals.
 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.
 wfEscapeWikiText ($text)
 Escapes the given text so that it may be output using addWikiText() without any linking, formatting, etc.
 wfExpandUrl ($url, $defaultProto=PROTO_CURRENT)
 Expand a potentially local URL to a fully-qualified URL.
 wfFindFile ($title, $options=array())
 Find a file.
 wfFixSessionID ()
 Override session_id before session startup if php's built-in session generation code is not secure.
 wfForeignMemcKey ($db, $prefix)
 Get a cache key for a foreign DB.
 wfFormatStackFrame ($frame)
 Return a string representation of frame.
 wfGenerateToken ($salt= '')
 Generate a random 32-character hexadecimal token.
 wfGetAllCallers ($limit=3)
 Return a string consisting of callers in the stack.
 wfGetCache ($inputType)
 Get a cache object.
 wfGetCaller ($level=2)
 Get the name of the function which called this function.
wfGetDB ($db, $groups=array(), $wiki=false)
 Get a Database object.
 wfGetLangObj ($langcode=false)
 Return a Language object from $langcode.
 wfGetLB ($wiki=false)
 Get a load balancer object.
wfGetLBFactory ()
 Get the load balancer factory object.
 wfGetMainCache ()
 Get the main cache object.
 wfGetMessageCacheStorage ()
 Get the cache object used by the message cache.
 wfGetNull ()
 Get a platform-independent path to the null file, e.g.
 wfGetParserCacheStorage ()
 Get the cache object used by the parser cache.
 wfGetPrecompiledData ($name)
 Get an object from the precompiled serialized directory.
 wfGetScriptUrl ()
 Get the script URL.
 wfHostname ()
 Fetch server name for use in error reporting etc.
 wfHttpError ($code, $label, $desc)
 Provide a simple HTTP error.
 wfHttpOnlySafe ()
 wfIncrStats ($key, $count=1)
 Increment a statistics counter.
 wfIniGetBool ($setting)
 Safety wrapper around ini_get() for boolean settings.
 wfInitShellLocale ()
 Workaround for http://bugs.php.net/bug.php?id=45132 escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale.
 wfIsDebugRawPage ()
 Returns true if debug logging should be suppressed if $wgDebugRawPage = false.
 wfIsHipHop ()
 Check if we are running under HipHop.
 wfIsWindows ()
 Check if the operating system is Windows.
 wfLoadExtensionMessages ()
 Load an extension messages file.
 wfLocalFile ($title)
 Get an object referring to a locally registered file.
 wfLogDBError ($text)
 Log for database errors.
 wfLogProfilingData ()
 wfMakeUrlIndexes ($url)
 Make URL indexes, appropriate for the el_index field of externallinks.
 wfMatchesDomainList ($url, $domains)
 Check whether a given URL has a domain that occurs in a given set of domains.
 wfMemcKey ()
 Get a cache key.
 wfMemoryLimit ()
 Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit;.
 wfMerge ($old, $mine, $yours, &$result)
 wfMerge attempts to merge differences between three texts.
 wfMergeErrorArrays ()
 Merge arrays in the style of getUserPermissionsErrors, with duplicate removal e.g.
 wfMessage ($key)
 This is the new function for getting translated interface messages.
 wfMessageFallback ()
 This function accepts multiple message keys and returns a message instance for the first message which is non-empty.
 wfMkdirParents ($dir, $mode=null, $caller=null)
 Make directory, and make all parent directories if they don't exist.
 wfMsg ($key)
 Get a message from anywhere, for the current user language.
 wfMsgExt ($key, $options)
 Returns message in the requested format.
 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.
 wfMsgGetKey ($key, $useDB=true, $langCode=false, $transform=true)
 Fetch a message string value, but don't replace any keys yet.
 wfMsgHtml ($key)
 Return an HTML-escaped version of a message.
 wfMsgNoTrans ($key)
 Same as above except doesn't transform the message.
 wfMsgReal ($key, $args, $useDB=true, $forContent=false, $transform=true)
 Really get a message.
 wfMsgReplaceArgs ($message, $args)
 Replace message parameter keys on the given formatted output.
 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).
 wfNegotiateType ($cprefs, $sprefs)
 Returns the 'best' match between a client's requested internet media types and the server's list of available types.
 wfObjectToArray ($objOrArray, $recursive=true)
 Recursively converts the parameter (an object) to an array with the same data.
 wfOut ($s)
 Used to be used for outputting text in the installer/updater.
 wfParseUrl ($url)
 parse_url() work-alike, but non-broken.
 wfPercent ($nr, $acc=2, $round=true)
 wfQueriesMustScale ()
 Should low-performance queries be disabled?
 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.
 wfReadOnly ()
 Check if the wiki read-only lock file is present.
 wfReadOnlyReason ()
 wfRecursiveRemoveDir ($dir)
 Remove a directory and all its content.
 wfRelativePath ($path, $from)
 Generate a relative path name to the given file.
 wfRemoveDotSegments ($urlPath)
 Remove all dot-segments in the provided URL path.
 wfReportTime ()
 Returns a HTML comment with the elapsed time since request.
 wfResetOutputBuffers ($resetGzipEncoding=true)
 Clear away any user-level output buffers, discarding contents.
 wfRestoreWarnings ()
 Restore error level to previous value.
 wfRunHooks ($event, $args=array())
 Call hook functions defined in $wgHooks.
 wfScript ($script= 'index')
 Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScriptExtension etc.
 wfSetBit (&$dest, $bit, $state=true)
 As for wfSetVar except setting a bit.
 wfSetupSession ($sessionId=false)
 Initialise php session.
 wfSetVar (&$dest, $source, $force=false)
 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 If force is true, it will set the value even if source is NULL.
 wfShellExec ($cmd, &$retval=null, $environ=array())
 Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported.
 wfShellMaintenanceCmd ($script, array $parameters=array(), array $options=array())
 Generate a shell-escaped command line string to run a maintenance script.
 wfShorthandToInteger ($string= '')
 Converts shorthand byte notation to integer form.
 wfShowingResults ($offset, $limit)
 wfSpecialList ($page, $details, $oppositedm=true)
 Make a list item, used by various special pages.
 wfSplitWikiID ($wiki)
 Split a wiki ID into DB name and table prefix.
 wfStreamFile ($fname, $headers=array())
 Stream a file to the browser.
 wfStripIllegalFilenameChars ($name)
 Replace all invalid characters with -.
 wfSuppressWarnings ($end=false)
 Reference-counted warning suppression.
 wfTempDir ()
 Tries to get the system directory for temporary files.
 wfTime ()
 Get the current unix timetstamp with microseconds.
 wfTimestamp ($outputtype=TS_UNIX, $ts=0)
 Get a timestamp string in one of various formats.
 wfTimestampNow ()
 Convenience function; returns MediaWiki timestamp for the present time.
 wfTimestampOrNull ($outputtype=TS_UNIX, $ts=null)
 Return a formatted timestamp, or null if input is null.
 wfUILang ()
 Old function when $wgBetterDirectionality existed Removed in core, kept in extensions for backwards compat.
 wfUnpack ($format, $data, $length=false)
 Wrapper around php's unpack.
 wfUrlencode ($s)
 We want some things to be included as literal characters in our title URLs for prettiness, which urlencode encodes by default.
 wfUrlProtocols ($includeProtocolRelative=true)
 Returns a regular expression of url protocols.
 wfUrlProtocolsWithoutProtRel ()
 Like wfUrlProtocols(), but excludes '//' from the protocol list.
 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.
 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.
 wfVarDump ($var)
 A wrapper around the PHP function var_export().
 wfViewPrevNext ($offset, $limit, $link, $query= '', $atend=false)
 Generate (prev x| next x) (20|50|100...) type links for paging.
 wfWaitForSlaves ($maxLag=false, $wiki=false)
 Modern version of wfWaitForSlaves().
 wfWarn ($msg, $callerOffset=1, $level=E_USER_NOTICE)
 Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
 wfWikiID ()
 Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.

Detailed Description

Global functions used everywhere.

Definition in file GlobalFunctions.php.


Enumeration Type Documentation

enum TS_DB

MySQL DATETIME (YYYY-MM-DD HH:MM:SS)

Definition at line 2250 of file GlobalFunctions.php.

enum TS_DB2

DB2 format time.

Definition at line 2286 of file GlobalFunctions.php.

enum TS_EXIF

An Exif timestamp (YYYY:MM:DD HH:MM:SS)

See also:
http://exif.org/Exif2-2.PDF The Exif 2.2 spec, see page 28 for the DateTime tag and page 36 for the DateTimeOriginal and DateTimeDigitized tags.

Definition at line 2271 of file GlobalFunctions.php.

ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.

This is used by Special:Export

Definition at line 2262 of file GlobalFunctions.php.

ISO 8601 basic format with no timezone: 19860209T200000Z.

This is used by ResourceLoader

Definition at line 2291 of file GlobalFunctions.php.

enum TS_MW

MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)

Definition at line 2245 of file GlobalFunctions.php.

enum TS_ORACLE

Oracle format time.

Definition at line 2276 of file GlobalFunctions.php.

Postgres format time.

Definition at line 2281 of file GlobalFunctions.php.

enum TS_RFC2822

RFC 2822 format, for E-mail and HTTP headers.

Definition at line 2255 of file GlobalFunctions.php.

enum TS_UNIX

Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.

Definition at line 2240 of file GlobalFunctions.php.


Function Documentation

in_string ( needle,
str,
insensitive = false 
)

Find out whether or not a mixed variable exists in a string.

Parameters:
$needleString
$strString
$insensitiveBoolean
Returns:
Boolean

Definition at line 2637 of file GlobalFunctions.php.

Referenced by GlobalTest\testInStringTest().

Here is the caller graph for this function:

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.

Parameters:
$typeString
$availArray
Returns:
string

Definition at line 2133 of file GlobalFunctions.php.

Referenced by GlobalTest\testMimeTypeMatch(), and wfNegotiateType().

Here is the caller graph for this function:

swap ( &$  x,
&$  y 
)

Swap two variables.

Parameters:
$xMixed
$yMixed

Definition at line 2471 of file GlobalFunctions.php.

Referenced by GlobalTest\testSwapVarsTest().

Here is the caller graph for this function:

wfAcceptToPrefs ( accept,
def = '*/*' 
)

Converts an Accept-* header into an array mapping string values to quality factors.

Parameters:
$acceptString
$defString default
Returns:
Array

Definition at line 2097 of file GlobalFunctions.php.

Referenced by RdfMetaData\setup().

Here is the caller graph for this function:

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.

Parameters:
$urlString
$queryMixed: string or associative array
Returns:
string

Definition at line 424 of file GlobalFunctions.php.

References $url, and wfArrayToCGI().

Referenced by OutputPage\addScriptFile(), ImportSiteScripts\execute(), ForeignAPIRepo\fetchImageQuery(), ImportSiteScripts\fetchScriptList(), FileRepo\getDescriptionRenderUrl(), OutputPage\getHeadLinks(), Title\getLocalURL(), Linker\getUploadUrl(), Linker\link(), ResourceLoader\makeLoaderURL(), Linker\makeThumbLink2(), and FileRepo\makeUrl().

Here is the call graph for this function:

Here is the caller graph for this function:

wfAppendToArrayIfNotDefault ( key,
value,
default,
&$  changed 
)

Appends to second array if $value differs from that in $default.

Parameters:
$keyString|Int
$valueMixed
$defaultMixed
$changedArray to alter

Definition at line 136 of file GlobalFunctions.php.

References $changed.

Referenced by SpecialWatchlist\execute().

Here is the caller graph for this function:

if (!defined( 'MEDIAWIKI')) wfArrayDiff2 ( a,
b 
)

Like array_diff( $a, $b ) except that it works with two-dimensional arrays.

Parameters:
$aarray
$barray
Returns:
array

Definition at line 88 of file GlobalFunctions.php.

Referenced by WikiPage\doRollback(), EditPage\getEditPermissionErrors(), GlobalTest\testWfArrayDiff2(), and UploadBase\verifyTitlePermissions().

Here is the caller graph for this function:

wfArrayDiff2_cmp ( a,
b 
)
Parameters:
$a
$b
Returns:
int

Definition at line 97 of file GlobalFunctions.php.

wfArrayInsertAfter ( array,
insert,
after 
)

Insert array into another array after the specified *KEY*.

Parameters:
$arrayArray: The array.
$insertArray: The array to insert.
$afterMixed: The key to insert after
Returns:
Array

Definition at line 203 of file GlobalFunctions.php.

References $keys, and $output.

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.

Parameters:
$aArray
$bArray
Returns:
array

Definition at line 124 of file GlobalFunctions.php.

wfArrayMap ( function,
input 
)

Wrapper around array_map() which also taints variables.

Parameters:
$functionCallback
$inputArray
Returns:
Array

Definition at line 249 of file GlobalFunctions.php.

References $input.

Referenced by Installer\envCheckShellLocale().

Here is the caller graph for this function:

wfArrayMerge ( array1)

Backwards array plus for people who haven't bothered to read the PHP manual XXX: will not darn your socks for you.

Parameters:
$array1Array
[$array2,[...]]Arrays
Returns:
Array

Definition at line 153 of file GlobalFunctions.php.

References $out.

wfArrayToCGI ( array1,
array2 = null,
prefix = '' 
)

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 null or false will not be output.

Parameters:
$array1Array ( String|Array )
$array2Array ( String|Array )
$prefixString
Returns:
String

Definition at line 332 of file GlobalFunctions.php.

Referenced by SpecialPage\addFeedLinks(), WebRequest\appendQueryArray(), SkinTemplate\buildPersonalUrls(), SpecialContributions\execute(), SpecialNewpages\execute(), PhpHttpRequest\execute(), RedirectSpecialPage\execute(), SpecialPageFactory\executePath(), Title\fixUrlQueryArgs(), WebInstaller_Options\getCCPartnerUrl(), FileRepo\getDescriptionStylesheetUrl(), FormAction\getForm(), FormSpecialPage\getForm(), ResourceLoaderStartUpModule\getScript(), ImageHandler\getScriptedTransform(), WebInstaller\getUrl(), SkinTemplate\outputPage(), PurgeAction\show(), OutputPage\showPermissionsErrorPage(), GlobalTest\testArrayToCGI(), GlobalTest\testArrayToCGI2(), GlobalTest\testCgiRoundTrip(), and wfAppendQuery().

Here is the caller graph for this function:

wfAssembleUrl ( urlParts)

This function will reassemble a URL parsed with wfParseURL.

This is useful if you need to edit part of a URL and put it back together.

This is the basic structure used (brackets contain keys for $urlParts): [scheme][delimiter][user]:[pass]@[host]:[port][path]?[query]#[fragment]

Todo:
Need to integrate this into wfExpandUrl (bug 32168)
Since:
1.19
Parameters:
$urlPartsArray URL parts, as output from wfParseUrl
Returns:
string URL assembled from its component parts

Definition at line 527 of file GlobalFunctions.php.

References $result.

Referenced by wfAssembleUrl\testWfAssembleUrl(), and wfExpandUrl().

Here is the caller graph for this function:

Get a debug backtrace as a string.

Returns:
string

Definition at line 1706 of file GlobalFunctions.php.

References $f, $file, $wgCommandLineMode, and wfDebugBacktrace().

Referenced by ApiBase\debugPrint(), MWDebug\deprecated(), and BackupReader\skippedNamespace().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$inputString: of digits
$sourceBaseInteger: 2-36
$destBaseInteger: 2-36
$padInteger: 1 or greater
$lowercaseBoolean
Returns:
String or false on invalid input

Definition at line 3195 of file GlobalFunctions.php.

References $input, and $n.

Referenced by LSLockManager\__construct(), DBLockManager\__construct(), NewParserTest\addDBData(), Revision\base36Sha1(), SwiftFileBackend\doCreateInternal(), SwiftFileBackend\doStoreInternal(), FileBackendTest\doTestDoOperations(), FileBackendTest\doTestDoOperationsFailing(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryRevisions\extractRowInfo(), FileBackendStore\getContainerSuffixes(), ApiQueryImageInfo\getInfo(), ForeignAPIFile\getSha1(), WikiRevision\getSha1(), FSFile\getSha1Base36(), StoreFileOp\getSourceSha1Base36(), CreateFileOp\getSourceSha1Base36(), User\randomPassword(), ApiQueryAllimages\run(), ParserTest\setupDatabase(), LockManager\sha1Base36(), and UploadStash\stashFile().

Here is the caller graph for this function:

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.

Parameters:
$pathString
$suffixString: to remove if present
Returns:
String

Definition at line 3112 of file GlobalFunctions.php.

References $matches, and $path.

Referenced by ImageBuilder\checkMissingImage(), FSFileBackend\getLocalCopy(), SwiftFileBackend\getLocalCopy(), wfBaseName\testBaseName(), wfRelativePath(), and wfStripIllegalFilenameChars().

Here is the caller graph for this function:

wfBCP47 ( code)

Get the normalised IETF language tag See unit test for examples.

Parameters:
$codeString: The language code.
Returns:
String: The language code which complying with BCP 47 standards.

Definition at line 3784 of file GlobalFunctions.php.

Referenced by Language\getHtmlCode(), CoreParserFunctions\language(), Preferences\profilePreferences(), and wfBCP47\testBCP47().

Here is the caller graph for this function:

wfBoolToStr ( value)

Convenience function converts boolean values into "true" or "false" (string) values.

Parameters:
$valueBoolean
Returns:
String

Definition at line 3608 of file GlobalFunctions.php.

Referenced by LocalSettingsGenerator\__construct(), ApiRsd\formatRsdApiList(), LocalSettingsGenerator\getDefaultText(), MysqlInstaller\getLocalSettings(), and GlobalTest\testClientAcceptsGzipTest().

Here is the caller graph for this function:

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.

Parameters:
$queryString: query string
Returns:
array Array version of input

Definition at line 377 of file GlobalFunctions.php.

References $keys.

Referenced by WebRequest\appendQuery(), Linker\makeBrokenImageLinkObj(), Linker\makeBrokenLinkObj(), Parser\makeKnownLinkHolder(), Linker\makeKnownLinkObj(), Linker\makeLinkObj(), GlobalTest\testCgiRoundTrip(), GlobalTest\testCgiToArray(), and wfViewPrevNext().

Here is the caller graph for this function:

Check if there is sufficent entropy in php's built-in session generation PHP's built-in session entropy is enabled if:

  • entropy_file is set or you're on Windows with php 5.3.3+
  • AND entropy_length is > 0 We treat it as disabled if it doesn't have an entropy length of at least 32
Returns:
bool true = there is sufficient entropy

Definition at line 3307 of file GlobalFunctions.php.

References wfIsWindows().

Referenced by LoginForm\renewSessionId(), and wfFixSessionID().

Here is the call graph for this function:

Here is the caller graph for this function:

wfCheckLimits ( deflimit = 50,
optionname = 'rclimit' 
)

Obtain the offset and limit values from the request string; used in special pages.

Parameters:
$deflimitInt default limit if none supplied
$optionnameString Name of a user preference to check against
Returns:
array

Definition at line 1904 of file GlobalFunctions.php.

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 2085 of file GlobalFunctions.php.

References wfResetOutputBuffers().

Referenced by OutputPage\checkLastModified().

Here is the call graph for this function:

Here is the caller graph for this function:

wfClientAcceptsGzip ( force = false)
Todo:

document

FIXME: We may want to blacklist some broken browsers

Parameters:
$forceBool
Returns:
bool Whereas client accept gzip compression

Definition at line 1870 of file GlobalFunctions.php.

References $result, and wfDebug().

Referenced by HTMLFileCache\loadFromFileCache(), HTMLFileCache\saveToFileCache(), GlobalTest\testClientAcceptsGzipTest(), and wfGzipHandler().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$nint

Definition at line 3675 of file GlobalFunctions.php.

References $n, and echo.

Referenced by ResetUserTokens\execute(), UpdateMediaWiki\execute(), and userOptions\warn().

Here is the caller graph for this function:

wfCreateObject ( name,
p 
)

Create an object with a given name and an array of construct parameters.

Parameters:
$nameString
$pArray: parameters
Returns:
object
Deprecated:
since 1.18, warnings in 1.18, removal in 1.20

Definition at line 3276 of file GlobalFunctions.php.

References MWFunction\newObj(), and wfDeprecated().

Here is the call graph for this function:

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.

Parameters:
$textString
$logonlyBool: set true to avoid appearing in HTML when $wgDebugComments is set

Definition at line 854 of file GlobalFunctions.php.

References $wgDebugComments, $wgDebugLogFile, $wgDebugLogPrefix, $wgDebugRawPage, $wgOut, $wgProfileOnly, $wgShowDebug, MWDebug\debugMsg(), wfDebugTimer(), wfErrorLog(), wfIsDebugRawPage(), and wfRunHooks().

Referenced by DBABagOStuff\__construct(), UploadFromChunks\__construct(), SearchUpdate\__construct(), UploadFromStash\__construct(), DifferenceEngine\__construct(), WikiXmlError\__construct(), ApiMain\__construct(), LocalisationCache\__construct(), MimeMagic\__construct(), Parser\__construct(), UploadStashFile\__construct(), MemCachedClientforWiki\_debugprint(), StubObject\_unstub(), LogPage\actionText(), ImageGallery\add(), MediaHandler\addMeta(), LoginForm\addNewAccountInternal(), LinkBatch\addObj(), LocalFileMoveBatch\addOlds(), Parser\addTrackingCategory(), Skin\afterContentHook(), LoginForm\attemptAutoCreate(), LoginForm\authenticateUserData(), AutoLoader\autoload(), Parser\braceSubstitution(), SkinTemplate\buildContentActionUrls(), CurlHttpRequest\canFollowRedirects(), EmailNotification\canSendUserTalkEmail(), AjaxResponse\checkLastModified(), OutputPage\checkLastModified(), UploadBase\checkSvgScriptCallback(), UploadBase\checkXMLEncodingMissmatch(), LocalRepo\cleanupDeletedBatch(), UploadBase\cleanupTempFile(), SpecialEditWatchlist\cleanupWatchlist(), UploadStash\clear(), CloneDatabase\cloneTableStructure(), Revision\compressRevisionText(), UploadFromChunks\concatenateChunks(), Article\confirmDelete(), DjVuImage\convertDumpToXML(), EhcacheBagOStuff\createCache(), UploadBase\createFromRequest(), DatabaseIbm_db2\dataSeek(), WikiImporter\debug(), BaseDump\debug(), RecompressTracked\debug(), BagOStuff\debug(), SVGReader\debug(), Profiler\debug(), Block\defaultRetroactiveAutoblock(), EhcacheBagOStuff\delete(), DBABagOStuff\delete(), Block\deleteIfExpired(), User\deleteNewtalk(), MimeMagic\detectMimeType(), UploadBase\detectScript(), UploadBase\detectVirus(), MimeMagic\detectZipType(), WikiDiff3\diff(), Parser\disableCache(), BitmapMetadataHandler\doApp13(), Block\doAutoblock(), FileBackendStore\doClean(), WikiPage\doDeleteArticleReal(), WikiPage\doEdit(), WikiPage\doEditUpdates(), MimeMagic\doGuessMimeType(), FileBackendStore\doPrepare(), WikiFilePage\doPurge(), DatabaseMssql\doQuery(), DatabaseOracle\doQuery(), EhcacheBagOStuff\doRequest(), Block\doRetroactiveAutoblock(), UserrightsPage\doSaveUserGroups(), FileBackendStore\doSecure(), BitmapHandler\doTransform(), DjVuHandler\doTransform(), HTMLCacheUpdate\doUpdate(), LoadBalancer\doWait(), WikiRevision\downloadSource(), MWCryptRand\driftHash(), DatabaseSqlite\duplicateTableStructure(), EditPage\edit(), ZipDirectoryReader\error(), SpecialUserlogout\execute(), ChangesFeed\execute(), SpecialUpload\execute(), CurlHttpRequest\execute(), PhpHttpRequest\execute(), LocalFileRestoreBatch\execute(), PoolWorkArticleView\fallback(), ExternalStoreDB\fetchBlob(), Article\fetchContent(), WikiDiff3\find_middle_snake(), Parser\findColonNoLinks(), RepoGroup\findFile(), FormatMetadata\flattenArray(), FileRepo\freeTemp(), EhcacheBagOStuff\get(), DBABagOStuff\get(), ParserCache\get(), Interwiki\getAllPrefixesCached(), User\getBlockedStatus(), PoolWorkArticleView\getCachedWork(), LoadBalancer\getConnection(), ContextSource\getContext(), SpecialPage\getContext(), Article\getContext(), File\getDescriptionText(), UploadStash\getFile(), FileBackendStore\getFileList(), FSFileBackend\getFileListInternal(), DoubleRedirectJob\getFinalDestination(), GenderCache\getGenderOf(), MediaHandler\getHandler(), DjVuImage\getInfo(), Interwiki\getInterwikiCacheEntry(), ParserCache\getKey(), DatabaseMysql\getLag(), BacklinkCache\getLinks(), BitmapHandler\getMagickVersion(), LoadBalancer\getMasterPos(), GIFHandler\getMetadata(), JpegHandler\getMetadata(), PNGHandler\getMetadata(), PNGMetadataExtractor\getMetadata(), GIFMetadataExtractor\getMetadata(), TiffHandler\getMetadata(), SvgHandler\getMetadata(), DjVuHandler\getMetadata(), DjVuHandler\getMetaTree(), DjVuImage\getMultiPageInfo(), SpecialPageFactory\getPage(), DjVuImage\getPageInfo(), WikiPage\getParserOutput(), SpecialEmailUser\getPermissionsError(), FSFile\getProps(), File\getPropsFromPath(), DisambiguationsPage\getQueryInfo(), DBABagOStuff\getReader(), LoadBalancer\getReaderIndex(), Title\getRestrictionTypes(), ExternalStoreDB\getSlave(), DatabaseBase\getSlavePos(), SpecialEmailUser\getTarget(), ForeignAPIRepo\getThumbUrl(), UploadStashFile\getThumbUrl(), ForeignAPIRepo\getThumbUrlFromCache(), NewParserTest\getUploadDir(), Parser\getUserSig(), Parser\getVariableValue(), File\getViewURL(), DBABagOStuff\getWriter(), XCFHandler\getXCFMetaData(), MimeMagic\guessMimeType(), SqlBagOStuff\handleWriteError(), MWCryptRand\hashAlgo(), OutputPage\haveCacheVaryCookies(), SquidUpdate\HTCPPurge(), ForeignAPIRepo\httpGet(), EditPage\importFormData(), WikiRevision\importLogItem(), WikiRevision\importOldRevision(), WikiRevision\importUpload(), MimeMagic\improveTypeFromExtension(), User\inDnsBlacklist(), ChronologyProtector\initLB(), Block\insert(), HTMLCacheUpdate\insertJobsFromTitles(), ExternalStore\insertToDefault(), DatabaseIbm_db2\installPrint(), Profiler\instance(), EditPage\internalAttemptSave(), User\isBlockedFrom(), FileCacheBase\isCacheGood(), SvgHandler\isEnabled(), DjVuHandler\isEnabled(), FileDependency\isExpired(), LocalisationCache\isExpired(), Block\isExpired(), ExifBitmapHandler\isMetadataValid(), PNGHandler\isMetadataValid(), GIFHandler\isMetadataValid(), Title\isValidMoveTarget(), Block\isWhitelistedFromAutoblocks(), MessageCache\load(), SiteStats\loadAndLazyInit(), ChangesFeed\loadFromCache(), HTMLFileCache\loadFromFileCache(), User\loadFromId(), AjaxResponse\loadFromMemcached(), User\loadFromSession(), User\loadOptions(), Revision\loadText(), DatabaseMysql\lock(), Linker\makeBrokenLink(), Linker\makeExternalImage(), Linker\makeExternalLink(), Linker\makeImageLink2(), DatabaseBase\masterPosWait(), User\matchEditToken(), Skin\newFromKey(), ImportStreamSource\newFromURL(), SVGReader\notice(), RawAction\onView(), CdbReader\open(), DatabaseMysql\open(), DatabaseMssql\open(), CdbWriter\open(), DatabasePostgres\open(), DatabaseIbm_db2\open(), LoadBalancer\openConnection(), DatabaseSqlite\openFile(), LoadBalancer\openForeignConnection(), UploadDumper\outputItem(), SkinTemplate\outputPage(), SearchMySQL\parseQuery(), SearchSqlite\parseQuery(), SearchPostgres\parseQuery(), BacklinkCache\partition(), DiffHistoryBlob\patch(), AjaxDispatcher\performAction(), ApiUpload\performStash(), User\pingLimiter(), SpecialUpload\processUpload(), LocalFile\purgeThumbList(), DatabaseBase\query(), SvgHandler\rasterize(), TextPassDumper\readDump(), TestFileIterator\readNextTest(), MWCryptRand\realGenerate(), LoadBalancer\reallyOpenConnection(), LocalisationCache\recache(), EnhancedChangesList\recentChangesLine(), LocalFile\recordUpload2(), UploadStash\removeFileNoAuth(), WikiPage\replaceSection(), Parser\replaceVariables(), DatabaseOracle\reportQueryError(), DatabaseBase\reportQueryError(), Http\request(), MediaWiki\restInPeace(), DjVuImage\retrieveMetaData(), LoadBalancer\reuseConnection(), DoubleRedirectJob\run(), RequestContext\sanitizeLangCode(), ParserCache\save(), FileCacheBase\saveText(), HTMLFileCache\saveToFileCache(), MessageCache\saveToLocal(), MessageCache\saveToScript(), SearchPostgres\searchQuery(), JpegMetadataExtractor\segmentSplitter(), UserMailer\send(), OutputPage\sendCacheControl(), RecentChange\sendToUDP(), UserMailer\sendWithPear(), EhcacheBagOStuff\set(), DBABagOStuff\set(), ApiMain\setCacheMode(), UploadFromUrlTestSuite\setupUploadDir(), ParserTest\setupUploadDir(), ChronologyProtector\shutdown(), ChronologyProtector\shutdownLB(), LoadBalancer\sleep(), User\spreadBlock(), UploadStash\stashFile(), FileRepo\storeBatch(), ParserTest\teardownDatabase(), GlobalTest\testDebugFunctionTest(), NewParserTest\testParserTest(), ApiUploadTest\testUploadChunks(), WikiImporter\throwXmlError(), SVGReader\throwXmlError(), MWTidy\tidy(), File\transform(), BitmapHandler\transformCustom(), BitmapHandler\transformGd(), BitmapHandler\transformImageMagick(), BitmapHandler\transformImageMagickExt(), RepoGroup\trimCache(), LocalisationCache_BulkLoad\trimCache(), SpecialUploadStash\tryClearStashedUploads(), Article\tryFileCache(), PageArchive\undelete(), PageArchive\undeleteRevisions(), Block\update(), UploadFromChunks\updateChunkStatus(), User\updateNewtalk(), OldLocalFile\upgradeRow(), LocalFile\upgradeRow(), HTMLFileCache\useFileCache(), LogEventsList\userCanBitfield(), Revision\userCanBitfield(), ImageHandler\validateThumbParams(), UploadBase\verifyExtension(), UploadBase\verifyFile(), UploadBase\verifyMimeType(), Article\view(), WikiImporter\warn(), SVGReader\warn(), wfClientAcceptsGzip(), wfDebugBacktrace(), wfDebugLog(), wfDebugMem(), wfDiff(), wfFixSessionID(), wfGetLangObj(), wfMemoryLimit(), wfMerge(), wfMkdirParents(), wfRecursiveRemoveDir(), wfShellExec(), wfTimestamp(), and wfWarn().

Here is the call graph for this function:

wfDebugBacktrace ( limit = 0)

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).

Parameters:
$limitint This parameter can be used to limit the number of stack frames returned
Returns:
array of backtrace information

Definition at line 1672 of file GlobalFunctions.php.

References $limit, and wfDebug().

Referenced by wfBacktrace(), wfGetAllCallers(), wfGetCaller(), and wfWarn().

Here is the call graph for this function:

Here is the caller graph for this function:

wfDebugDieBacktrace ( msg = '')

Throw a debugging exception.

This function previously once exited the process, but now throws an exception instead, with similar results.

Parameters:
$msgString: message shown when dying.

Definition at line 1608 of file GlobalFunctions.php.

Referenced by Language\checkTitleEncoding(), ApiBase\dieDebug(), GenerateSitemap\open(), and GenerateSitemap\write().

Here is the caller graph for this function:

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.

Parameters:
$logGroupString
$textString
$publicBool: whether to log the event in the public log if no private log file is specified, (default true)

Definition at line 950 of file GlobalFunctions.php.

References $wgDebugLogGroups, wfDebug(), wfErrorLog(), wfHostname(), wfRunHooks(), wfTimestamp(), and wfWikiID().

Referenced by UploadFromChunks\concatenateChunks(), IPTC\convIPTCHelper(), Exif\debug(), Exif\debugFile(), XMPReader\doAttribs(), MediaWiki\doJobs(), DjVuHandler\doTransform(), PoolWorkArticleView\doWork(), XMPReader\endElement(), XMPReader\endElementModeLi(), XMPReader\endElementNested(), CheckUsernames\execute(), LocalFileMoveBatch\execute(), ApiMain\executeActionWithErrorHandling(), PoolWorkArticleView\fallback(), ExternalStoreDB\fetchBlob(), IPTC\getCharset(), RequestContext\getLanguage(), LocalFileMoveBatch\getMoveTriplets(), MessageCache\getMsgFromNamespace(), LoadBalancer\getRandomNonLagged(), LoadBalancer\getReaderIndex(), SpecialSearch\goResult(), ExternalStore\insertToDefault(), EditPage\internalAttemptSave(), User\isCreatableName(), User\isValidUserName(), MagicWord\load(), MessageCache\loadFromDB(), User\loadFromSession(), SquidPurgeClient\log(), PoolCounterWork\logError(), BitmapHandler\logErrorForExternalProcess(), SwiftFileBackend\logException(), FileOp\logFailure(), LocalFile\move(), IPTC\parse(), XMPReader\parse(), XMPReader\parseExtended(), Preprocessor_Hash\preprocessToObj(), Preprocessor_DOM\preprocessToObj(), SvgHandler\rasterize(), MediaHandler\removeBadFile(), LocalFileMoveBatch\removeNonexistentFiles(), MWException\report(), SquidPurgeClientPool\run(), RunJobs\runJobsLog(), XMPReader\saveValue(), WebResponse\setcookie(), XMPReader\startElement(), XMPReader\startElementModeInitial(), XMPReader\startElementModeSeq(), XMPReader\startElementModeSimple(), IPTC\timeHelper(), XMPValidate\validateBoolean(), XMPValidate\validateClosed(), XMPValidate\validateDate(), XMPValidate\validateFlash(), XMPValidate\validateGPS(), XMPValidate\validateInteger(), XMPValidate\validateLangCode(), XMPValidate\validateRating(), XMPValidate\validateRational(), wfSetupSession(), and wfShellExec().

Here is the call graph for this function:

wfDebugMem ( exact = false)

Send a line giving PHP memory usage.

Parameters:
$exactBool: print exact values instead of kilobytes (default: false)

Definition at line 931 of file GlobalFunctions.php.

References wfDebug().

Referenced by GlobalTest\testDebugFunctionTest().

Here is the call graph for this function:

Here is the caller graph for this function:

Get microsecond timestamps for debug logs.

Returns:
string

Definition at line 914 of file GlobalFunctions.php.

References $wgDebugTimestamps, and $wgRequestTime.

Referenced by wfDebug().

Here is the caller graph for this function:

wfDeprecated ( function,
version = false,
component = false 
)

Throws a warning that $function is deprecated.

Parameters:
$functionString
$versionString|false: Added in 1.19.
$componentString|false: Added in 1.19.
Returns:
null

Definition at line 989 of file GlobalFunctions.php.

References $version, $wgDeprecationReleaseLimit, MWDebug\deprecated(), and wfWarn().

Referenced by SpecialPage\__call(), WikiError\__construct(), WikiErrorMsg\__construct(), StubContLang\__construct(), WikiXmlError\__construct(), RawPage\__construct(), OutputPage\__construct(), SearchEngine\acceptListRedirects(), HTMLForm\addJS(), SpecialPage\addPage(), CategoryViewer\addSubcategory(), MediaWiki\articleFromTitle(), EditPage\blockedPage(), Block\clear(), LoadBalancer\closeConnecton(), ApiBase\createContext(), WikiPage\createUpdates(), Block\decodeExpiry(), User\decodeOptions(), Article\doRedirect(), Article\doUnwatch(), Article\doWatch(), User\editToken(), Block\encodeExpiry(), Title\escapeCanonicalURL(), Title\escapeFullURL(), DatabaseBase\escapeLike(), Title\escapeLocalURL(), WikiPage\estimateRevisionCount(), SpecialPage\executePath(), SpecialPage\exists(), SpecialPage\file(), Title\fixUrlQueryArgs(), FormatExif\FormatExif(), Block\formatExpiry(), Article\forUpdate(), Block\forUpdate(), SpecialPage\func(), Title\getEscapedText(), Linker\getExternalLinkAttributes(), Language\getFallbackLanguageCode(), SpecialPage\getFile(), WebRequest\getFileSize(), Exif\getFormattedData(), SpecialPage\getGroup(), DatabaseMysql\getLagFromProcesslist(), ContextSource\getLang(), Action\getLang(), DerivativeContext\getLang(), RequestContext\getLang(), SpecialPage\getLang(), SpecialPage\getLocalNameFor(), SpecialPage\getPage(), SpecialPage\getPageByAlias(), User\getPageRenderingHash(), File\getPropsFromPath(), LegacyTemplate\getQuickbarCompensator(), SpecialPage\getRegularPages(), SpecialPage\getRestrictedPages(), ParserOptions\getSkin(), User\getSkin(), OutputPage\getStatusMessage(), SpecialPage\getTitleForAlias(), SpecialPage\getUsablePages(), ApiBase\getValidNamespaces(), MediaWikiTestCase\hideDeprecated(), SpecialPage\includable(), Block\infinity(), Article\info(), SpecialPage\initAliasList(), SpecialPage\initList(), WikiPage\isBigDeletion(), WikiError\isError(), MWNamespace\isMain(), OutputPage\isUserJsAllowed(), User\isValidEmailAddr(), ApiParse\languagesHtml(), Block\load(), Article\loadContent(), Preferences\loadOldSearchNs(), LogPage\logHeader(), LogPage\logName(), Linker\makeBrokenLink(), Linker\makeBrokenLinkObj(), Linker\makeColouredLinkObj(), Exif\makeFormattedData(), Skin\makeGlobalVariablesScript(), Linker\makeSizeLinkObj(), Article\markpatrolled(), SpecialPage\name(), Xml\namespaceSelector(), Block\newFromDB(), DatabaseBase\newFromParams(), DatabaseBase\newFromType(), ChangesList\newFromUser(), EditPage\noCreatePermission(), Block\normaliseRange(), Block\parseExpiryInput(), WikiPage\preSaveTransform(), WikiPage\quickEdit(), DatabaseBase\quote_ident(), EditPage\readOnlyPage(), OutputPage\reduceAllowedModules(), SpecialPage\removePage(), SpecialPage\resolveAlias(), SpecialPage\restriction(), Article\revert(), Revision\revText(), Article\rollback(), OutputPage\setAllowedModules(), ApiMain\setCachePrivate(), SpecialPage\setGroup(), DerivativeContext\setLang(), RequestContext\setLang(), ParserOptions\setSkin(), DatabaseBase\setTimeout(), ApiMain\setVaryCookie(), File\sha1Base36(), LogEventsList\showHeader(), EditPage\spamPage(), Article\unwatch(), Title\updateTitleProtection(), WikiPage\useParserCache(), Title\userCanEditCssSubpage(), Title\userCanEditJsSubpage(), Title\userCanRead(), EditPage\userNotLoggedInPage(), ImageGallery\useSkin(), WikiPage\viewUpdates(), Article\watch(), wfCreateObject(), wfDoUpdates(), wfGetAgent(), wfGetForwardedFor(), wfGetIP(), wfLoadExtensionMessages(), wfOut(), wfStreamFile(), wfUILang(), and wfViewPrevNext().

Here is the call graph for this function:

wfDiff ( before,
after,
params = '-u' 
)

Returns unified plain-text diff of two texts.

Useful for machine processing of diffs.

Parameters:
$beforeString: the text before the changes.
$afterString: the text after the changes.
$paramsString: command-line options for the diff command.
Returns:
String: unified diff of $before and $after

Definition at line 2993 of file GlobalFunctions.php.

References $wgDiff, wfDebug(), wfEscapeShellArg(), wfRestoreWarnings(), wfSuppressWarnings(), and wfTempDir().

Referenced by Parser_DiffTest\__call(), and CompareParsers\processRevision().

Here is the call graph for this function:

Here is the caller graph for this function:

wfDl ( extension,
fileName = null 
)

Wrapper function for PHP's dl().

This doesn't work in most situations from PHP 5.3 onward, and is usually disabled in shared environments anyway.

Parameters:
$extensionString A PHP extension. The file suffix (.so or .dll) should be omitted
$fileNameString Name of the library, if not $extension.suffix
Returns:
Bool - Whether or not the extension is loaded

Definition at line 2685 of file GlobalFunctions.php.

References wfIniGetBool(), wfIsWindows(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by MimeMagic\__construct(), DatabaseInstaller\checkExtension(), DifferenceEngine\initDiffEngines(), Sqlite\isPresent(), DatabaseMysql\open(), DatabaseIbm_db2\open(), BackupDumper\processArgs(), FormatMetadataTest\setUp(), XMPTest\setUp(), ExifTest\setUp(), JpegTest\setUp(), ExifBitmapTest\setUp(), ExifRotationTest\setUp(), TiffTest\testInvalidFile(), BitmapMetadataHandlerTest\testMultilingualCascade(), BitmapMetadataHandlerTest\testPNGXMP(), and TiffTest\testTiffMetadataExtraction().

Here is the call graph for this function:

Here is the caller graph for this function:

wfDoUpdates ( commit = '')

Do any deferred updates and clear the list.

Deprecated:
since 1.19
See also:
DeferredUpdates::doUpdate()
Parameters:
$commitstring

Definition at line 3176 of file GlobalFunctions.php.

References DeferredUpdates\doUpdates(), and wfDeprecated().

Here is the call graph for this function:

wfEmptyMsg ( key)

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 checking the MessageCache::get() result directly.

Parameters:
$keyString: the message key looked up
Returns:
Boolean True if the message *doesn't* exist.

Definition at line 1598 of file GlobalFunctions.php.

References MessageCache\singleton().

Referenced by SpecialRecentChanges\optionsPanel().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$textString
$fileString filename

Definition at line 1071 of file GlobalFunctions.php.

References $file, $size, IP\isIPv4(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by RecompressTracked\logToFile(), wfDebug(), wfDebugLog(), wfLogDBError(), and wfLogProfilingData().

Here is the call graph for this function:

Here is the caller graph for this function:

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)

Parameters:
varargs
Returns:
String

Definition at line 2722 of file GlobalFunctions.php.

References wfInitShellLocale(), and wfIsWindows().

Referenced by DumpPipeOutput\__construct(), CheckSyntax\buildFileList(), CheckSyntax\checkFileWithCli(), DumpPipeOutput\closeAndRename(), MimeMagic\detectMimeType(), UploadBase\detectVirus(), PopulateImageSha1\doDBUpdates(), DjVuHandler\doTransform(), DifferenceEngine\generateDiffBody(), BitmapHandler\getMagickVersion(), Installer\locateExecutable(), ParserTest\quickDiff(), SvgHandler\rasterize(), Maintenance\readlineEmulation(), CheckStorage\restoreText(), DjVuImage\retrieveMetaData(), Dump7ZipOutput\setup7zCommand(), RecompressTracked\startSlaveProcs(), SevenZipStream\stream_open(), BitmapHandler\transformCustom(), wfDiff(), wfMerge(), RandomImageGenerator\writeImageWithApi(), and RandomImageGenerator\writeImageWithCommandLine().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$textString: text to be escaped
Returns:
String

Definition at line 1918 of file GlobalFunctions.php.

Referenced by MediaHandler\addMeta(), CoreParserFunctions\basepagename(), CoreParserFunctions\basepagenamee(), Parser\braceSubstitution(), Article\delete(), LoginForm\displaySuccessfulLogin(), FileDeleteForm\doDelete(), Article\doDelete(), MovePageForm\doSubmit(), SpecialMergeHistory\execute(), FileDuplicateSearchPage\execute(), SpecialSearch\formHeader(), CoreParserFunctions\fullpagename(), CoreParserFunctions\fullpagenamee(), Parser\getUserSig(), Parser\getVariableValue(), SpecialPasswordReset\onSubmit(), ImagePage\openShowImage(), CoreParserFunctions\pagename(), CoreParserFunctions\pagenamee(), FileDeleteForm\prepareMessage(), LoginForm\processLogin(), ProtectionForm\show(), SpecialSearch\showCreateLink(), UserrightsPage\showEditUserGroupsForm(), EditPage\showIntro(), Article\showMissingArticle(), SpecialSearch\showResults(), EditPage\spamPage(), EditPage\spamPageWithContent(), CoreParserFunctions\subjectpagename(), CoreParserFunctions\subjectpagenamee(), CoreParserFunctions\subpagename(), CoreParserFunctions\subpagenamee(), CoreParserFunctions\talkpagename(), CoreParserFunctions\talkpagenamee(), and SpecialBlock\validateTargetField().

Here is the caller graph for this function:

wfExpandUrl ( url,
defaultProto = PROTO_CURRENT 
)

Expand a potentially local URL to a fully-qualified URL.

Assumes $wgServer is correct.

The meaning of the PROTO_* constants is as follows: PROTO_HTTP: Output a URL starting with http:// PROTO_HTTPS: Output a URL starting with https:// PROTO_RELATIVE: Output a URL starting with // (protocol-relative URL) PROTO_CURRENT: Output a URL starting with either http:// or https:// , depending on which protocol was used for the current incoming request PROTO_CANONICAL: For URLs without a domain, like /w/index.php , use $wgCanonicalServer. For protocol-relative URLs, use the protocol of $wgCanonicalServer PROTO_INTERNAL: Like PROTO_CANONICAL, but uses $wgInternalServer instead of $wgCanonicalServer

Todo:
this won't work with current-path-relative URLs like "subdir/foo.html", etc.
Parameters:
$urlString: either fully-qualified or a local path + query
$defaultProtoMixed: one of the PROTO_* constants. Determines the protocol to use if $url or $wgServer is protocol-relative
Returns:
string Fully-qualified URL, current-path-relative URL or false if no valid URL can be constructed

Definition at line 461 of file GlobalFunctions.php.

References $url, $wgCanonicalServer, $wgInternalServer, $wgServer, WebRequest\detectProtocol(), wfAssembleUrl(), wfParseUrl(), and wfRemoveDotSegments().

Referenced by ResourceLoaderFileModule\__construct(), MWHttpRequest\__construct(), ApiQuerySiteinfo\appendGeneralInfo(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendRightsInfo(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), MWHttpRequest\execute(), SquidUpdate\expand(), ApiQueryInfo\extractPageInfo(), CoreParserFunctions\filepath(), ApiParse\formatIWLinks(), ApiParse\formatLangLinks(), File\getCanonicalUrl(), Title\getCanonicalURL(), RevertFileAction\getFormFields(), WebRequest\getFullRequestURL(), File\getFullUrl(), Title\getFullURL(), OutputPage\getHeadLinks(), ApiQueryImageInfo\getInfo(), Title\getInternalURL(), ApiRsd\getRsdApiList(), ForeignAPIRepo\httpGet(), ResourceLoader\makeLoaderURL(), RevertFileAction\onSuccess(), RSSFeed\outHeader(), RSSFeed\outItem(), OutputPage\output(), ApiQuery\outputGeneralPageInfo(), SpecialUploadStash\outputRemoteScaledThumb(), ChannelFeed\outXmlHeader(), MediaWiki\performRequest(), FileDeleteForm\prepareMessage(), CSSMin\remap(), wfExpandUrl\testWfExpandUrl(), File\transform(), and wfProxyCheck().

Here is the call graph for this function:

Here is the caller graph for this function:

wfFindFile ( title,
options = array() 
)

Find a file.

Shortcut for RepoGroup::singleton()->findFile()

Parameters:
$titleString or Title object
$optionsAssociative 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.

ignoreRedirect: If true, do not follow file redirects

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

Returns:
File, or false if the file does not exist

Definition at line 3528 of file GlobalFunctions.php.

References $options, $title, and RepoGroup\singleton().

Referenced by SpecialUpload\ajaxGetExistsWarning(), UploadFromUrlTest\deleteFile(), ApiTestCaseUpload\deleteFileByTitle(), MovePageForm\doSubmit(), SpecialFilepath\execute(), ApiMove\execute(), DeleteBatch\execute(), FileDuplicateSearchPage\execute(), Parser\fetchFileAndTitle(), CoreParserFunctions\filepath(), SearchEngine\getNearMatchInternal(), SearchResult\initFromTitle(), Title\isAlwaysKnown(), WikiFilePage\loadFile(), ImagePage\loadFile(), Linker\makeBrokenImageLinkObj(), Linker\makeMediaLinkObj(), Linker\makeThumbLink2(), ApiQuery\outputGeneralPageInfo(), UploadDumper\outputItem(), LegacyTemplate\pageTitleLinks(), SpecialSearch\showHit(), LegacyTemplate\talkLink(), ImageGallery\toHTML(), and Title\validateFileMoveOperation().

Here is the call graph for this function:

Here is the caller graph for this function:

Override session_id before session startup if php's built-in session generation code is not secure.

Definition at line 3319 of file GlobalFunctions.php.

References MWCryptRand\generateHex(), wfCheckEntropy(), and wfDebug().

Referenced by wfSetupSession().

Here is the call graph for this function:

Here is the caller graph for this function:

wfForeignMemcKey ( db,
prefix 
)

Get a cache key for a foreign DB.

Parameters:
$dbString
$prefixString
varargsString
Returns:
String

Definition at line 3423 of file GlobalFunctions.php.

Referenced by UserRightsProxy\invalidateCache().

Here is the caller graph for this function:

wfFormatStackFrame ( frame)

Return a string representation of frame.

Parameters:
$frameArray
Returns:
Bool

Definition at line 1791 of file GlobalFunctions.php.

Referenced by wfGetCaller().

Here is the caller graph for this function:

wfGenerateToken ( salt = '')

Generate a random 32-character hexadecimal token.

Parameters:
$saltMixed: some sort of salt, if necessary, to add to random characters before hashing.
Returns:
string

Definition at line 3696 of file GlobalFunctions.php.

Referenced by UploadSourceAdapter\registerSource().

Here is the caller graph for this function:

wfGetAllCallers ( limit = 3)

Return a string consisting of callers in the stack.

Useful sometimes for profiling specific points.

Parameters:
$limitThe maximum depth of the stack frame to return, or false for the entire stack.
Returns:
String

Definition at line 1776 of file GlobalFunctions.php.

References $limit, and wfDebugBacktrace().

Referenced by MWCryptRand\realGenerate().

Here is the call graph for this function:

Here is the caller graph for this function:

wfGetCache ( inputType)

Get a cache object.

Parameters:
$inputTypeinteger Cache type, one the the CACHE_* constants.
Returns:
BagOStuff

Definition at line 3817 of file GlobalFunctions.php.

References ObjectCache\getInstance().

Referenced by MessageCache\__construct(), LCStore_Accel\__construct(), ResourceLoader\filter(), IcuCollation\getFirstLetterData(), MessageCache\getMostUsedMessages(), ForkController\initChild(), MessageCache\logMessages(), and ResourceLoaderModule\validateScriptFile().

Here is the call graph for this function:

Here is the caller graph for this function:

wfGetCaller ( level = 2)

Get the name of the function which called this function.

Parameters:
$levelInt
Returns:
Bool|string

Definition at line 1758 of file GlobalFunctions.php.

References wfDebugBacktrace(), and wfFormatStackFrame().

Referenced by StubObject\_unstub(), MWDebug\deprecated(), MWDebug\log(), Parser\parse(), and MWDebug\warning().

Here is the call graph for this function:

Here is the caller graph for this function:

& wfGetDB ( db,
groups = array(),
wiki = false 
)

Get a Database object.

Parameters:
$dbInteger: index of the connection to get. May be DB_MASTER for the master (for write queries), DB_SLAVE for potentially lagged read queries, or an integer >= 0 for a particular server.
$groupsMixed: query groups. An array of group names that this query belongs to. May contain a single string if the query is only in one group.
$wikiString: the wiki ID, or false for the current wiki

Note: multiple calls to wfGetDB(DB_SLAVE) during the course of one request will always return the same object, unless the underlying connection or load balancer is manually destroyed.

Note 2: use $this->getDB() in maintenance scripts that may be invoked by updater to ensure that a proper database is being updated.

Returns:
DatabaseBase

Definition at line 3485 of file GlobalFunctions.php.

References wfGetLB().

Referenced by SearchEngine\__construct(), DeletedContribsPager\__construct(), LinksUpdate\__construct(), Block\__construct(), CategoryPager\__construct(), ImageListPager\__construct(), IndexPager\__construct(), SiteStatsInit\__construct(), MergeHistoryPager\__construct(), ContribsPager\__construct(), OutputPage\addCategoryLinks(), User\addGroup(), LinkCache\addLinkObj(), ApiQueryLogEvents\addLogParams(), LogPage\addRelations(), ChangeTags\addTags(), User\addToDatabase(), WatchedItem\addWatch(), Job\batchInsert(), SpecialRecentChanges\buildMainQueryConds(), ImageBuilder\buildTable(), SiteStatsUpdate\cacheUpdate(), TitleListDependency\calculateTimestamps(), userOptions\CHANGER(), CheckStorage\check(), TrackBlobs\checkIntegrity(), SpecialRecentChanges\checkLastModified(), User\checkNewtalk(), Orphans\checkOrphans(), RevisionDeleter\checkRevisionExistence(), Orphans\checkSeparation(), RecompressTracked\checkTrackingTable(), Orphans\checkWidows(), CleanupSpam\cleanupArticle(), SpecialEditWatchlist\cleanupWatchlist(), MessageBlobStore\clear(), User\clearAllNotifications(), User\clearNotification(), SpecialEditWatchlist\clearWatchlist(), ViewCountUpdate\collect(), CgzCopyTransaction\commit(), WikiPage\commitRollback(), EditPage\commitWatch(), CompressOld\compressOldPages(), CompressOld\compressPage(), CompressOld\compressWithConcat(), Title\countAuthorsBetween(), SpecialWatchlist\countItems(), Title\countRevisionsBetween(), SearchEngine\create(), User\createNew(), ConvertLinks\createTempTable(), Block\defaultRetroactiveAutoblock(), Block\delete(), Article\delete(), DifferenceEngine\deletedLink(), RefreshLinks\deleteLinksFromNonexistent(), User\deleteNewtalk(), NukePage\deleteRevisions(), Title\deleteTitleProtection(), FixSlaveDesync\desyncFixPage(), SiteStatsInit\doAllAndCommit(), RecompressTracked\doAllOrphans(), RecompressTracked\doAllPages(), WikiPage\doCascadeProtectionUpdates(), CategoryViewer\doCategoryQuery(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateImageSha1\doDBUpdates(), DeleteArchivedFilesImplementation\doDelete(), DeleteArchivedRevisionsImplementation\doDelete(), DeleteOldRevisions\doDelete(), FileDeleteForm\doDelete(), WikiPage\doDeleteArticleReal(), WikiPage\doDeleteUpdates(), WatchedItem\doDuplicateEntries(), WikiPage\doEdit(), WikiPage\doEditUpdates(), SpecialExport\doExport(), SpecialRecentchangeslinked\doMainQuery(), SpecialRecentChanges\doMainQuery(), RecompressTracked\doOrphanList(), RecompressTracked\doPage(), PopulateCategory\doPopulateCategory(), WikiPage\doPurge(), GenderCache\doQuery(), LinkBatch\doQuery(), WikiPage\doQuickEdit(), ReassignEdits\doReassignEdits(), RefreshLinks\doRefreshLinks(), MovePageForm\doSubmit(), ViewCountUpdate\doUpdate(), SiteStatsUpdate\doUpdate(), WikiPage\doUpdateRestrictions(), DeferredUpdates\doUpdates(), UpdateSearchIndex\doUpdateSearchIndex(), LinkHolderArray\doVariants(), User\edits(), Title\estimateRevisionCount(), BenchmarkDeleteTruncate\execute(), StorageTypeStats\execute(), DumpRev\execute(), GetSlaveServer\execute(), DeleteRevision\execute(), FixUserRegistration\execute(), RebuildAll\execute(), RefreshImageCount\execute(), MwSql\execute(), CheckBadRedirects\execute(), CheckImages\execute(), DeleteDefaultMessages\execute(), CleanupSpam\execute(), ClearInterwikiCache\execute(), GetTextMaint\execute(), MigrateUserGroup\execute(), BatchedQueryRunner\execute(), UpdateLogging\execute(), ConvertUserOptions\execute(), DumpSisterSites\execute(), NukePage\execute(), RemoveUnusedAccounts\execute(), ResetUserTokens\execute(), ShowJobs\execute(), UpdateSpecialPages\execute(), ApiProtect\execute(), CheckUsernames\execute(), DeleteImageCache\execute(), DeleteOrphanedRevisions\execute(), OrphanStats\execute(), UpdateRestrictions\execute(), UpdateArticleCount\execute(), CleanupRemovedModules\execute(), DeleteSelfExternals\execute(), RenameDbPrefix\execute(), PatchSql\execute(), SpecialWatchlist\execute(), AttachLatest\execute(), FixTimestamps\execute(), InitStats\execute(), ShowStats\execute(), SpecialTags\execute(), FixDoubleRedirects\execute(), SpecialStatistics\execute(), FixBug20757\execute(), DeleteArchivedRevisions\execute(), DumpLinks\execute(), InitEditCount\execute(), AlterSharedConstraints\execute(), UpdateDoubleWidthSearch\execute(), FetchText\execute(), DeleteBatch\execute(), RebuildFileCache\execute(), RunJobs\execute(), ApiBlock\execute(), NamespaceConflictChecker\execute(), SqliteMaintenance\execute(), ConvertLinks\execute(), RebuildTextIndex\execute(), NukeNS\execute(), MoveBatch\execute(), ImageBuilder\execute(), RefreshImageMetadata\execute(), UpdateMediaWiki\execute(), GenerateSitemap\execute(), QueryPage\execute(), QueryPage\fetchFromCache(), UploadDumper\fetchLocal(), Revision\fetchRevision(), HistoryAction\fetchRevisions(), Parser\fetchScaryTemplateMaybeFromCache(), UploadDumper\fetchUsed(), TitleCleanup\fileExists(), TrackBlobs\findOrphanBlobs(), FixSlaveDesync\findPageLatestCorruption(), RecompressTracked\finishIncompleteMoves(), RefreshLinks\fixLinksFromArticle(), RefreshLinks\fixRedirect(), DoubleRedirectJob\fixRedirects(), Block\formatExpiry(), Language\formatExpiry(), DoubleRedirectsPage\formatResult(), SpecialProtectedtitles\formatRow(), SpecialProtectedpages\formatRow(), LCStore_DB\get(), Interwiki\getAllPrefixesDB(), WikiPage\getAutoDeleteReason(), EditPage\getBaseRevision(), Title\getBrokenLinksFrom(), QueryPage\getCachedTimestamp(), Title\getCascadeProtectionSources(), WikiPage\getContributors(), RevDel_RevisionList\getCurrent(), AllmessagesTablePager\getCustomisedStatuses(), Block\getDatabaseArray(), ResourceLoaderWikiModule\getDB(), SqlBagOStuff\getDB(), BacklinkCache\getDB(), UserRightsProxy\getDB(), ApiQuery\getDB(), Maintenance\getDB(), ApiBase\getDB(), ProtectionForm\getExpiry(), ResourceLoaderModule\getFileDependencies(), DoubleRedirectJob\getFinalDestination(), User\getFirstEditTimestamp(), Title\getFirstRevision(), User\getFormerGroups(), MessageBlobStore\getFromDB(), WikiPage\getHiddenCategories(), DeleteImageCache\getImageCount(), EditPage\getLastDelete(), WikiPage\getLastNAuthors(), PageArchive\getLastRevisionText(), SpecialExport\getLinks(), Title\getLinksFrom(), Title\getLinksTo(), ExternalUser\getLocalUser(), ForeignDBViaLBRepo\getMasterDB(), LocalRepo\getMasterDB(), Category\getMembers(), SpecialStatistics\getMostViewedPages(), ResourceLoaderModule\getMsgBlobMtime(), ApiQuery\getNamedDB(), Title\getNextRevisionID(), Title\getNotificationTimestamp(), SpecialExport\getPagesFromCategory(), SpecialExport\getPagesFromNamespace(), Title\getParentCategories(), nextJobDB\getPendingDbs(), PageArchive\getPreviousRevision(), Title\getPreviousRevisionID(), DisambiguationsPage\getQueryInfo(), NewFilesPager\getQueryInfo(), UsersPager\getQueryInfo(), WithoutInterwikiPage\getQueryInfo(), ActiveUsersPager\getQueryInfo(), ImageListPager\getQueryInfo(), LinkSearchPage\getQueryInfo(), ProtectedPagesPager\getQueryInfo(), Block\getRangeCond(), Title\getRedirectsHere(), WikiPage\getRedirectTarget(), PageArchive\getRevision(), FixBug20757\getRevTextMap(), RollbackEdits\getRollbackTitles(), ForeignDBViaLBRepo\getSlaveDB(), LocalRepo\getSlaveDB(), ResourceLoaderFileModule\getStyles(), Title\getSubpages(), HistoryBlobStub\getText(), HistoryBlobCurStub\getText(), TextPassDumper\getText(), TrackBlobs\getTextClause(), PageArchive\getTextFromRow(), Revision\getTimestampFromId(), Revision\getTitle(), Title\getTitleProtection(), Title\getTouched(), MessageBlobStore\getUpdatesForMessage(), SpecialEditWatchlist\getWatchlist(), SpecialEditWatchlist\getWatchlistInfo(), BackupReader\handleUpload(), User\idForName(), User\idFromName(), WikiImporter\importLogItem(), WikiRevision\importLogItem(), WikiRevision\importOldRevision(), WikiImporter\importRevision(), CheckStorage\importRevision(), WikiImporter\importUpload(), User\incEditCount(), Block\infinity(), Block\initFromRow(), Category\initialize(), BackupDumper\initProgress(), TrackBlobs\initTrackingTable(), Job\insert(), ManualLogEntry\insert(), Block\insert(), Job\insertFields(), MessageBlobStore\insertMessageBlob(), WikiPage\insertRedirectEntry(), User\invalidateCache(), Title\invalidateCache(), HTMLCacheUpdate\invalidateTitles(), WikiPage\isCountable(), PageArchive\isDeleted(), Title\isDeleted(), Title\isDeletedQuick(), RemoveUnusedAccounts\isInactiveAccount(), Title\isNewPage(), Title\isSingleRevRedirect(), Revision\isUnpatrolled(), WatchedItem\isWatched(), SiteStats\jobs(), ImageCleanup\killRow(), ExternalUser\linkToLocal(), PageArchive\listAllPages(), ChangeTags\listDefinedTags(), PageArchive\listFiles(), PageArchive\listPagesByPrefix(), PageArchive\listRevisions(), SiteStats\load(), ArchivedFile\load(), Interwiki\load(), SiteStats\loadAndLazyInit(), User\loadFromDatabase(), MessageCache\loadFromDB(), User\loadGroups(), User\loadOptions(), WikiPage\loadPageData(), Title\loadRestrictions(), Title\loadRestrictionsFromRows(), Revision\loadText(), Profiler\logData(), LinkFilter\makeLikeArray(), DifferenceEngine\markPatrolledLink(), SpecialMergeHistory\merge(), EditPage\mergeChangesInto(), SearchMySQL\minSearchLength(), TitleCleanup\moveIllegalPage(), TitleCleanup\moveInconsistentPage(), RecompressTracked\moveTextRow(), Title\moveTo(), moveToExternal(), Title\moveToInternal(), LinkSearchPage\mungeQuery(), Title\nameOf(), RecentChange\newFromConds(), Revision\newFromConds(), User\newFromConfirmationCode(), RecentChange\newFromId(), Block\newFromID(), Title\newFromID(), UserArray\newFromIDs(), Title\newFromIDs(), SquidUpdate\newFromLinksTo(), Revision\newFromPageId(), Revision\newFromTitle(), ExternalUser\newFromUser(), Block\newLoad(), EmailNotification\notifyOnPageChange(), SiteStats\numberingroup(), SpecialPasswordReset\onSubmit(), SkinTemplate\outputPage(), InfoAction\pageCountInfo(), SiteStats\pagesInNs(), SpecialBlock\parseExpiryInput(), ImageCleanup\pokeFile(), Job\pop(), Job\pop_type(), ResourceLoader\preloadModuleInfo(), Block\purgeExpired(), Title\purgeExpiredRestrictions(), PurgeList\purgeNamespace(), PurgeRedundantText(), purgeStaleMemcachedText(), ImagePage\queryImageLinks(), QueryPage\reallyDoQuery(), RecentChange\reallyMarkPatrolled(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass2(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), QueryPage\recache(), SiteStatsInit\refresh(), Category\refreshCounts(), RevDel_List\reloadFromMaster(), Job\removeDuplicates(), User\removeGroup(), WatchlistCleanup\removeWatch(), WatchedItem\removeWatch(), LinkHolderArray\replaceInternal(), WikiPage\replaceSection(), ImportReporter\reportPage(), RevisionListBase\reset(), MediaWikiTestCase\resetDB(), resolveStub(), resolveStubs(), CheckStorage\restoreText(), MediaWikiTestCase\run(), TableCleanup\runTable(), Job\safeBatchInsert(), RecentChange\save(), LogPage\saveContent(), User\saveOptions(), User\saveSettings(), RandomPage\selectRandomPageFromDB(), RevDel_RevisionItem\setBits(), RevDel_ArchiveItem\setBits(), RevDel_ArchivedRevisionItem\setBits(), RevDel_FileItem\setBits(), RevDel_ArchivedFileItem\setBits(), RevDel_LogItem\setBits(), DatabaseTest\setUp(), ParserTest\setupDatabase(), setupTestResources(), RevisionDeleteUser\setUsernameBitfields(), RevDel_List\setVisibility(), SpecialAllpages\showChunk(), MovePageForm\showForm(), SpecialWhatLinksHere\showIndirectLinks(), SpecialBlockList\showList(), SpecialPrefixindex\showPrefixChunk(), SpecialAllpages\showToplevel(), SpecialVersion\softwareInformation(), LCStore_DB\startWrite(), RecompressTracked\syncDBs(), teardownTestResources(), TitlePermissionTest\testActionPermissions(), DatabaseTest\testStoredFunctions(), TrackBlobs\trackOrphanText(), TrackBlobs\trackRevisions(), ResourceLoader\tryRespondFromFileCache(), PageArchive\undeleteRevisions(), SpecialEditWatchlist\unwatchTitles(), SearchIBM_DB2\update(), SearchOracle\update(), SearchSqlite\update(), SearchMySQL\update(), SiteStatsInit\update(), Block\update(), WikiPage\updateCategoryCounts(), MessageBlobStore\updateMessage(), MessageBlobStore\updateModule(), User\updateNewtalk(), Block\updateTimestamp(), SearchIBM_DB2\updateTitle(), SearchOracle\updateTitle(), SearchSqlite\updateTitle(), SearchMySQL\updateTitle(), userOptions\USAGER(), EditPage\userWasLastToEdit(), SpecialEditWatchlist\watchTitles(), SpecialRecentChanges\webOutput(), User\whoIs(), and User\whoIsReal().

Here is the call graph for this function:

wfGetLangObj ( langcode = false)

Return a Language object from $langcode.

Parameters:
$langcodeMixed: either:
  • a Language object
  • code of the language to get the message for, if it is a valid code create a language for that language, if it is a string but not a valid code then make a basic language object
  • a boolean: if it's false then use the global object for the current user's language (as a fallback for the old parameter functionality), or if it is true then use global object for the wiki's content language.
Returns:
Language object

Definition at line 1228 of file GlobalFunctions.php.

References $wgContLang, $wgLang, $wgLanguageCode, Language\factory(), Language\getLanguageNames(), and wfDebug().

Referenced by SpecialAllmessages\execute(), MessageCache\get(), Title\getPageLanguage(), DifferenceEngine\setTextLanguage(), and wfMsgExt().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the main cache object.

Returns:
BagOStuff

Definition at line 3826 of file GlobalFunctions.php.

References $wgMainCacheType, and ObjectCache\getInstance().

Referenced by DBLockManager\__construct(), LoadMonitor_MySQL\getLagTimes(), UploadFromUrlTestSuite\setUp(), NewParserTest\setUp(), and ParserTest\setUp().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the cache object used by the message cache.

Returns:
BagOStuff

Definition at line 3836 of file GlobalFunctions.php.

References $wgMessageCacheType, and ObjectCache\getInstance().

Referenced by UploadFromUrlTestSuite\setUp(), NewParserTest\setUp(), ParserTest\setUp(), and MessageCache\singleton().

Here is the call graph for this function:

Here is the caller graph for this function:

wfGetNull ( )

Get a platform-independent path to the null file, e.g.

/dev/null

Returns:
string

Definition at line 3627 of file GlobalFunctions.php.

References wfIsWindows().

Referenced by MWTidy\execExternalTidy(), Dump7ZipOutput\setup7zCommand(), and wfProxyCheck().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the cache object used by the parser cache.

Returns:
BagOStuff

Definition at line 3846 of file GlobalFunctions.php.

References $wgParserCacheType, and ObjectCache\getInstance().

Referenced by PurgeParserCache\execute(), UploadFromUrlTestSuite\setUp(), NewParserTest\setUp(), and ParserTest\setUp().

Here is the call graph for this function:

Here is the caller graph for this function:

wfGetPrecompiledData ( name)

Get an object from the precompiled serialized directory.

Parameters:
$nameString
Returns:
Mixed: the variable on success, false on failure

Definition at line 3387 of file GlobalFunctions.php.

References $blob, $file, and $IP.

Referenced by Language\getCaseMaps(), IcuCollation\getFirstLetterData(), and Language\transformUsingPairFile().

Here is the caller graph for this function:

Get the script URL.

Returns:
script URL

Definition at line 3583 of file GlobalFunctions.php.

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.

Returns:
string

Definition at line 1619 of file GlobalFunctions.php.

Referenced by DifferenceEngine\debug(), DjVuHandler\doTransform(), MWCryptRand\initialRandomState(), Profiler\logData(), BitmapHandler\logErrorForExternalProcess(), RecompressTracked\logToFile(), DatabaseMysql\open(), LoadBalancer\openForeignConnection(), SvgHandler\rasterize(), wfDebugLog(), wfLogDBError(), wfReportTime(), and wfThumbError().

Here is the caller graph for this function:

wfHttpError ( code,
label,
desc 
)

Provide a simple HTTP error.

Parameters:
$codeInt|String
$labelString
$descString

Definition at line 2000 of file GlobalFunctions.php.

References $wgOut, and print.

Referenced by AjaxDispatcher\performAction().

Here is the caller graph for this function:

Returns:
bool

Definition at line 3284 of file GlobalFunctions.php.

References $wgHttpOnlyBlacklist.

Referenced by WebResponse\setcookie(), and wfSetupSession().

Here is the caller graph for this function:

wfIncrStats ( key,
count = 1 
)
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

Parameters:
$settingString
Returns:
Bool

Definition at line 2667 of file GlobalFunctions.php.

Referenced by CurlHttpRequest\canFollowRedirects(), MWHttpRequest\canMakeRequests(), Installer\envCheckCache(), Installer\envCheckMagicQuotes(), Installer\envCheckMagicSybase(), Installer\envCheckMbstring(), Installer\envCheckRegisterGlobals(), Installer\envCheckSafeMode(), Installer\envCheckZE1(), MWHttpRequest\factory(), UploadBase\isEnabled(), ObjectCache\newAccelerator(), UserMailer\send(), WebInstaller\startSession(), wfDl(), wfInitShellLocale(), and wfShellExec().

Here is the caller graph for this function:

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 2871 of file GlobalFunctions.php.

References $wgShellLocale, and wfIniGetBool().

Referenced by wfEscapeShellArg(), and wfShellExec().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if debug logging should be suppressed if $wgDebugRawPage = false.

Definition at line 890 of file GlobalFunctions.php.

Referenced by wfDebug(), and wfLogProfilingData().

Here is the caller graph for this function:

Check if we are running under HipHop.

Returns:
Bool

Definition at line 2461 of file GlobalFunctions.php.

Referenced by UploadForm\getSourceSection(), and UploadBase\isEnabled().

Here is the caller graph for this function:

Load an extension messages file.

Deprecated:
since 1.16, warnings in 1.18, remove in 1.20

Definition at line 3618 of file GlobalFunctions.php.

References wfDeprecated().

Here is the call graph for this function:

wfLogDBError ( text)

Log for database errors.

Parameters:
$textString: database error message.

Definition at line 970 of file GlobalFunctions.php.

References $wgDBerrorLog, wfErrorLog(), wfHostname(), and wfWikiID().

Referenced by DatabaseMysql\open(), LoadMonitor_MySQL\postConnectionBackoff(), DatabaseBase\query(), LoadBalancer\reportConnectionError(), and DatabaseBase\reportQueryError().

Here is the call graph for this function:

Here is the caller graph for this function:

Todo:
document

Definition at line 1129 of file GlobalFunctions.php.

References $wgDebugLogFile, $wgDebugRawPage, $wgProfileLimit, $wgRequestTime, $wgUser, Profiler\instance(), wfErrorLog(), and wfIsDebugRawPage().

Referenced by MWExceptionHandler\handle(), and MediaWiki\restInPeace().

Here is the call graph for this function:

Here is the caller graph for this function:

wfMakeUrlIndexes ( url)

Make URL indexes, appropriate for the el_index field of externallinks.

Parameters:
$urlString
Returns:
array

Definition at line 773 of file GlobalFunctions.php.

References $url, and wfParseUrl().

Referenced by LinksUpdate\getExternalInsertions(), and GlobalTest\testMakeUrlIndexes().

Here is the call graph for this function:

Here is the caller graph for this function:

wfMatchesDomainList ( url,
domains 
)

Check whether a given URL has a domain that occurs in a given set of domains.

Parameters:
$urlstring URL
$domainsarray Array of domains (strings)
Returns:
bool True if the host part of $url ends in one of the strings in $domains

Definition at line 827 of file GlobalFunctions.php.

References $url, and wfParseUrl().

Referenced by Skin\addToSidebarPlain(), Parser\getExternalLinkAttribs(), and GlobalTest\testWfMatchesDomainList().

Here is the call graph for this function:

Here is the caller graph for this function:

wfMemcKey ( )

Get a cache key.

Parameters:
varargs
Returns:
String

Definition at line 3406 of file GlobalFunctions.php.

References $wgCachePrefix, and wfWikiID().

Referenced by LanguageConverter\__construct(), LoginForm\addNewAccountInternal(), Skin\buildSidebar(), FileCacheBase\cacheMissKey(), MessageCache\clear(), LoginForm\clearLoginThrottle(), User\clearSharedCache(), DeleteImageCache\execute(), CacheStats\execute(), SpecialStatistics\execute(), ChangesFeed\execute(), ResourceLoader\filter(), LCStore_Accel\finishWrite(), LCStore_Accel\get(), WikiPage\getCachedLastEditTime(), Skin\getCachedNotice(), DifferenceEngine\getDiffBody(), IcuCollation\getFirstLetterData(), DateFormatter\getInstance(), Interwiki\getInterwikiCacheEntry(), LoadMonitor_MySQL\getLagTimes(), MessageCache\getMostUsedMessages(), MessageCache\getMsgFromNamespace(), User\getNewtalk(), ParserCache\getOptionsKey(), ParserCache\getParserOutputKey(), LoginForm\incLoginThrottle(), FileCacheBase\incrMissesRecent(), Block\isWhitelistedFromAutoblocks(), ChangeTags\listDefinedTags(), Interwiki\load(), MessageCache\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(), purgeStaleMemcachedText(), MessageCache\replace(), User\saveToCache(), MessageCache\saveToCaches(), LCStore_Accel\set(), WikiPage\setCachedLastEditTime(), User\setNewtalk(), SpecialAllpages\showToplevel(), LCStore_Accel\startWrite(), ResourceLoaderModule\validateScriptFile(), wfIncrStats(), and wfProxyCheck().

Here is the call graph for this function:

Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit;.

Returns:
Integer value memory was set to.

Definition at line 3725 of file GlobalFunctions.php.

References $wgMemoryLimit, wfDebug(), wfRestoreWarnings(), wfShorthandToInteger(), and wfSuppressWarnings().

Here is the call graph for this function:

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.

Parameters:
$oldString
$mineString
$yoursString
$resultString
Returns:
Bool

Definition at line 2919 of file GlobalFunctions.php.

References $result, $wgDiff3, wfDebug(), wfEscapeShellArg(), wfRestoreWarnings(), wfSuppressWarnings(), and wfTempDir().

Referenced by WikiPage\getUndoText(), and EditPage\mergeChangesInto().

Here is the call graph for this function:

Here is the caller graph for this function:

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' ) )

Parameters:
varargs
Returns:
Array

Definition at line 181 of file GlobalFunctions.php.

References $out.

Referenced by SpecialImport\execute(), Title\isValidMoveOperation(), and DifferenceEngine\showDiffPage().

Here is the caller graph for this function:

wfMessage ( key)

This is the new function for getting translated interface messages.

See the Message class for documentation how to use them. The intention is that this function replaces all old wfMsg* functions.

Parameters:
$key String : Message key. Varargs: normal message parameters.
Returns:
Message
Since:
1.17

Definition at line 1283 of file GlobalFunctions.php.

Referenced by MediaTransformError\__construct(), HTMLSelectAndOtherField\__construct(), MediaHandler\addMeta(), Parser\addTrackingCategory(), SpecialPasswordReset\alterForm(), ProtectionForm\buildCleanupScript(), ProtectionForm\buildForm(), Title\checkUserBlock(), Article\confirmDelete(), LanguageConverter\convertTitle(), MonoBookTemplate\customBox(), Article\delete(), EditPage\displayPermissionsError(), Article\doDelete(), MovePageForm\doSubmit(), ApiQueryTags\doTag(), SpecialTags\doTagRow(), SpecialJavaScriptTest\execute(), SpecialUserlogout\execute(), ApiQueryAllmessages\execute(), SpecialStatistics\execute(), FileDeleteForm\execute(), SpecialListGroupRights\execute(), SpecialListUsers\execute(), LogPage\formatBlockFlag(), ResourceLoader\formatException(), Language\formatExpiry(), SpecialStatistics\formatRow(), SpecialNewpages\formatRow(), Language\formatTimePeriod(), Skin\getCategoryLinks(), ResourceLoaderWikiModule\getContent(), CategoryViewer\getCountMessage(), Title\getDefaultMessageText(), Interwiki\getDescription(), LogPage\getDescription(), ImageHandler\getDimensionsString(), UploadBase\getFilenamePrefixBlacklist(), NewFilesPager\getForm(), SpecialJavaScriptTest\getFrameworkListHtml(), MediaHandler\getGeneralLongDesc(), SpecialPageFactory\getGroup(), User\getGroupMember(), User\getGroupName(), User\getGroupPage(), SpecialStatistics\getGroupStats(), MediaHandler\getLongDesc(), ImageHandler\getLongDesc(), Interwiki\getName(), LogPage\getName(), ProtectionForm\getOptionLabel(), WantedFilesPage\getPageHeader(), SpecialWhatLinksHere\getPrevNext(), RawAction\getRawText(), Block\getRedactedName(), User\getRightDescription(), ImageHandler\getShortDesc(), SpecialBlock\getSuggestedDurations(), HTMLFormField\getTableRow(), HTMLEditTools\getTableRow(), SpecialUpload\getUploadForm(), Parser\getUserSig(), Language\getVariantname(), UserrightsPage\groupCheckboxes(), Title\hasSourceText(), ImagePage\imageLinks(), SpecialJavaScriptTest\initQUnitTesting(), DifferenceEngine\intermediateEditsMsg(), CoreParserFunctions\intFunction(), ImagePage\makeSizeLink(), Licenses\msg(), LogFormatter\msg(), EditPage\noSuchSectionPage(), WikiImporter\notice(), Language\numLink(), SpecialPasswordReset\onSubmit(), RollbackAction\onView(), ImagePage\openShowImage(), CategoryViewer\pagingLinks(), HTMLSelectAndOtherField\parseMessage(), PurgeAction\postText(), PurgeAction\preText(), SpecialPasswordReset\preText(), WatchAction\preText(), UnwatchAction\preText(), SpecialUpload\processVerificationError(), Parser\pstPass2(), CologneBlueTemplate\quickBar(), AllmessagesTablePager\reallyDoQuery(), VectorTemplate\renderPortal(), FileDeleteForm\setHeaders(), EditPage\setHeaders(), Article\setOldSubtitle(), RdfMetaData\setup(), ProtectionForm\show(), ChangesList\showCharacterDifference(), EditPage\showEditTools(), UserrightsPage\showEditUserGroupsForm(), ImagePage\showError(), EditPage\showHeader(), Article\showNamespaceHeader(), Article\showRedirectedFromHeader(), EditPage\showTosSummary(), EditPage\spamPage(), EditPage\spamPageWithContent(), UploadStash\stashFile(), Parser\statelessFetchTemplate(), ChangeTags\tagDescription(), MessageTest\testExists(), MessageTest\testInContentLanguage(), MessageTest\testInLanguage(), MessageTest\testInLanguageThrows(), MessageTest\testKey(), MessageTest\testMessageParams(), MessageTest\testMessageParamSubstitution(), SpecialEmailUser\userForm(), ImagePage\view(), Article\view(), and Language\viewPrevNext().

This function accepts multiple message keys and returns a message instance for the first message which is non-empty.

If all messages are empty then an instance of the first message key is returned.

Parameters:
varargs,:message keys
Returns:
Message
Since:
1.18

Definition at line 1300 of file GlobalFunctions.php.

References MWFunction\callArray().

Referenced by SkinTemplate\buildContentNavigationUrls(), FileRepo\getDisplayName(), and SkinTemplate\tabAction().

Here is the call graph for this function:

Here is the caller graph for this function:

wfMkdirParents ( dir,
mode = null,
caller = null 
)

Make directory, and make all parent directories if they don't exist.

Parameters:
$dirString: full path to directory to create
$modeInteger: chmod value to use, default is $wgDirectoryMode
$callerString: optional caller param for debugging.
Returns:
bool

Definition at line 2511 of file GlobalFunctions.php.

References $dir, $ok, $wgDirectoryMode, FileBackend\isStoragePath(), wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by FileCacheBase\checkCacheDirs(), SqliteInstaller\dataDirOKmaybeCreate(), FSFileBackend\doPrepareInternal(), FSLockManager\doSingleLock(), SvgHandler\doTransform(), BitmapHandler\doTransform(), DjVuHandler\doTransform(), GenerateSitemap\init_path(), ImageCleanup\pokeFile(), MessageCache\saveToLocal(), MessageCache\saveToScript(), UploadFromUrlTestSuite\setupUploadDir(), ParserTest\setupUploadDir(), and LCStore_CDB\startWrite().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$keyString: lookup key for the message, usually defined in languages/Language.php

Parameters to the message, which can be used to insert variable text into it, can be passed to this function in the following formats:

  • One per argument, starting at the second parameter
  • As an array in the second parameter These are not shown in the function definition.
Returns:
String

Definition at line 1322 of file GlobalFunctions.php.

References wfMsgReal().

Referenced by ErrorPageError\__construct(), TransformParameterError\__construct(), UserBlockedError\__construct(), UploadForm\__construct(), HTMLSelectOrOtherField\__construct(), RevertFileAction\alterForm(), PurgeAction\alterForm(), WatchAction\alterForm(), UnwatchAction\alterForm(), RdfMetaData\basics(), ImageHistoryList\beginImageHistoryList(), SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), Xml\buildForm(), Linker\buildRollbackLink(), ChangeTags\buildTagFilterSelector(), SpecialEditWatchlist\buildTools(), SpecialRecentChanges\categoryFilterForm(), Title\checkSpecialsAndNSPermissions(), Title\checkUserBlock(), FormatMetadata\collapseContactInfo(), LegacyTemplate\commentLink(), Article\confirmDelete(), Xml\dateMenu(), LegacyTemplate\deleteThisPage(), UploadBase\detectVirus(), CologneBlueTemplate\doAfterContent(), CologneBlueTemplate\doBeforeContent(), SpecialRecentChanges\doHeader(), MovePageForm\doSubmit(), SvgHandler\doTransform(), DjVuHandler\doTransform(), EnhancedChangesList\downArrow(), LegacyTemplate\editThisPage(), WebInstallerPage\endForm(), Installer\envCheckDB(), DumpMessages\execute(), CleanupSpam\execute(), SpecialUnblock\execute(), SpecialExport\execute(), SpecialListGroupRights\execute(), LinkSearchPage\execute(), MoveBatch\execute(), MIMEsearchPage\execute(), SpecialEmailUser\execute(), WebInstaller_DBConnect\execute(), WebInstaller_Name\execute(), SpecialNewpages\form(), FormatMetadata\formatCoords(), FeedUtils\formatDiffRow(), MIMEsearchPage\formatResult(), SpecialProtectedtitles\formatRow(), SpecialProtectedpages\formatRow(), SpecialNewpages\formatRow(), Linker\formatTemplates(), ImageListPager\formatValue(), SpecialSearch\formHeader(), User\getBlockedStatus(), HTMLForm\getButtons(), SpecialProtectedpages\getCascadeCheck(), WebInstaller_Options\getCCDoneBox(), WebInstaller\getCheckBox(), EditPage\getCheckboxes(), OracleInstaller\getConnectForm(), PostgresInstaller\getConnectForm(), Ibm_db2Installer\getConnectForm(), MysqlInstaller\getConnectForm(), DBQueryError\getContentMessage(), SpecialVersion\getCopyrightAndAuthorList(), SpecialVersion\getCreditsForExtension(), UnwatchAction\getDescription(), EditPage\getEditButtons(), EditPage\getEditToolbar(), SpecialProtectedpages\getExpiryCheck(), SpecialVersion\getExtensionCredits(), SpecialVersion\getExtensionTypes(), LogEventsList\getExtraInputs(), SpecialRecentchangeslinked\getExtraOptions(), ImageListPager\getFieldNames(), SpecialWhatLinksHere\getFilterPanel(), NewFilesPager\getForm(), ImageListPager\getForm(), FormatMetadata\getFormattedData(), RevDel_FileItem\getHTML(), CategoryViewer\getImageSection(), WebInstaller\getInfoBox(), Licenses\getInputHTML(), DatabaseInstaller\getInstallUserBox(), Status\getItemXML(), HTMLForm\getLegend(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), RevisionDeleter\getLogLinks(), SpecialVersion\getMediaWikiCredits(), SpecialProtectedtitles\getNamespaceMenu(), SpecialProtectedpages\getNamespaceMenu(), ProtectionForm\getOptionLabel(), WithoutInterwikiPage\getPageHeader(), UsersPager\getPageHeader(), WebInstaller\getPageListItem(), CategoryViewer\getPagesSection(), RevertFileAction\getPageTitle(), EditPage\getPreviewText(), DatabaseInstaller\getReadableName(), DatabaseSqlite\getServerInfo(), MysqlInstaller\getSettingsForm(), SpecialProtectedpages\getSizeLimit(), TablePager\getStartBody(), CategoryViewer\getSubcategorySection(), HTMLForm\getSubmitText(), ImageHistoryList\getThumbForLine(), LogEventsList\getTitleInput(), LogEventsList\getTitlePattern(), SpecialProtectedpages\getTypeMenu(), LogEventsList\getUserInput(), SpecialVersion\getVersion(), SpecialVersion\getVersionLinked(), DatabaseInstaller\getWebUserBox(), SpecialVersion\getWgHooks(), ImagePage\imageDupes(), FormatMetadata\langItem(), Xml\languageSelector(), ApiParse\languagesHtml(), UploadFromUrlJob\leaveMessage(), Linker\linkAttribs(), SpecialVersion\listAuthors(), LogPage\logName(), SpecialSearch\makeSearchLink(), Linker\makeThumbLink2(), CologneBlueTemplate\menuHead(), Xml\monthSelector(), LegacyTemplate\moveThisPage(), FormatMetadata\msg(), LegacyTemplate\nameAndLogin(), SpecialRecentChanges\namespaceFilterForm(), SpecialPrefixindex\namespacePrefixForm(), SearchEngine\namespacesAsText(), Html\namespaceSelector(), RollbackAction\onView(), ImagePage\openShowImage(), SpecialRecentChanges\optionsPanel(), LegacyTemplate\otherLanguages(), WebInstallerOutput\outputTitle(), LegacyTemplate\pageTitleLinks(), SpecialSearch\powerSearchBox(), LegacyTemplate\printableLink(), LegacyTemplate\protectThisPage(), StandardTemplate\quickBar(), CologneBlueTemplate\quickBar(), EnhancedChangesList\recentChangesBlockGroup(), UploadFromUrlJob\run(), LegacyTemplate\searchForm(), CologneBlueTemplate\searchForm(), User\sendConfirmationMail(), User\setPassword(), SpecialSearch\shortDialog(), EditPage\showConflict(), EditPage\showEditForm(), UserrightsPage\showEditUserGroupsForm(), SpecialFilepath\showForm(), MovePageForm\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialSearch\showHit(), SpecialSearch\showInterwiki(), SpecialSearch\showInterwikiHit(), SpecialMergeHistory\showMergeForm(), LogEventsList\showOptions(), SpecialProtectedtitles\showOptions(), SpecialProtectedpages\showOptions(), SpecialUpload\showRecoverableUploadError(), SpecialPreferences\showResetForm(), SpecialSearch\showResults(), EditPage\showStandardInputs(), SpecialUploadStash\showUploads(), SpecialUpload\showUploadWarning(), EnhancedChangesList\sideArrow(), SpecialVersion\softwareInformation(), EditPage\spamPageWithContent(), Linker\specialLink(), LegacyTemplate\specialPagesList(), WebInstaller\startPageWrapper(), WebInstaller_Install\startStage(), SpecialEmailUser\submit(), WebInstaller_Name\submit(), WebInstaller_Options\submit(), UserrightsPage\switchForm(), CologneBlueTemplate\sysLinks(), LegacyTemplate\talkLink(), File\transformErrorOutput(), BitmapHandler\transformGd(), MediaWiki_I18N\translate(), SpecialRevisionDelete\tryShowFile(), ImagePage\uploadLinksBox(), ImagePage\view(), LegacyTemplate\watchPageLinksLink(), LegacyTemplate\watchThisPage(), wfStreamThumb(), and SpecialWhatLinksHere\whatlinkshereForm().

Here is the call graph for this function:

wfMsgExt ( key,
options 
)

Returns message in the requested format.

Parameters:
$keyString: key of the message
$optionsArray: 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 &#160; 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). Behavior for conflicting options (e.g., parse+parseinline) is undefined.
Returns:
String

Definition at line 1520 of file GlobalFunctions.php.

References $options, Sanitizer\escapeHtmlAllowEntities(), MessageCache\singleton(), wfGetLangObj(), wfMsgGetKey(), wfMsgReplaceArgs(), and wfWarn().

Referenced by HTMLFormField\__construct(), LogPage\actionText(), LegacyTemplate\bottomLinks(), Xml\buildForm(), ChangeTags\buildTagFilterSelector(), ImportReporter\close(), Language\commaList(), EmailNotification\composeCommonMailtext(), Article\confirmDelete(), Article\delete(), Skin\doEditSectionLink(), MovePageForm\doSubmit(), SpecialTags\doTagRow(), UsercreateTemplate\execute(), SpecialUnblock\execute(), SpecialTags\execute(), SpecialExport\execute(), SpecialMergeHistory\execute(), SpecialEmailUser\execute(), LegacyTemplate\extensionTabLinks(), SpecialNewpages\feed(), Article\fetchContent(), ChangesList\flag(), Linker\formatAutocommentsCallback(), HTMLForm\formatErrors(), Linker\formatHiddenCategories(), SpecialListGroupRights\formatPermissions(), Linker\formatRevisionSize(), UsersPager\formatRow(), Linker\formatTemplates(), SpecialSearch\formHeader(), MessageBlobStore\generateMessageBlob(), EditPage\getCancelLink(), EditPage\getCheckboxes(), Article\getContent(), SpecialUpload\getDupeWarning(), SpecialStatistics\getEditStats(), SpecialUpload\getExistsWarning(), UploadForm\getExtensionsMessage(), SpecialEmailUser\getFormFields(), RevertFileAction\getFormFields(), CategoryViewer\getHTML(), RevDel_FileItem\getHTML(), LogFormatter\getIRCActionText(), PNGHandler\getLongDesc(), GIFHandler\getLongDesc(), SvgHandler\getLongDesc(), CliInstaller\getMessageText(), SpecialStatistics\getMostViewedPages(), AlphabeticPager\getNavigationBar(), ReverseChronologicalPager\getNavigationBar(), SpecialStatistics\getOtherStats(), LonelyPagesPage\getPageHeader(), UnusedtemplatesPage\getPageHeader(), UnusedimagesPage\getPageHeader(), SpecialStatistics\getPageStats(), UploadForm\getSourceSection(), EditPage\getSummaryPreview(), SpecialUpload\getUploadForm(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), ApiParse\languagesHtml(), Parser\limitationWarn(), SpecialWhatLinksHere\listItem(), LogPage\logHeader(), SpecialMergeHistory\merge(), EditPage\noSuchSectionPage(), ChangesList\numberofWatchingusers(), SpecialLockdb\onSubmit(), RevertFileAction\onSuccess(), RollbackAction\onView(), ImagePage\openShowImage(), SpecialRecentChanges\optionsPanel(), LegacyTemplate\otherLanguages(), LegacyTemplate\pageSubtitle(), RdfMetaData\person(), Language\pipeList(), SpecialSearch\powerSearchBox(), LogEventsList\preCacheMessages(), SpecialMergeHistory\preCacheMessages(), ChangesList\preCacheMessages(), FileDeleteForm\prepareMessage(), SpecialUpload\processUpload(), SpecialUpload\processVerificationError(), EnhancedChangesList\recentChangesBlockGroup(), OldChangesList\recentChangesLine(), MessageBlobStore\reencodeBlob(), ImportReporter\reportPage(), Language\semicolonList(), Article\setOldSubtitle(), User\setPassword(), ChangesList\showCharacterDifference(), EditPage\showConflict(), EditPage\showDiff(), EditPage\showEditForm(), MovePageForm\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), LogEventsList\showHeader(), SpecialMergeHistory\showHistory(), SpecialSearch\showHit(), LogEventsList\showLogExtract(), SpecialPrefixindex\showPrefixChunk(), EditPage\showStandardInputs(), EditPage\showSummaryInput(), SpecialUpload\showUploadWarning(), SpecialUpload\showViewDeletedLinks(), EditPage\spamPageWithContent(), Language\specialList(), SpecialEmailUser\submit(), Linker\tocList(), LegacyTemplate\topLinks(), Language\truncate(), Language\truncateHtml(), PageArchive\undelete(), ImagePage\uploadLinksBox(), HTMLFormField\validate(), HTMLFloatField\validate(), HTMLIntField\validate(), HTMLSelectField\validate(), HTMLMultiSelectField\validate(), HTMLSelectAndOtherField\validate(), HTMLRadioField\validate(), wfShowingResults(), and OutputPage\wrapWikiMsg().

Here is the call graph for this function:

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 potentially hundreds of messages in order to, e.g., fix a link in every possible language.

Parameters:
$keyString: lookup key for the message, usually defined in languages/Language.php
Returns:
String

Definition at line 1363 of file GlobalFunctions.php.

References $wgForceUIMsgAsContentMsg, and wfMsgReal().

Referenced by Licenses\__construct(), User\addNewUserLogEntry(), Parser\braceSubstitution(), ProtectionForm\buildForm(), CleanupSpam\cleanupArticle(), WikiPage\commitRollback(), EmailNotification\composeCommonMailtext(), Article\confirmDelete(), Installer\createMainpage(), CoreParserFunctions\defaultsort(), Article\delete(), Block\doAutoblock(), FileDeleteForm\doDelete(), WikiPage\doUpdateRestrictions(), ApiEditPage\execute(), FileDeleteForm\execute(), ApiFeedContributions\execute(), ApiFeedWatchlist\execute(), WebInstaller_Name\execute(), HistoryAction\feed(), HistoryAction\feedEmpty(), HistoryAction\feedItem(), ApiFeedContributions\feedItemDesc(), SpecialNewpages\feedItemDesc(), Parser\fetchScaryTemplateMaybeFromCache(), WikiPage\getAutoDeleteReason(), WikiPage\getAutosummary(), EditPage\getContent(), EditPage\getCopywarn(), FeedUtils\getDiffLink(), SpecialRecentchangeslinked\getFeedObject(), SpecialRecentChanges\getFeedObject(), RevertFileAction\getFormFields(), SpecialUpload\getInitialPageText(), LogFormatter\getIRCActionText(), EditPage\getPreviewText(), LogPage\getRcComment(), EditPage\getSummaryPreview(), DoubleRedirectJob\getUser(), EditPage\internalAttemptSave(), Parser\interwikiTransclude(), User\isUsableName(), HTMLSelectAndOtherField\loadDataFromRequest(), LogEventsList\logActionLinks(), Parser\magicLinkCallback(), UserrightsPage\makeGroupNameList(), Skin\makeI18nUrl(), Parser\maybeMakeExternalImage(), SpecialMergeHistory\merge(), Title\moveTo(), Title\moveToInternal(), LegacyTemplate\nameAndLogin(), Title\newMainPage(), CologneBlueTemplate\quickBar(), LanguageConverter\recursiveConvertRule(), Parser\replaceInternalLinks2(), SearchEngine\replacePrefixes(), WikiPage\replaceSection(), ImportReporter\reportPage(), DoubleRedirectJob\run(), ProtectionForm\save(), EmailNotification\sendImpersonal(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialSearch\showHit(), EditPage\showStandardInputs(), CoreParserFunctions\special(), SpecialSearch\startsWithAll(), SpecialRevisionDelete\submit(), CologneBlueTemplate\sysLinks(), CoreParserFunctions\tagObj(), ExtraParserTest\testTrackingCategory(), PageArchive\undelete(), and MediaHandler\visibleMetadataFields().

Here is the call graph for this function:

Same as above except doesn't transform the message.

Parameters:
$keyString
Returns:
String

Definition at line 1382 of file GlobalFunctions.php.

References $wgForceUIMsgAsContentMsg, and wfMsgReal().

Referenced by Skin\addToSidebar(), Block\isWhitelistedFromAutoblocks(), SpecialRecentChanges\setTopText(), and wfIsBadImage().

Here is the call graph for this function:

Here is the caller graph for this function:

wfMsgGetKey ( key,
useDB = true,
langCode = false,
transform = true 
)

Fetch a message string value, but don't replace any keys yet.

Parameters:
$keyString
$useDBBool
$langCodeString: Code of the language to get the message for, or behaves as a content language switch if it is a boolean.
$transformBoolean: whether to parse magic words, etc.
Returns:
string

Definition at line 1423 of file GlobalFunctions.php.

References MessageCache\singleton(), and wfRunHooks().

Referenced by MakeLanguageSpec\getMessagesAndTests(), wfMsgExt(), wfMsgHtml(), wfMsgReal(), and wfMsgWikiHtml().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Parameters:
$keyString
string... parameters
Returns:
string

Definition at line 1475 of file GlobalFunctions.php.

References wfMsgGetKey(), and wfMsgReplaceArgs().

Referenced by RevertFileAction\alterForm(), ImageHistoryList\beginImageHistoryList(), Linker\blockLink(), SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), Linker\buildRollbackLink(), SpecialEditWatchlist\buildTools(), CategoryViewer\columnList(), Article\confirmDelete(), Article\delete(), MovePageForm\doSubmit(), SpecialTags\doTagRow(), WebInstaller\downloadLinkHook(), Linker\emailLink(), LegacyTemplate\emailUserLink(), WebInstaller_Install\endStage(), SpecialJavaScriptTest\execute(), SpecialProtectedpages\execute(), SpecialProtectedtitles\execute(), SpecialListGroupRights\execute(), WebInstaller_Welcome\execute(), SpecialNewpages\filterLinks(), FeedUtils\formatDiff(), Block\formatExpiry(), UnusedtemplatesPage\formatResult(), UnwatchedpagesPage\formatResult(), FewestrevisionsPage\formatResult(), ShortPagesPage\formatResult(), MIMEsearchPage\formatResult(), LinkSearchPage\formatResult(), SpecialProtectedtitles\formatRow(), SpecialProtectedpages\formatRow(), SpecialNewpages\formatRow(), ChangesFeed\generateFeed(), RevDel_FileItem\getComment(), CreditsAction\getDescription(), WatchAction\getDescription(), Action\getDescription(), RevDel_RevisionItem\getDiffLink(), RevisionItem\getDiffLink(), RevDel_ArchiveItem\getDiffLink(), TablePager\getEmptyBody(), SpecialUpload\getExistsWarning(), SpecialRecentchangeslinked\getExtraOptions(), WebInstallerPage\getFieldsetStart(), LogEventsList\getFilterLinks(), SpecialWhatLinksHere\getFilterPanel(), SpecialJavaScriptTest\getFrameworkListHtml(), SpecialStatistics\getGroupStats(), WebInstaller\getHelpBox(), RevDel_LogItem\getHTML(), EditPage\getLastDelete(), TablePager\getLimitDropdown(), WikiXmlError\getMessage(), AlphabeticPager\getNavigationBar(), ReverseChronologicalPager\getNavigationBar(), TablePager\getNavigationBar(), SpecialWhatLinksHere\getPrevNext(), UploadForm\getSourceSection(), ImageHistoryList\getThumbForLine(), LegacyTemplate\getUploadLink(), SpecialStatistics\getUserStats(), RevDel_FileItem\getUserTools(), LegacyTemplate\historyLink(), ImageHistoryList\imageHistoryLine(), ChangesList\insertComment(), ChangesList\insertUserRelatedLinks(), WebInstaller\label(), ImagePage\openShowImage(), SpecialRecentChanges\optionsPanel(), LegacyTemplate\pageTitleLinks(), LegacyTemplate\printableLink(), SpecialUpload\processVerificationError(), EnhancedChangesList\recentChangesBlockGroup(), EnhancedChangesList\recentChangesLine(), ImportReporter\reportPage(), Linker\revComment(), Linker\revDeleteLink(), Linker\revDeleteLinkDisabled(), Linker\revUserLink(), Linker\revUserTools(), Article\setOldSubtitle(), SpecialRevisionDelete\showConvenienceLinks(), MovePageForm\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), Article\showPatrolFooter(), SpecialPrefixindex\showPrefixChunk(), SpecialUpload\showRecoverableUploadError(), ImagePage\showTOC(), SpecialUpload\showUploadError(), SpecialUpload\showUploadWarning(), WebInstaller_Install\startStage(), ImageGallery\toHTML(), NostalgiaTemplate\topLinks(), ImagePage\uploadLinksBox(), LegacyTemplate\userContribsLink(), Linker\userTalkLink(), Linker\userToolLinks(), Article\viewRedirect(), LegacyTemplate\watchPageLinksLink(), wfStreamThumb(), and LegacyTemplate\whatLinksHere().

Here is the call graph for this function:

wfMsgReal ( key,
args,
useDB = true,
forContent = false,
transform = true 
)

Really get a message.

Parameters:
$keyString: key to get.
$args
$useDBBoolean
$forContentMixed: Language code, or false for user lang, true for content lang.
$transformBoolean: Whether or not to transform the message.
Returns:
String: the requested message.

Definition at line 1405 of file GlobalFunctions.php.

References wfMsgGetKey(), wfMsgReplaceArgs(), wfProfileIn(), and wfProfileOut().

Referenced by WikiErrorMsg\__construct(), WebInstaller\getHelpBox(), WebInstaller\showError(), WebInstaller\showMessage(), wfMsg(), wfMsgForContent(), wfMsgForContentNoTrans(), and wfMsgNoTrans().

Here is the call graph for this function:

Here is the caller graph for this function:

wfMsgReplaceArgs ( message,
args 
)

Replace message parameter keys on the given formatted output.

Parameters:
$messageString
$argsArray
Returns:
string
Access:
private

Definition at line 1444 of file GlobalFunctions.php.

References $n.

Referenced by WikiPage\commitRollback(), Block\formatExpiry(), MWException\msg(), DBConnectionError\msg(), ApiBase\parseMsg(), ApiMain\reallyMakeHelpMsg(), wfMsgExt(), wfMsgHtml(), wfMsgReal(), and wfMsgWikiHtml().

Here is the caller graph for this function:

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().

Parameters:
$keyString
string... parameters
Returns:
string

Definition at line 1492 of file GlobalFunctions.php.

References MessageCache\singleton(), wfMsgGetKey(), and wfMsgReplaceArgs().

Here is the call graph for this function:

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.

Parameters:
$cprefsArray: client's acceptable type list
$sprefsArray: server's offered types
Returns:
string
Todo:
FIXME: Doesn't handle params like 'text/plain; charset=UTF-8' XXX: generalize to negotiate other stuff

Definition at line 2161 of file GlobalFunctions.php.

References mimeTypeMatch().

Referenced by RdfMetaData\setup(), and GlobalTest\testNegotiateType().

Here is the call graph for this function:

Here is the caller graph for this function:

wfObjectToArray ( objOrArray,
recursive = true 
)

Recursively converts the parameter (an object) to an array with the same data.

Parameters:
$objOrArrayObject|Array
$recursiveBool
Returns:
Array

Definition at line 226 of file GlobalFunctions.php.

wfOut ( s)

Used to be used for outputting text in the installer/updater.

Deprecated:
since 1.18, warnings in 1.18, remove in 1.20

Definition at line 3658 of file GlobalFunctions.php.

References $wgCommandLineMode, echo, and wfDeprecated().

Here is the call graph for this function:

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: , as well as protocol-relative URLs) correctly 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))

Parameters:
$urlString: a URL to parse
Returns:
Array: bits of the URL in an associative array, per PHP docs

Definition at line 716 of file GlobalFunctions.php.

References $url, $wgUrlProtocols, wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by MWHttpRequest\__construct(), WikiReference\getDisplayName(), Parser\getVariableValue(), UserMailer\makeMsgId(), wfAssembleUrl\provideURLParts(), SpecialSearch\showInterwikiHit(), wfExpandUrl(), wfExtractThumbParams(), wfMakeUrlIndexes(), wfMatchesDomainList(), and wfThumbHandle404().

Here is the call graph for this function:

Here is the caller graph for this function:

wfPercent ( nr,
acc = 2,
round = true 
)
Parameters:
$nrMixed: the number to format
$accInteger: the number of digits after the decimal point, default 2
$roundBoolean: whether or not to round the value, default true
Returns:
float

Definition at line 2624 of file GlobalFunctions.php.

Referenced by DeleteImageCache\execute(), TestRecorder\reportPercentage(), and GlobalTest\testWfPercentTest().

Here is the caller graph for this function:

Should low-performance queries be disabled?

Returns:
Boolean

Definition at line 3558 of file GlobalFunctions.php.

References $wgMiserMode, SiteStats\edits(), SiteStats\pages(), and SiteStats\users().

Here is the call graph for this function:

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.

Returns:
string

Definition at line 267 of file GlobalFunctions.php.

Referenced by RandomPage\getRandomTitle(), WikiPage\insertOn(), ApiQueryRandom\run(), and GlobalTest\testRandom().

Here is the caller graph for this function:

Returns:
bool

Definition at line 1207 of file GlobalFunctions.php.

References $wgReadOnly, and wfReadOnly().

Referenced by ProtectionForm\__construct(), ReadOnlyError\__construct(), ApiQuerySiteinfo\appendGeneralInfo(), ApiBase\dieReadOnly(), WikiPage\doUpdateRestrictions(), and EditPage\showHeader().

Here is the call graph for this function:

Here is the caller graph for this function:

Remove a directory and all its content.

Does not hide error.

Definition at line 2599 of file GlobalFunctions.php.

References $dir, and wfDebug().

Referenced by ExifRotationTest\tearDownFiles(), and teardownTestResources().

Here is the call graph for this function:

Here is the caller graph for this function:

wfRelativePath ( path,
from 
)

Generate a relative path name to the given file.

May explode on non-matching case-insensitive paths, funky symlinks, etc.

Parameters:
$pathString: absolute destination path including target filename
$fromString: Absolute source path, directory only
Returns:
String

Definition at line 3133 of file GlobalFunctions.php.

References $path, and wfBaseName().

Referenced by UploadDumper\outputItem().

Here is the call graph for this function:

Here is the caller graph for this function:

wfRemoveDotSegments ( urlPath)

Remove all dot-segments in the provided URL path.

For example, '/a/./b/../c/' becomes '/a/c/'. For details on the algorithm, please see RFC3986 section 5.2.4.

Todo:
Need to integrate this into wfExpandUrl (bug 32168)
Parameters:
$urlPathString URL path, potentially containing dot-segments
Returns:
string URL path with all dot-segments removed

Definition at line 579 of file GlobalFunctions.php.

References $output.

Referenced by wfRemoveDotSegments\testWfRemoveDotSegments(), and wfExpandUrl().

Here is the caller graph for this function:

Returns a HTML comment with the elapsed time since request.

This method has no side effects.

Returns:
string

Definition at line 1647 of file GlobalFunctions.php.

References $wgRequestTime, $wgShowHostnames, and wfHostname().

Referenced by ApiMain\executeActionWithErrorHandling(), and SkinTemplate\outputPage().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$resetGzipEncodingBool

Definition at line 2035 of file GlobalFunctions.php.

References $wgDisableOutputCompression.

Referenced by SpecialExport\execute(), StreamFile\prepareForStream(), and wfClearOutputBuffers().

Here is the caller graph for this function:

Restore error level to previous value.

Definition at line 2231 of file GlobalFunctions.php.

References wfSuppressWarnings().

Referenced by SVGReader\__construct(), TempFSFile\__destruct(), DatabaseOracle\__destruct(), MWMemcached\_connect_sock(), CheckSyntax\buildFileList(), Exif\charCodeString(), DatabaseInstaller\checkExtension(), OutputPage\checkLastModified(), UploadBase\checkXMLEncodingMissmatch(), FSFileBackend\chmod(), FileRepo\cleanupBatch(), FileCacheBase\clearCache(), SquidPurgeClient\close(), FSLockManager\closeLockHandles(), TextPassDumper\closeSpawn(), ZhClient\connect(), MediaHandler\convertMetadataVersion(), IPTC\convIPTCHelper(), SqliteInstaller\dataDirOKmaybeCreate(), DiffHistoryBlob\diff(), Installer\dirIsExecutable(), Installer\disableTimeLimit(), FSFileBackend\doCleanInternal(), FileBackendStore\doConcatenate(), SpecialExport\doExport(), MimeMagic\doGuessMimeType(), SquidPurgeClient\doReads(), FSLockManager\doSingleLock(), SquidPurgeClient\doWrites(), Installer\envCheckPCRE(), CheckImages\execute(), JSParseHelper\execute(), RebuildFileCache\execute(), ModernTemplate\execute(), MonoBookTemplate\execute(), CommandLineInstaller\execute(), CurlHttpRequest\execute(), PhpHttpRequest\execute(), TempFSFile\factory(), DatabaseMysql\fetchObject(), DatabasePostgres\fetchObject(), DatabaseIbm_db2\fetchObject(), DatabaseMysql\fetchRow(), DatabasePostgres\fetchRow(), DatabaseIbm_db2\fetchRow(), DatabaseMysql\freeResult(), DatabasePostgres\freeResult(), DatabaseIbm_db2\freeResult(), LSLockManager\getConnection(), WebInstallerOutput\getCSS(), Installer\getExistingLocalSettings(), FileBackendStore\getFileContents(), ImageHandler\getImageSize(), DjVuImage\getInfo(), SquidPurgeClient\getIP(), PNGHandler\getLongDesc(), GIFHandler\getLongDesc(), PNGMetadataExtractor\getMetadata(), GIFMetadataExtractor\getMetadata(), DjVuHandler\getMetaTree(), DatabaseLogEntry\getParameters(), IcuCollation\getPrimarySortKey(), ExifBitmapHandler\getRotationForExif(), SeleniumConfig\getSeleniumSettings(), FSFile\getSha1Base36(), SquidPurgeClient\getSocket(), IcuCollation\getSortKey(), StoreFileOp\getSourceSha1Base36(), SpecialVersion\getSvnInfo(), TextPassDumper\getTextSpawned(), ForeignAPIRepo\getThumbUrlFromCache(), FSFile\getTimestamp(), MediaWikiTestCase\hideDeprecated(), Language\iconv(), MWCryptRand\initialRandomState(), DatabaseOracle\insertOneRow(), ExifBitmapHandler\isMetadataValid(), PNGHandler\isMetadataValid(), GIFHandler\isMetadataValid(), Sqlite\isPresent(), DatabaseMysql\lastError(), MessageCache\loadFromLocal(), Installer\locateExecutable(), ImportStreamSource\newFromFile(), DatabaseMysql\numRows(), DatabasePostgres\numRows(), SpecialUnlockdb\onSubmit(), SpecialLockdb\onSubmit(), DatabaseMysql\open(), DatabaseMssql\open(), DatabaseOracle\open(), DatabaseIbm_db2\openCataloged(), DatabaseIbm_db2\openUncataloged(), XMPReader\parse(), DiffHistoryBlob\patch(), User\pingLimiter(), DatabaseInstaller\populateInterwikiTable(), Preprocessor_DOM\preprocessToObj(), FSLockManager\pruneKeyLockFiles(), FileRepo\publishBatch(), TempFSFile\purge(), MWCryptRand\realGenerate(), Sanitizer\removeHTMLtags(), SquidPurgeClientPool\run(), MessageCache\saveToLocal(), MessageCache\saveToScript(), JpegMetadataExtractor\segmentSplitter(), DatabaseOracle\selectDB(), UserMailer\send(), DatabaseBase\sourceFile(), PrefixSearch\specialSearch(), SeleniumServerManager\startServerOnUnix(), RecompressTracked\startSlaveProcs(), FileRepo\storeBatch(), StreamFile\stream(), JavaScriptMinifierTest\testJavaScriptMinifierOutput(), MediaWiki_I18N\translate(), SvgHandler\unpackMetadata(), SqlBagOStuff\unserialize(), DatabaseOracle\update(), Language\userAdjust(), wfDiff(), wfDl(), wfErrorLog(), wfIncrStats(), wfMemoryLimit(), wfMerge(), wfMkdirParents(), wfParseUrl(), wfSetupSession(), wfStreamThumb(), and wfUnpack().

Here is the call graph for this function:

wfRunHooks ( event,
args = array() 
)

Call hook functions defined in $wgHooks.

Parameters:
$eventString: event name
$argsArray: parameters passed to hook functions
Returns:
Boolean True if no handler aborted the hook

Definition at line 3858 of file GlobalFunctions.php.

References Hooks\run().

Referenced by ExtensionsTestSuite\__construct(), LinksUpdate\__construct(), DatabaseUpdater\__construct(), DatabaseOracle\__construct(), ResourceLoader\__construct(), UploadForm\__construct(), OutputPage\addCategoryLinks(), OutputPage\addDefaultModules(), User\addGroup(), LoginForm\addNewAccount(), LoginForm\addNewAccountInternal(), LoginForm\addNewAccountMailPassword(), OutputPage\addParserOutput(), OutputPage\addParserOutputNoText(), Skin\afterContentHook(), ApiQuerySiteinfo\appendGeneralInfo(), LoginForm\attemptAutoCreate(), SpecialChangePassword\attemptReset(), EditPage\attemptSave(), LoginForm\authenticateUserData(), BenchmarkHooks\benchHooks(), Skin\bottomScripts(), SkinTemplate\buildContentNavigationUrls(), ProtectionForm\buildForm(), SkinTemplate\buildNavUrls(), SkinTemplate\buildPersonalUrls(), SpecialEditWatchlist\buildRemoveLine(), Skin\buildSidebar(), User\canSendEmail(), Autopromote\checkCondition(), OutputPage\checkLastModified(), Title\checkPermissionHooks(), Title\checkReadPermissions(), User\clearNotification(), Parser\clearState(), WikiPage\commitRollback(), User\comparePasswords(), Article\confirmDelete(), User\confirmEmail(), UploadBase\createFromRequest(), User\crypt(), Block\doAutoblock(), FileDeleteForm\doDelete(), WikiPage\doDeleteArticleReal(), WikiPage\doEdit(), Skin\doEditSectionLink(), WikiPage\doEditUpdates(), WikiImporter\doImport(), Language\doMagicHook(), SpecialRecentchangeslinked\doMainQuery(), SpecialRecentChanges\doMainQuery(), RecentChange\doMarkPatrolled(), RevDel_RevisionList\doPostCommitUpdates(), WikiPage\doPurge(), WikiPage\doQuickEdit(), RefreshLinks\doRefreshLinks(), Block\doRetroactiveAutoblock(), UserrightsPage\doSaveUserGroups(), MovePageForm\doSubmit(), BitmapHandler\doTransform(), WatchAction\doUnwatch(), SearchUpdate\doUpdate(), LinksUpdate\doUpdate(), WikiPage\doUpdateRestrictions(), LinkHolderArray\doVariants(), WatchAction\doWatch(), WikiExporter\dumpFrom(), EditPage\edit(), SpecialUserlogout\execute(), ApiUndelete\execute(), SpecialWatchlist\execute(), SpecialContributions\execute(), ApiLogout\execute(), SpecialStatistics\execute(), ApiEditPage\execute(), ApiLogin\execute(), SpecialEmailUser\execute(), SpecialUpload\execute(), SeleniumTester\execute(), ApiQuery\execute(), ApiMain\executeAction(), ApiQuery\executeGeneratorModule(), LegacyTemplate\extensionTabLinks(), ApiQueryInfo\extractPageInfo(), Collation\factory(), Article\fetchContent(), WikiImporter\finishImportPage(), Parser_LinkHooks\firstCallInit(), Parser\firstCallInit(), Parser\formatHeadings(), UsersPager\formatRow(), ContribsPager\formatRow(), User\getAllRights(), Autopromote\getAutopromoteGroups(), User\getBlockedStatus(), OutputPage\getCacheVaryCookies(), MWNamespace\getCanonicalNamespaces(), Title\getCanonicalURL(), Title\getCategorySortkey(), EditPage\getCheckboxes(), BacklinkCache\getConditions(), ResourceLoaderStartUpModule\getConfig(), Skin\getCopyright(), EditPage\getCopywarn(), SpecialRecentChanges\getCustomFilters(), User\getDefaultOptions(), UsersPager\getDefaultQuery(), DifferenceEngine\getDiffBody(), EditPage\getEditButtons(), EditPage\getEditToolbar(), User\getEffectiveGroups(), User\getEmail(), User\getEmailAuthenticationTimestamp(), SpecialVersion\getExtensionCredits(), SpecialVersion\getExtensionTypes(), SpecialRecentChanges\getExtraOptions(), ApiBase\getFinalDescription(), ApiBase\getFinalParamDescription(), ApiBase\getFinalParams(), FormAction\getForm(), FormSpecialPage\getForm(), Title\getFullURL(), LocalFile\getHistory(), User\getImplicitGroups(), Title\getInternalURL(), RecentChange\getIRCLine(), XMPInfo\getItems(), OutputPage\getJSVars(), RequestContext\getLanguage(), PreferencesForm\getLegend(), SpecialPageFactory\getList(), Title\getLocalURL(), Language\getMessagesFileName(), MediaHandler\getMetadataVersion(), MessageCache\getMsgFromNamespace(), Language\getNamespaces(), SearchEngine\getNearMatch(), SearchEngine\getNearMatchInternal(), User\getNewMessageLinks(), UsersPager\getPageHeader(), Title\getPageLanguage(), User\getPageRenderingHash(), ParserTest\getParser(), NewParserTest\getParser(), User\getPasswordValidity(), WebRequest\getPathInfo(), SpecialEmailUser\getPermissionsError(), Skin\getPoweredBy(), Preferences\getPreferences(), BacklinkCache\getPrefix(), EditPage\getPreviewText(), SpecialSearch\getProfileForm(), WantedPagesPage\getQueryInfo(), UsersPager\getQueryInfo(), HistoryPager\getQueryInfo(), NewPagesPager\getQueryInfo(), ContribsPager\getQueryInfo(), RandomPage\getRandomTitle(), Title\getRestrictionTypes(), XMPReader\getResults(), User\getRights(), ApiRsd\getRsdApiList(), ResourceLoaderStartUpModule\getScript(), SpecialSearch\getSearchProfiles(), BaseTemplate\getSidebar(), Skin\getSiteNotice(), RequestContext\getSkin(), UploadForm\getSourceSection(), Language\getSpecialPageAliases(), DeletedContributionsPage\getSubTitle(), ApiQueryUsers\getTokenFunctions(), ApiQueryRevisions\getTokenFunctions(), ApiQueryRecentChanges\getTokenFunctions(), ApiQueryInfo\getTokenFunctions(), BaseTemplate\getToolbox(), SpecialContributions\getUserLinks(), MagicWord\getVariableIDs(), Parser\getVariableValue(), SpecialSearch\goResult(), WikiImporter\handleLogItem(), WikiImporter\handlePage(), WikiImporter\handleRevision(), WikiImporter\handleUpload(), OutputPage\headElement(), HistoryPager\historyLine(), ImageHistoryList\imageHistoryLine(), EditPage\importFormData(), MediaWiki\initializeArticle(), ChangesList\insertArticleLink(), Revision\insertOn(), EditPage\internalAttemptSave(), Parser\internalParse(), User\invalidateEmail(), User\isBlockedFrom(), User\isBlockedGlobally(), Title\isCssOrJsPage(), User\isEmailConfirmed(), Article\isFileCacheable(), Title\isMovable(), User\isUsableName(), Title\isValidMoveOperation(), Title\isWikitextPage(), Linker\link(), ChangeTags\listDefinedTags(), ParserTest\listTables(), Interwiki\load(), User\load(), User\loadDefaults(), ImagePage\loadFile(), User\loadFromDatabase(), User\loadFromSession(), User\loadOptions(), DifferenceEngine\loadRevisionIds(), LogEventsList\logActionLinks(), User\logout(), LoginForm\mailPasswordInternal(), LoginForm\mainLoginForm(), Linker\makeExternalImage(), Linker\makeExternalLink(), Parser\makeImage(), Linker\makeImageLink2(), SpecialMergeHistory\merge(), Title\moveTo(), Title\moveToInternal(), ChangesList\newFromContext(), UserArray\newFromResult(), TitleArray\newFromResult(), Article\newFromTitle(), BitmapHandler\normaliseParams(), EditPage\noSuchSectionPage(), SpecialPasswordReset\onSubmit(), RawAction\onView(), HistoryAction\onView(), XmlDumpWriter\openPage(), ImagePage\openShowImage(), ParserOptions\optionsHash(), OutputPage\output(), SkinTemplate\outputPage(), WikiPage\pageData(), Parser\parse(), MediaWiki\performAction(), MediaWiki\performRequest(), UploadBase\performUpload(), User\pingLimiter(), SpecialSearch\powerSearchBox(), WikiPage\prepareTextForEdit(), SpecialBlock\preText(), SpecialBlock\processForm(), SpecialUpload\processUpload(), LocalFile\purgeOldThumbnails(), LocalFile\purgeThumbnails(), LocalisationCache\recache(), OldChangesList\recentChangesLine(), LocalFile\recordUpload2(), ResourceLoader\registerTestModules(), User\removeGroup(), Parser\renderImageGallery(), DifferenceEngine\renderNewRevision(), VectorTemplate\renderPortal(), MessageCache\replace(), LinkHolderArray\replaceInternal(), SearchEngine\replacePrefixes(), WikiPage\replaceSection(), ImportReporter\reportPage(), RecentChange\save(), ProtectionForm\save(), User\saveOptions(), User\saveSettings(), SearchEngine\searchableNamespaces(), PrefixSearch\searchBackend(), UserMailer\send(), User\setCookies(), User\setEmail(), User\setEmailAuthenticationTimestamp(), Article\setOldSubtitle(), SpecialNewpages\setup(), EditAction\show(), EditPage\showConflict(), SpecialSearch\showCreateLink(), Article\showCssOrJsPage(), EditPage\showDiff(), DifferenceEngine\showDiffPage(), EditPage\showEditForm(), SpecialUndelete\showHistory(), SpecialSearch\showHit(), SpecialBlockList\showList(), SpecialBookSources\showList(), ProtectionForm\showLogExtract(), LogEventsList\showLogExtract(), Article\showMissingArticle(), EditPage\showPreview(), Article\showRedirectedFromHeader(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), ImagePage\showTOC(), EditPage\showTosSummary(), Article\showViewFooter(), SpecialVersion\softwareInformation(), Parser\statelessFetchTemplate(), SpecialEmailUser\submit(), Skin\subPageSubtitle(), LoginForm\successfulCreation(), LoginForm\successfulLogin(), SkinTemplate\tabAction(), HooksTest\testOldStyleHooks(), ImageGallery\toHTML(), MonoBookTemplate\toolbox(), Preferences\trySetUserEmail(), SpecialUndelete\undelete(), PageArchive\undeleteRevisions(), SpecialEditWatchlist\unwatchTitles(), Linker\userToolLinks(), UploadBase\verifyFile(), UploadBase\verifyUpload(), CategoryPage\view(), ImagePage\view(), Article\view(), wfDebug(), wfDebugLog(), wfExtractThumbParams(), wfIsBadImage(), wfIsTrustedProxy(), wfMsgGetKey(), wfShellMaintenanceCmd(), and XmlDumpWriter\writeRevision().

Here is the call graph for this function:

wfScript ( script = 'index')

Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScriptExtension etc.

Parameters:
$scriptString: script filename, sans extension
Returns:
String

Definition at line 3573 of file GlobalFunctions.php.

References $wgScriptExtension, and $wgScriptPath.

Referenced by ResourceLoader\__construct(), SpecialPage\addFeedLinks(), SpecialContributions\execute(), OutputPage\getHeadLinks(), SearchEngine\getMWSuggestTemplate(), SearchEngine\getOpenSearchTemplate(), ApiRsd\getRsdApiList(), ApiFormatBase\initPrinter(), and ApiTestCase\setUp().

Here is the caller graph for this function:

wfSetBit ( &$  dest,
bit,
state = true 
)

As for wfSetVar except setting a bit.

Parameters:
$destInt
$bitInt
$stateBool
Returns:
bool

Definition at line 1965 of file GlobalFunctions.php.

Referenced by DatabaseBase\bufferResults(), DatabaseBase\debug(), and DatabaseBase\ignoreErrors().

Here is the caller graph for this function:

wfSetVar ( &$  dest,
source,
force = false 
)

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 If force is true, it will set the value even if source is NULL.

Parameters:
$destMixed
$sourceMixed
$forceBool
Returns:
Mixed

Definition at line 1948 of file GlobalFunctions.php.

Referenced by OutputPage\enableClientCache(), ParserOptions\enableLimitReport(), DatabaseBase\errorCount(), SpecialPage\file(), LinkCache\forUpdate(), Block\fromMaster(), SpecialPage\func(), SpecialPage\includable(), SpecialPage\including(), Block\isAutoblocking(), Block\isHardblock(), SpecialPage\listed(), SpecialPage\name(), Parser\Options(), Parser\OutputType(), LoadBalancer\parentInfo(), OutputPage\parserOptions(), ParserOutput\preventClickjacking(), Block\prevents(), SpecialPage\restriction(), ParserOptions\setAllowExternalImages(), ParserOptions\setAllowExternalImagesFrom(), ParserOptions\setAllowSpecialInclusion(), CacheTime\setCacheTime(), ParserOutput\setCategoryLinks(), ParserOptions\setCleanSignatures(), CacheTime\setContainsOldMagic(), ParserOptions\setDateFormat(), ParserOptions\setEditSection(), ParserOutput\setEditSectionTokens(), ParserOptions\setEnableImageWhitelist(), ParserOptions\setExternalLinkTarget(), OutputPage\setFileVersion(), ParserOutput\setIndexPolicy(), ParserOptions\setInterfaceMessage(), ParserOptions\setInterwikiMagic(), ParserOptions\setIsPreview(), ParserOptions\setIsPrintable(), ParserOptions\setIsSectionPreview(), ParserOutput\setLanguageLinks(), SpecialPage\setListed(), ParserOptions\setMath(), ParserOptions\setMaxIncludeSize(), ParserOptions\setMaxPPNodeCount(), ParserOptions\setMaxTemplateDepth(), WikiImporter\setNoticeCallback(), ParserOptions\setNumberHeadings(), ParserOptions\setPreSaveTransform(), ParserOptions\setRemoveComments(), OutputPage\setRevisionId(), OutputPage\setRevisionTimestamp(), ParserOutput\setSections(), ParserOptions\setStubThreshold(), ParserOptions\setTargetLanguage(), ParserOptions\setTemplateCallback(), ParserOutput\setText(), ParserOptions\setThumbSize(), ParserOptions\setTidy(), ParserOutput\setTimestamp(), ParserOptions\setTimestamp(), ParserOutput\setTitleText(), ParserOutput\setTOCHTML(), ParserOptions\setUseDynamicDates(), ParserOptions\setUserLang(), DatabaseBase\tablePrefix(), Parser\Title(), DatabaseBase\trxLevel(), and LoadBalancer\waitTimeout().

wfShellExec ( cmd,
&$  retval = null,
environ = array() 
)

Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported.

Parameters:
$cmdString Command line, properly escaped for shell.
&$retvaloptional, will receive the program's exit code. (non-zero is usually failure)
$environArray optional environment variables which should be added to the executed command environment.
Returns:
collected stdout as a string (trailing newlines stripped)

Definition at line 2785 of file GlobalFunctions.php.

References $IP, $output, $wgMaxShellFileSize, $wgMaxShellMemory, $wgMaxShellTime, wfDebug(), wfDebugLog(), wfIniGetBool(), wfInitShellLocale(), and wfIsWindows().

Referenced by CheckSyntax\buildFileList(), UploadBase\detectVirus(), DjVuHandler\doTransform(), Installer\envCheckShellLocale(), DifferenceEngine\generateDiffBody(), BitmapHandler\getMagickVersion(), Installer\locateExecutable(), SvgHandler\rasterize(), Maintenance\readlineEmulation(), DjVuImage\retrieveMetaData(), BitmapHandler\transformCustom(), BitmapHandler\transformImageMagick(), RandomImageGenerator\writeImageWithApi(), and RandomImageGenerator\writeImageWithCommandLine().

Here is the call graph for this function:

Here is the caller graph for this function:

wfShellMaintenanceCmd ( script,
array $  parameters = array(),
array $  options = array() 
)

Generate a shell-escaped command line string to run a maintenance script.

Note that $parameters should be a flat array and an option with an argument should consist of two consecutive items in the array (do not use "--option value").

Parameters:
$scriptstring MediaWiki maintenance script path
$parametersArray Arguments and options to the script
$optionsArray Associative array of options: 'php': The path to the php executable 'wrapper': Path to a PHP wrapper to handle the maintenance script
Returns:
Array

Definition at line 2895 of file GlobalFunctions.php.

References $options, $wgPhpCli, and wfRunHooks().

Referenced by GlobalTest\testWfShellMaintenanceCmd().

Here is the call graph for this function:

Here is the caller graph for this function:

wfShorthandToInteger ( string = '')

Converts shorthand byte notation to integer form.

Parameters:
$stringString
Returns:
Integer

Definition at line 3753 of file GlobalFunctions.php.

Referenced by Installer\envCheckMemory(), UploadForm\getSourceSection(), WebRequest\isIniSizeOverflow(), wfShorthandToIntegerTest\testWfShorthandToInteger(), GlobalTest\testWfShorthandToInteger(), UploadFromFile\verifyUpload(), and wfMemoryLimit().

Here is the caller graph for this function:

wfShowingResults ( offset,
limit 
)
Todo:
document
Parameters:
$offsetInt
$limitInt
Returns:
String

Definition at line 1808 of file GlobalFunctions.php.

References $limit, $wgLang, and wfMsgExt().

Here is the call graph for this function:

wfSpecialList ( page,
details,
oppositedm = true 
)

Make a list item, used by various special pages.

Parameters:
$pageString Page link
$detailsString Text between brackets
$oppositedmBoolean Add the direction mark opposite to your language, to display text properly
Returns:
String
Deprecated:
since 1.19; use Language::specialList() instead

Definition at line 1858 of file GlobalFunctions.php.

References $page, and $wgLang.

wfSplitWikiID ( wiki)

Split a wiki ID into DB name and table prefix.

Parameters:
$wikiString
Returns:
array

Definition at line 3455 of file GlobalFunctions.php.

Referenced by ForeignDBViaLBRepo\__construct(), LBFactory_Multi\getDBNameAndPrefix(), nextJobDB\getPendingDbs(), and LoadBalancer\openForeignConnection().

Here is the caller graph for this function:

wfStreamFile ( fname,
headers = array() 
)

Stream a file to the browser.

Back-compat alias for StreamFile::stream()

Deprecated:
since 1.19

Definition at line 3547 of file GlobalFunctions.php.

References $fname, StreamFile\stream(), and wfDeprecated().

Here is the call graph for this function:

Replace all invalid characters with -.

Parameters:
$nameMixed: filename to process
Returns:
String

Definition at line 3707 of file GlobalFunctions.php.

References $wgIllegalFileChars, Title\legalChars(), and wfBaseName().

Referenced by UploadBase\getTitle(), and Title\validateFileMoveOperation().

Here is the call graph for this function:

Here is the caller graph for this function:

wfSuppressWarnings ( end = false)

Reference-counted warning suppression.

Parameters:
$endBool

Definition at line 2202 of file GlobalFunctions.php.

Referenced by SVGReader\__construct(), TempFSFile\__destruct(), DatabaseOracle\__destruct(), MWMemcached\_connect_sock(), SqliteMaintenance\backup(), CheckSyntax\buildFileList(), Exif\charCodeString(), DatabaseInstaller\checkExtension(), OutputPage\checkLastModified(), UploadBase\checkXMLEncodingMissmatch(), FSFileBackend\chmod(), FileRepo\cleanupBatch(), FileCacheBase\clearCache(), SquidPurgeClient\close(), FSLockManager\closeLockHandles(), TextPassDumper\closeSpawn(), ZhClient\connect(), MediaHandler\convertMetadataVersion(), IPTC\convIPTCHelper(), SqliteInstaller\dataDirOKmaybeCreate(), DiffHistoryBlob\diff(), Installer\dirIsExecutable(), Installer\disableTimeLimit(), FSFileBackend\doCleanInternal(), FileBackendStore\doConcatenate(), SpecialExport\doExport(), MimeMagic\doGuessMimeType(), SquidPurgeClient\doReads(), FSLockManager\doSingleLock(), SquidPurgeClient\doWrites(), Installer\envCheckPCRE(), CheckImages\execute(), JSParseHelper\execute(), RebuildFileCache\execute(), ModernTemplate\execute(), MonoBookTemplate\execute(), CommandLineInstaller\execute(), CurlHttpRequest\execute(), PhpHttpRequest\execute(), TempFSFile\factory(), DatabaseMysql\fetchObject(), DatabasePostgres\fetchObject(), DatabaseIbm_db2\fetchObject(), DatabaseMysql\fetchRow(), DatabasePostgres\fetchRow(), DatabaseIbm_db2\fetchRow(), DatabaseMysql\freeResult(), DatabasePostgres\freeResult(), DatabaseIbm_db2\freeResult(), LSLockManager\getConnection(), WebInstallerOutput\getCSS(), Installer\getExistingLocalSettings(), FileBackendStore\getFileContents(), ImageHandler\getImageSize(), DjVuImage\getInfo(), SquidPurgeClient\getIP(), PNGHandler\getLongDesc(), GIFHandler\getLongDesc(), PNGMetadataExtractor\getMetadata(), GIFMetadataExtractor\getMetadata(), DjVuHandler\getMetaTree(), DatabaseLogEntry\getParameters(), IcuCollation\getPrimarySortKey(), ExifBitmapHandler\getRotationForExif(), SeleniumConfig\getSeleniumSettings(), FSFile\getSha1Base36(), SquidPurgeClient\getSocket(), IcuCollation\getSortKey(), StoreFileOp\getSourceSha1Base36(), SpecialVersion\getSvnInfo(), TextPassDumper\getTextSpawned(), ForeignAPIRepo\getThumbUrlFromCache(), FSFile\getTimestamp(), MediaWikiTestCase\hideDeprecated(), Language\iconv(), MWCryptRand\initialRandomState(), DatabaseOracle\insertOneRow(), ExifBitmapHandler\isMetadataValid(), PNGHandler\isMetadataValid(), GIFHandler\isMetadataValid(), Sqlite\isPresent(), DatabaseMysql\lastError(), MessageCache\loadFromLocal(), Installer\locateExecutable(), ImportStreamSource\newFromFile(), DatabaseMysql\numRows(), DatabasePostgres\numRows(), SpecialUnlockdb\onSubmit(), SpecialLockdb\onSubmit(), DatabaseMysql\open(), DatabaseMssql\open(), DatabaseOracle\open(), DatabaseIbm_db2\openCataloged(), DatabaseIbm_db2\openUncataloged(), XMPReader\parse(), DiffHistoryBlob\patch(), User\pingLimiter(), DatabaseInstaller\populateInterwikiTable(), Preprocessor_DOM\preprocessToObj(), FSLockManager\pruneKeyLockFiles(), FileRepo\publishBatch(), TempFSFile\purge(), MWCryptRand\realGenerate(), Sanitizer\removeHTMLtags(), SquidPurgeClientPool\run(), MessageCache\saveToLocal(), MessageCache\saveToScript(), JpegMetadataExtractor\segmentSplitter(), DatabaseOracle\selectDB(), UserMailer\send(), DatabaseBase\sourceFile(), PrefixSearch\specialSearch(), SeleniumServerManager\startServerOnUnix(), RecompressTracked\startSlaveProcs(), FileRepo\storeBatch(), StreamFile\stream(), JavaScriptMinifierTest\testJavaScriptMinifierOutput(), MediaWiki_I18N\translate(), SvgHandler\unpackMetadata(), SqlBagOStuff\unserialize(), DatabaseOracle\update(), Language\userAdjust(), wfDiff(), wfDl(), wfErrorLog(), wfIncrStats(), wfMemoryLimit(), wfMerge(), wfMkdirParents(), wfParseUrl(), wfRestoreWarnings(), wfSetupSession(), wfStreamThumb(), and wfUnpack().

wfTempDir ( )

Tries to get the system directory for temporary files.

The TMPDIR, TMP, and TEMP environment variables are then checked in sequence, and if none are set try sys_get_temp_dir() for PHP >= 5.2.1. All else fails, return /tmp for Unix or C: for Windows and hope for the best. It is common to call it with tempnam().

NOTE: When possible, use instead the tmpfile() function to create temporary files to avoid race conditions on file creation, etc.

Returns:
String

Definition at line 2489 of file GlobalFunctions.php.

References wfIsWindows().

Referenced by UploadTest\createFileOfSize(), WikiRevision\downloadSource(), WikiImporter\dumpTemp(), TempFSFile\factory(), ApiTestCaseUpload\fakeUploadChunk(), ApiTestCaseUpload\fakeUploadFile(), generateConfigFile(), NewParserTest\getUploadDir(), UploadFromUrl\makeTemporaryFile(), FileBackendTest\provider_testConcatenate(), ParserTest\quickDiff(), GlobalTest\setUp(), StoreBatchTest\setUp(), ExifRotationTest\setUp(), FileBackendTest\setUp(), UploadFromUrlTestSuite\setUp(), ParserTest\setUp(), UploadFromUrlTestSuite\setupUploadDir(), ParserTest\setupUploadDir(), CdbTest\testCdb(), GlobalTest\testDebugFunctionTest(), ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), ApiUploadTest\testUploadZeroLength(), wfDiff(), and wfMerge().

Here is the call graph for this function:

Here is the caller graph for this function:

wfTimestamp ( outputtype = TS_UNIX,
ts = 0 
)

Get a timestamp string in one of various formats.

Parameters:
$outputtypeMixed: A timestamp in one of the supported formats, the function will autodetect which format is supplied and act accordingly.
$tsMixed: the timestamp to convert or 0 for the current timestamp
Returns:
Mixed: String / false The same date in the format specified in $outputtype or false

Definition at line 2302 of file GlobalFunctions.php.

References $output, and wfDebug().

Referenced by Block\__construct(), UserBlockedError\__construct(), BlockTest\addDBData(), ApiQueryLogEvents\addLogParams(), ApiQuerySiteinfo\appendGeneralInfo(), SpecialRecentChanges\buildMainQueryConds(), FileCacheBase\cacheTimestamp(), AjaxResponse\checkLastModified(), OutputPage\checkLastModified(), User\checkTemporaryPassword(), Title\checkUserBlock(), WikiPage\commitRollback(), User\confirmationToken(), FileBackendMultiWrite\consistencyCheck(), ApiQueryContributions\continueStr(), LanguageWa\date(), Language\date(), DifferenceEngine\debug(), LocalFile\decodeRow(), SqlBagOStuff\deleteObjectsExpiringBefore(), SpecialUndelete\diffHeader(), FSFileBackend\doGetFileStat(), SwiftFileBackend\doGetFileStat(), MysqlUpdater\doSchemaRestructuring(), FileBackendTest\doTestGetFileStat(), PurgeParserCache\execute(), RemoveUnusedAccounts\execute(), ApiUndelete\execute(), ApiProtect\execute(), ApiQueryAllUsers\execute(), FixTimestamps\execute(), ApiQueryDeletedrevs\execute(), SpecialExport\execute(), ApiEditPage\execute(), ApiQueryFilearchive\execute(), ApiQueryImageInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryBlocks\execute(), ApiQueryContributions\execute(), ApiBlock\execute(), UpdateSearchIndex\execute(), ApiFeedWatchlist\execute(), GenerateSitemap\execute(), LocalFileRestoreBatch\execute(), CacheTime\expired(), ApiQueryInfo\extractPageInfo(), ApiQueryWatchlist\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), HistoryAction\feedEmpty(), FeedUtils\formatDiff(), Language\formatExpiry(), SpecialUndelete\formatFileRow(), SpecialMergeHistory\formatRevisionRow(), SpecialUndelete\formatRevisionRow(), UsersPager\formatRow(), RSSFeed\formatTime(), AtomFeed\formatTime(), GenerateSitemap\generateLimit(), Block\getAutoblockExpiry(), NewUsersLogFormatter\getComment(), ApiQueryUserInfo\getCurrentUserInfo(), ProtectionForm\getExpiry(), User\getFirstEditTimestamp(), FormatMetadata\getFormattedData(), MessageBlobStore\getFromDB(), ApiQueryImageInfo\getInfo(), PNGMetadataExtractor\getMetadata(), ResourceLoaderUserCSSPrefsModule\getModifiedTime(), ResourceLoaderUserOptionsModule\getModifiedTime(), ResourceLoaderStartUpModule\getModifiedTime(), ResourceLoaderStartUpModule\getModuleRegistrations(), ResourceLoaderModule\getMsgBlobMtime(), PageArchive\getPreviousRevision(), RawAction\getRawText(), ResourceLoaderStartUpModule\getScript(), ImageHistoryList\getThumbForLine(), FSFile\getTimestamp(), ForeignAPIFile\getTimestamp(), RevisionItemBase\getTimestamp(), DatabaseLogEntry\getTimestamp(), RCDatabaseLogEntry\getTimestamp(), ArchivedFile\getTimestamp(), WikiPage\getTimestamp(), ManualLogEntry\getTimestamp(), Revision\getTimestamp(), Revision\getTimestampFromId(), ResourceLoaderWikiModule\getTitleMtimes(), Parser\getVariableValue(), ImageHistoryList\imageHistoryLine(), Block\initFromRow(), Language\internalUserTimeAndDate(), User\isEmailConfirmationPending(), SqlBagOStuff\isExpired(), User\isPasswordReminderThrottled(), User\loadDefaults(), ChangesFeed\loadFromCache(), RecentChange\loadFromCurRow(), RecentChange\loadFromRow(), User\loadFromRow(), WikiPage\loadPageData(), SpecialUndelete\loadRequest(), MessageCache\logMessages(), LogEventsList\logTimestamp(), GenerateSitemap\main(), OutputPage\makeResourceLoaderLink(), SpecialBlock\maybeAlterFormDefaults(), SpecialMergeHistory\merge(), User\newTouchedTimestamp(), OutputPage\output(), SpecialBlock\parseExpiryInput(), User\pingLimiter(), ResourceLoader\preloadModuleInfo(), StreamFile\prepareForStream(), ApiQueryContributions\prepareQuery(), TableCleanup\progress(), ImageBuilder\progress(), Parser\pstPass2(), LocalFile\publishTo(), QueryPage\recache(), LocalFile\recordUpload2(), ResourceLoader\respond(), ApiQueryProtectedTitles\run(), ApiQuerySearch\run(), ApiQueryWatchlistRaw\run(), ApiQueryCategoryMembers\run(), ApiQueryCategories\run(), ApiQueryWatchlist\run(), ApiQueryQueryPage\run(), ApiQueryRecentChanges\run(), RunJobs\runJobsLog(), ChangesFeed\saveToCache(), ApiMain\sendCacheHeaders(), ResourceLoader\sendResponseHeaders(), WikiPage\setCachedLastEditTime(), OutputPage\setLastModified(), WikiPage\setTimestamp(), WikiRevision\setTimestamp(), TextPassDumper\showReport(), BackupDumper\showReport(), UpdateLogging\sync(), wfTimestamp\testHttpDate(), wfTimestamp\testNormalTimestamps(), wfTimestamp\testOldTimestamps(), wfTimestamp\testTimestampParameter(), Language\time(), Language\timeanddate(), IPTC\timeHelper(), DatabaseMssql\timestamp(), DatabasePostgres\timestamp(), DatabaseOracle\timestamp(), DatabaseIbm_db2\timestamp(), DatabaseBase\timestamp(), ResourceLoader\tryRespondFromFileCache(), ResourceLoader\tryRespondLastModified(), WikiPage\updateIfNewerOn(), Block\updateTimestamp(), XMPValidate\validateDate(), ApiBase\validateTimestamp(), EditPage\wasDeletedSinceLastEdit(), wfDebugLog(), wfStreamThumb(), wfTimestampNow(), wfTimestampOrNull(), and XmlDumpWriter\writeTimestamp().

Here is the call graph for this function:

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.

Parameters:
$outputtypeInteger
$tsString
Returns:
String

Definition at line 2425 of file GlobalFunctions.php.

References wfTimestamp().

Referenced by Autopromote\checkCondition(), ApiQueryUsers\execute(), and User\loadFromRow().

Here is the call graph for this function:

Here is the caller graph for this function:

wfUILang ( )

Old function when $wgBetterDirectionality existed Removed in core, kept in extensions for backwards compat.

Deprecated:
since 1.18
Returns:
Language

Definition at line 1268 of file GlobalFunctions.php.

References $wgLang, and wfDeprecated().

Here is the call graph for this function:

wfUnpack ( format,
data,
length = false 
)

Wrapper around php's unpack.

Parameters:
$formatString: The format string (See php's docs)
$data,:A binary string of binary data
$lengthinteger or false: The minimun length of $data. This is to prevent reading beyond the end of $data. false to disable the check.

Also be careful when using this function to read unsigned 32 bit integer because php might make it negative.

Exceptions:
MWExceptionif $data not long enough, or if unpack fails
Returns:
Associative array of the extracted data

Definition at line 3876 of file GlobalFunctions.php.

References $result, wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by JpegMetadataExtractor\doPSIR(), BmpHandler\getImageSize(), XCFHandler\getXCFMetaData(), JpegMetadataExtractor\jpegExtractMarker(), and JpegMetadataExtractor\segmentSplitter().

Here is the call graph for this function:

Here is the caller graph for this function:

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:

;:$!*(),/

However, IIS7 redirects fail when the url contains a colon (Bug 22709), so no fancy : for IIS7.

%2F in the page titles seems to fatally break for some reason.

Parameters:
$sString:
Returns:
string

Definition at line 298 of file GlobalFunctions.php.

Referenced by FileRepo\getDescriptionRenderUrl(), FileRepo\getDescriptionUrl(), Title\getLocalURL(), Title\getPrefixedURL(), Title\getSubpageUrlForm(), Interwiki\getURL(), Parser\getVariableValue(), LoginForm\mainLoginForm(), Title\makeTitle(), CoreParserFunctions\namespacee(), CoreParserFunctions\nse(), Title\secureAndSplit(), CoreParserFunctions\subjectspacee(), CoreParserFunctions\talkspacee(), GlobalTest\testUrlencode(), and wfUrlencodeTest\verifyEncodingFor().

Here is the caller graph for this function:

wfUrlProtocols ( includeProtocolRelative = true)

Returns a regular expression of url protocols.

Parameters:
$includeProtocolRelativebool If false, remove '//' from the returned protocol list. DO NOT USE this directly, use wfUrlProtocolsWithoutProtRel() instead
Returns:
String

Definition at line 657 of file GlobalFunctions.php.

References $wgUrlProtocols.

Referenced by Parser\__construct(), Skin\addToSidebarPlain(), Parser\armorLinks(), ResourceLoaderStartUpModule\getConfig(), Skin\makeInternalOrExternalUrl(), Parser\replaceInternalLinks2(), Parser_LinkHooks\replaceInternalLinksCallback(), Sanitizer\safeEncodeAttribute(), Parser\stripSectionName(), Sanitizer\validateAttributes(), and wfUrlProtocolsWithoutProtRel().

Here is the caller graph for this function:

Like wfUrlProtocols(), but excludes '//' from the protocol list.

Use this if you need a regex that matches all URL protocols but does not match protocol- relative URLs

Returns:
String

Definition at line 702 of file GlobalFunctions.php.

References wfUrlProtocols().

Referenced by Parser\doMagicLinks(), and ApiFormatBase\formatHTML().

Here is the call graph for this function:

Here is the caller graph for this function:

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

See also:
perldoc -f use
Parameters:
$req_verMixed: the version to check, can be a string, an integer, or a float

Definition at line 3092 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

See also:
perldoc -f use
Parameters:
$req_verMixed: the version to check, can be a string, an integer, or a float

Definition at line 3071 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).

Parameters:
$varA PHP variable to dump.

Definition at line 1983 of file GlobalFunctions.php.

References $wgOut, and print.

wfViewPrevNext ( offset,
limit,
link,
query = '',
atend = false 
)

Generate (prev x| next x) (20|50|100...) type links for paging.

Parameters:
$offsetString
$limitInteger
$linkString
$queryString: optional URL query parameter string
$atendBool: optional param for specified if this is the last page
Returns:
String
Deprecated:
in 1.19; use Language::viewPrevNext() instead

Definition at line 1829 of file GlobalFunctions.php.

References $limit, $title, $wgLang, Title\newFromText(), wfCgiToArray(), and wfDeprecated().

Here is the call graph for this function:

wfWaitForSlaves ( maxLag = false,
wiki = false 
)

Modern version of wfWaitForSlaves().

Instead of looking at replication lag and waiting for it to go down, this waits for the slaves to catch up to the master position. 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.

Parameters:
$maxLagInteger (deprecated)
$wikimixed Wiki identifier accepted by wfGetLB

Definition at line 3643 of file GlobalFunctions.php.

References $lb, and wfGetLB().

Referenced by CompressOld\compressWithConcat(), RefreshLinks\deleteLinksFromNonexistent(), PopulateRevisionLength\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateCategory\doPopulateCategory(), RefreshLinks\doRefreshLinks(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), MysqlUpdater\doTemplatelinksUpdate(), WaitForSlave\execute(), DeleteDefaultMessages\execute(), MigrateUserGroup\execute(), BatchedQueryRunner\execute(), UpdateSpecialPages\execute(), ConvertUserOptions\execute(), UpdateRestrictions\execute(), CleanupRemovedModules\execute(), DeleteSelfExternals\execute(), InitEditCount\execute(), RunJobs\execute(), DeleteBatch\execute(), MoveBatch\execute(), RefreshImageMetadata\execute(), UpdateMediaWiki\execute(), moveToExternal(), resolveStubs(), RefreshLinksJob2\run(), BackupReader\showReport(), UpdateLogging\sync(), TrackBlobs\trackOrphanText(), TrackBlobs\trackRevisions(), and FixBug20757\waitForSlaves().

Here is the call graph for this function:

Here is the caller graph for this function:

wfWarn ( msg,
callerOffset = 1,
level = E_USER_NOTICE 
)

Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.

Parameters:
$msgString: message to send
$callerOffsetInteger: number of items to go back in the backtrace to find the correct caller (1 = function calling wfWarn, ...)
$levelInteger: PHP error level; only used when $wgDevelopmentWarnings is true

Definition at line 1031 of file GlobalFunctions.php.

References $file, $wgDevelopmentWarnings, MWDebug\warning(), wfDebug(), and wfDebugBacktrace().

Referenced by Exif\__construct(), MWTidy\execExternalTidy(), MWTidy\execInternalTidy(), ParserCache\getKey(), SpecialPageFactory\getLocalNameFor(), Autopromote\recCheckCondition(), wfDeprecated(), and wfMsgExt().

Here is the call graph for this function:

Here is the caller graph for this function: