41 $this->doesExist = isset( $_FILES[$key] );
42 if ( $this->doesExist ) {
43 $this->fileInfo = $_FILES[$key];
67 $name = $this->fileInfo[
'name'];
69 # Safari sends filenames in HTML-encoded Unicode form D...
70 # Horrid and evil! Let's try to make some kind of sense of it.
73 wfDebug( __METHOD__ .
": {$this->fileInfo['name']} normalized to '$name'\n" );
87 return $this->fileInfo[
'size'];
100 return $this->fileInfo[
'tmp_name'];
111 return 0; # UPLOAD_ERR_OK
114 return $this->fileInfo[
'error'];
124 if ( $this->
getError() == UPLOAD_ERR_INI_SIZE ) {
125 # PHP indicated that upload_max_filesize is exceeded
129 $contentLength = $this->
request->getHeader(
'Content-Length' );
131 ini_get(
'post_max_size' ) ?: ini_get(
'hhvm.server.max_post_size' ),
135 if ( $maxPostSize && $contentLength > $maxPostSize ) {
136 # post_max_size is exceeded
__construct($request, $key)
Constructor.
getSize()
Return the file size of the uploaded file.
wfShorthandToInteger($string= '', $default=-1)
Converts shorthand byte notation to integer form.
getName()
Return the original filename of the uploaded file.
when a variable name is used in a it is silently declared as a new local masking the global
getError()
Return the upload error.
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
getTempName()
Return the path to the temporary file.
static decodeCharReferences($text)
Decode any character references, numeric or named entities, in the text and return a UTF-8 string...
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging a wrapping ErrorException instead of letting the login form give the generic error message that the account does not exist For when the account has been renamed or deleted or an array to pass a message key and parameters create2 Corresponds to logging log_action database field and which is displayed in the UI similar to $comment this hook should only be used to add variables that depend on the current page request
isIniSizeOverflow()
Returns whether this upload failed because of overflow of a maximum set in php.ini.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
exists()
Return whether a file with this name was uploaded.
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 and the local content language as $wgContLang
Object to access the $_FILES array.
Allows to change the fields on the form that will be generated $name