Go to the documentation of this file.
41 parent::__construct(
$title );
51 $this->mFileLoaded =
true;
58 if ( $this->mFileLoaded ) {
61 $this->mFileLoaded =
true;
64 if ( !$this->mFile ) {
67 $this->mRepo = $this->mFile->getRepo();
76 if ( $this->mFile->isLocal() ) {
77 return parent::getRedirectTarget();
80 $from = $this->mFile->getRedirected();
81 $to = $this->mFile->getName();
94 if ( $this->mFile->isLocal() ) {
95 return parent::followRedirect();
97 $from = $this->mFile->getRedirected();
98 $to = $this->mFile->getName();
110 if ( $this->mFile->isLocal() ) {
111 return parent::isRedirect();
114 return (
bool)$this->mFile->getRedirected();
122 return $this->mFile->isLocal();
138 if ( !is_null( $this->mDupes ) ) {
141 $hash = $this->mFile->getSha1();
148 $self = $this->mFile->getRepoName() .
':' . $this->mFile->getName();
149 $size = $this->mFile->getSize();
154 foreach ( $dupes
as $index =>
$file ) {
155 $key =
$file->getRepoName() .
':' .
$file->getName();
156 if ( $key ==
$self ) {
157 unset( $dupes[$index] );
159 if (
$file->getSize() != $size ) {
160 unset( $dupes[$index] );
163 $this->mDupes = $dupes;
174 if ( $this->mFile->exists() ) {
175 wfDebug(
'ImagePage::doPurge purging ' . $this->mFile->getName() .
"\n" );
180 wfDebug(
'ImagePage::doPurge no image for '
181 . $this->mFile->getName() .
"; limiting purge to cache only\n" );
188 $this->mFile->purgeCache( [
'forThumbRefresh' =>
true ] );
191 foreach ( $this->mFile->getHistory()
as $oldFile ) {
192 $oldFile->purgeCache( [
'forThumbRefresh' =>
true ] );
195 if ( $this->mRepo ) {
197 $this->mRepo->invalidateImageRedirect( $this->mTitle );
200 return parent::doPurge();
218 wfDebug( __CLASS__ .
'::' . __METHOD__ .
" is not supported for this file\n" );
223 $repo =
$file->getRepo();
224 $dbr = $repo->getReplicaDB();
227 [
'page',
'categorylinks' ],
229 'page_title' =>
'cl_to',
233 'page_namespace' =>
$title->getNamespace(),
234 'page_title' =>
$title->getDBkey(),
238 [
'categorylinks' => [
'JOIN',
'page_id = cl_from' ] ]
249 return $this->
getFile()->getRepo()->getDisplayName();
257 return $this->
getFile()->getDescriptionUrl();
static singleton()
Get a RepoGroup instance.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
static newFromResult( $res)
static addUpdate(DeferrableUpdate $update, $stage=self::POSTSEND)
Add an update to the deferred list to be run later by execute()
Class representing a MediaWiki article and history.
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
Implements some public methods and some protected utility functions which are required by multiple ch...
namespace and then decline to actually register it file or subcat img or subcat $title
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Class to represent a local file in the wiki's own database.
Class to invalidate the HTML cache of all the pages linking to a given title.
wfFindFile( $title, $options=[])
Find a file.
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
getForeignCategories()
Get the categories this file is a member of on the wiki where it was uploaded.
doPurge()
Override handling of action=purge.
Special handling for file pages.
wfLocalFile( $title)
Get an object referring to a locally registered file.
A repository that stores files in the local filesystem and registers them in the wiki's own database.