Go to the documentation of this file.
15 'wgEnableUploads' =>
true,
16 'wgEnableAPI' =>
true,
42 $restrictDeletedVersions =
false;
44 if ( !$status->isGood() ) {
48 $page->doDeleteArticle(
"removing for test" );
79 foreach ( $dupes
as $dupe ) {
100 if ( !file_exists( $filePath ) ) {
101 throw new Exception(
"$filePath doesn't exist!" );
104 if ( !copy( $filePath, $tmpName ) ) {
105 throw new Exception(
"couldn't copy $filePath to $tmpName" );
109 $size = filesize( $tmpName );
110 if (
$size ===
false ) {
111 throw new Exception(
"couldn't stat $tmpName" );
114 $_FILES[$fieldName] =
array(
117 'tmp_name' => $tmpName,
128 if ( !file_put_contents( $tmpName, $chunkData ) ) {
129 throw new Exception(
"couldn't copy chunk data to $tmpName" );
133 $size = filesize( $tmpName );
134 if (
$size ===
false ) {
135 throw new Exception(
"couldn't stat $tmpName" );
138 $_FILES[$fieldName] =
array(
141 'tmp_name' => $tmpName,
148 if ( isset( $_FILES[
'file'][
'tmp_name'] ) ) {
149 $tmp = $_FILES[
'file'][
'tmp_name'];
150 if ( file_exists( $tmp ) ) {
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
static singleton()
Get a RepoGroup instance.
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
wfSetupSession( $sessionId=false)
Initialise php session.
deleteFileByContent( $filePath)
Helper function – given a file on the filesystem, find matching content in the db (and associated art...
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
clearFakeUploads()
Remove traces of previous fake uploads.
fakeUploadFile( $fieldName, $fileName, $type, $filePath)
Fake an upload by dumping the file into temp space, and adding info to $_FILES.
static getSha1Base36FromPath( $path)
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding,...
deleteFileByTitle( $title)
Helper function – remove files and associated articles by Title.
fakeUploadChunk( $fieldName, $fileName, $type, & $chunkData)
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
deleteFileByFileName( $fileName)
Helper function – remove files and associated articles with a particular filename.
presenting them properly to the user as errors is done by the caller $title
return false to override stock group addition can be modified try getUserPermissionsErrors userCan checks are continued by internal code can override on output return false to not delete it return false to override the default password checks & $hash
if(PHP_SAPI !='cli') $file
Represents a title within MediaWiki.
wfTempDir()
Tries to get the system directory for temporary files.
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
wfFindFile( $title, $options=array())
Find a file.
setUp()
Fixture – run before every test.