3require_once dirname( __DIR__ ) .
'/includes/upload/UploadFromUrlTest.php';
24 $tmpDir = $this->getNewTempDirectory();
27 $tmpGlobals[
'wgScript'] =
'/index.php';
28 $tmpGlobals[
'wgScriptPath'] =
'/';
29 $tmpGlobals[
'wgArticlePath'] =
'/wiki/$1';
30 $tmpGlobals[
'wgStylePath'] =
'/skins';
31 $tmpGlobals[
'wgThumbnailScriptPath'] =
false;
32 $tmpGlobals[
'wgLocalFileRepo'] = [
33 'class' =>
'LocalRepo',
35 'url' =>
'http://example.com/images',
37 'transformVia404' =>
false,
39 'name' =>
'local-backend',
42 'local-public' =>
"{$tmpDir}/test-repo/public",
43 'local-thumb' =>
"{$tmpDir}/test-repo/thumb",
44 'local-temp' =>
"{$tmpDir}/test-repo/temp",
45 'local-deleted' =>
"{$tmpDir}/test-repo/delete",
49 foreach ( $tmpGlobals as $var => $val ) {
50 if ( array_key_exists( $var,
$GLOBALS ) ) {
51 $this->savedGlobals[$var] =
$GLOBALS[$var];
61 DeferredUpdates::clearPendingUpdates();
82 foreach ( $this->savedGlobals as $var => $val ) {
98 foreach ( $files as $file ) {
99 if ( file_exists( $file ) ) {
112 if ( is_dir(
$dir ) ) {
127 $dir = $this->getNewTempDirectory();
129 wfDebug(
"Creating upload directory $dir\n" );
132 copy(
"$IP/tests/phpunit/data/upload/headbg.jpg",
"$dir/3/3a/Foobar.jpg" );
135 copy(
"$IP/tests/phpunit/data/upload/headbg.jpg",
"$dir/0/09/Bad.jpg" );
143 class_exists(
'UploadFromUrlTest' );
$GLOBALS['wgAutoloadClasses']['LocalisationUpdate']
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a copy
$wgParserCacheType
The cache type for storing article HTML.
$wgStyleDirectory
Filesystem stylesheets directory.
$wgNamespaceProtection
Set the minimum permissions required to edit pages in each namespace.
$wgParserConf
Parser configuration.
$wgNamespaceAliases
Namespace aliases.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetMessageCacheStorage()
Get the cache object used by the message cache.
wfGetMainCache()
Get the main cache object.
wfMkdirParents( $dir, $mode=null, $caller=null)
Make directory, and make all parent directories if they don't exist.
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
if(! $wgDBerrorLogTZ) $wgRequest
Class for a file system (FS) based file backend.
static destroySingleton()
Destroy the singleton instance.
static destroySingleton()
Destroy the singleton instance, so that a new one will be created next time singleton() is called.
static resetMain()
Resets singleton returned by getMain().
static getMain()
Static methods.
Class to implement stub globals, which are globals that delay loading the their associated module cod...
static deleteDirs( $dirs)
Delete the specified directories, if they exist.
static deleteFiles( $files)
Delete the specified files, if they exist.
setupUploadDir()
Create a dummy uploads directory which will contain a couple of files in order to pass existence test...
static addTables(&$tables)
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $messageMemc
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $wgMemc
controlled by $wgMainCacheType * $parserMemc