15 'wgEnableUploads' =>
true,
16 'wgAllowCopyUploads' =>
true,
19 if (
wfLocalFile(
'UploadFromUrlTest.png' )->exists() ) {
34 $module->getResult()->getResultData( null, [
'Strip' =>
'all' ] ),
47 $this->assertFalse(
$job );
54 $token = $this->
user->getEditToken();
63 $this->assertEquals(
"The token parameter must be set", $e->getMessage() );
65 $this->assertTrue( $exception,
"Got exception" );
75 $this->assertEquals(
"One of the parameters sessionkey, file, url is required",
78 $this->assertTrue( $exception,
"Got exception" );
84 'url' =>
'http://www.example.com/test.png',
89 $this->assertEquals(
"The filename parameter must be set", $e->getMessage() );
91 $this->assertTrue( $exception,
"Got exception" );
93 $this->
user->removeGroup(
'sysop' );
98 'url' =>
'http://www.example.com/test.png',
99 'filename' =>
'UploadFromUrlTest.png',
104 $this->assertEquals(
"Permission denied", $e->getMessage() );
106 $this->assertTrue( $exception,
"Got exception" );
113 $token = $this->
user->getEditToken();
116 $this->assertFalse(
$job,
'Starting with an empty jobqueue' );
118 $this->
user->addGroup(
'users' );
120 'action' =>
'upload',
121 'filename' =>
'UploadFromUrlTest.png',
122 'url' =>
'http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png',
123 'ignorewarnings' =>
true,
128 $this->assertFalse(
$job );
130 $this->assertEquals(
'Success', $data[0][
'upload'][
'result'] );
138 $this->assertTrue(
$t->exists(),
"File '$name' exists" );
140 if (
$t->exists() ) {
145 $page->doDeleteArticle(
"testing" );
149 $this->assertFalse(
$t->exists(),
"File '$name' was deleted" );
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
the array() calling protocol came about after MediaWiki 1.4rc1.
if(!$wgDBerrorLogTZ) $wgRequest
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
doApiRequest(array $params, array $unused=null, $appendModule=false, User $user=null)
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
when a variable name is used in a it is silently declared as a new local masking the global
testSetupUrlDownload($data)
testClearQueue
wfLocalFile($title)
Get an object referring to a locally registered file.
testClearQueue()
Ensure that the job queue is empty before continuing.
testSyncDownload($data)
testClearQueue
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 and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Wikitext formatted, in the key only.
This is the main API class, used for both external and internal processing.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
static singleton($wiki=false)
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
this hook is for auditing only $req
wfFindFile($title, $options=[])
Find a file.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
This exception will be thrown when dieUsage is called to stop module execution.
Allows to change the fields on the form that will be generated $name