Go to the documentation of this file.
3 require_once dirname( __DIR__ ) .
'/includes/upload/UploadFromUrlTest.php';
24 $tmpGlobals =
array();
26 $tmpGlobals[
'wgScript'] =
'/index.php';
27 $tmpGlobals[
'wgScriptPath'] =
'/';
28 $tmpGlobals[
'wgArticlePath'] =
'/wiki/$1';
29 $tmpGlobals[
'wgStylePath'] =
'/skins';
30 $tmpGlobals[
'wgThumbnailScriptPath'] =
false;
31 $tmpGlobals[
'wgLocalFileRepo'] =
array(
32 'class' =>
'LocalRepo',
34 'url' =>
'http://example.com/images',
36 'transformVia404' =>
false,
38 'name' =>
'local-backend',
39 'wikiId' => wfWikiId(),
40 'containerPaths' =>
array(
41 'local-public' =>
wfTempDir() .
'/test-repo/public',
42 'local-thumb' =>
wfTempDir() .
'/test-repo/thumb',
43 'local-temp' =>
wfTempDir() .
'/test-repo/temp',
44 'local-deleted' =>
wfTempDir() .
'/test-repo/delete',
48 foreach ( $tmpGlobals
as $var => $val ) {
49 if ( array_key_exists( $var,
$GLOBALS ) ) {
50 $this->savedGlobals[$var] =
$GLOBALS[$var];
59 $wgEnableParserCache =
false;
69 $wgOut = $context->getOutput();
71 $wgRequest = $context->getRequest();
73 if ( $wgStyleDirectory ===
false ) {
74 $wgStyleDirectory =
"$IP/skins";
82 foreach ( $this->savedGlobals
as $var => $val ) {
101 if ( $this->keepUploads ) {
108 "$dir/3/3a/Foobar.jpg",
109 "$dir/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg",
110 "$dir/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg",
111 "$dir/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg",
112 "$dir/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg",
124 "$dir/thumb/3/3a/Foobar.jpg",
144 if ( file_exists(
$file ) ) {
157 if ( is_dir(
$dir ) ) {
172 if ( $this->keepUploads ) {
175 if ( is_dir(
$dir ) ) {
182 wfDebug(
"Creating upload directory $dir\n" );
184 if ( file_exists(
$dir ) ) {
185 wfDebug(
"Already exists!\n" );
191 copy(
"$IP/skins/monobook/headbg.jpg",
"$dir/3/3a/Foobar.jpg" );
194 copy(
"$IP/skins/monobook/headbg.jpg",
"$dir/0/09/Bad.jpg" );
202 class_exists(
'UploadFromUrlTest' );
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
wfMkdirParents( $dir, $mode=null, $caller=null)
Make directory, and make all parent directories if they don't exist.
Class to implement stub globals, which are globals that delay loading the their associated module cod...
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
static addTables(&$tables)
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
controlled by $wgMainCacheType * $parserMemc
static clearPendingUpdates()
Clear all pending updates without performing them.
getLanguage()
Get the Language object.
static destroySingleton()
Destroy the singleton instance.
teardownUploadDir( $dir)
Remove the dummy uploads directory.
wfGetMainCache()
Get the main cache object.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
Group all the pieces relevant to the context of a request into one instance.
static deleteFiles( $files)
Delete the specified files, if they exist.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
static destroySingleton()
Destroy the singleton instance, so that a new one will be created next time singleton() is called.
setupUploadDir()
Create a dummy uploads directory which will contain a couple of files in order to pass existence test...
$wgNamespaceAliases['Image']
The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk".
wfGetParserCacheStorage()
Get the cache object used by the parser cache.
if(PHP_SAPI !='cli') $file
wfGetMessageCacheStorage()
Get the cache object used by the message cache.
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
wfTempDir()
Tries to get the system directory for temporary files.
Class for a file system (FS) based file backend.
if(count( $args)==0) $dir
static deleteDirs( $dirs)
Delete the specified directories, if they exist.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
if(!isset( $wgVersion)) if( $wgScript===false) if( $wgLoadScript===false) if( $wgArticlePath===false) if(!empty( $wgActionPaths) &&!isset( $wgActionPaths['view'])) if( $wgStylePath===false) if( $wgLocalStylePath===false) if( $wgStyleDirectory===false) if( $wgExtensionAssetsPath===false) if( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if(isset( $wgFileStore['deleted']['directory'])) if(isset( $wgFooterIcons['copyright']) &&isset( $wgFooterIcons['copyright']['copyright']) && $wgFooterIcons['copyright']['copyright']===array()) if(isset( $wgFooterIcons['poweredby']) &&isset( $wgFooterIcons['poweredby']['mediawiki']) && $wgFooterIcons['poweredby']['mediawiki']['src']===null) $wgNamespaceProtection[NS_MEDIAWIKI]
Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a sysadmin to set $wgName...