39 parent::__construct(
$title );
49 $this->mFileLoaded =
true;
56 if ( $this->mFileLoaded ) {
59 $this->mFileLoaded =
true;
62 if ( !$this->mFile ) {
65 $this->mRepo = $this->mFile->getRepo();
74 if ( $this->mFile->isLocal() ) {
75 return parent::getRedirectTarget();
78 $from = $this->mFile->getRedirected();
79 $to = $this->mFile->getName();
83 $this->mRedirectTarget = Title::makeTitle(
NS_FILE, $to );
92 if ( $this->mFile->isLocal() ) {
93 return parent::followRedirect();
95 $from = $this->mFile->getRedirected();
96 $to = $this->mFile->getName();
100 return Title::makeTitle(
NS_FILE, $to );
108 if ( $this->mFile->isLocal() ) {
109 return parent::isRedirect();
112 return (
bool)$this->mFile->getRedirected();
120 return $this->mFile->isLocal();
136 if ( !is_null( $this->mDupes ) ) {
139 $hash = $this->mFile->getSha1();
146 $self = $this->mFile->getRepoName() .
':' . $this->mFile->getName();
147 $size = $this->mFile->getSize();
152 foreach ( $dupes
as $index => $file ) {
153 $key = $file->getRepoName() .
':' . $file->getName();
154 if ( $key ==
$self ) {
155 unset( $dupes[$index] );
157 if ( $file->getSize() != $size ) {
158 unset( $dupes[$index] );
161 $this->mDupes = $dupes;
168 if ( $this->mFile->exists() ) {
169 wfDebug(
'ImagePage::doPurge purging ' . $this->mFile->getName() .
"\n" );
170 DeferredUpdates::addUpdate(
new HTMLCacheUpdate( $this->mTitle,
'imagelinks' ) );
171 $this->mFile->purgeCache( [
'forThumbRefresh' =>
true ] );
173 wfDebug(
'ImagePage::doPurge no image for '
174 . $this->mFile->getName() .
"; limiting purge to cache only\n" );
177 $this->mFile->purgeCache( [
'forThumbRefresh' =>
true ] );
179 if ( $this->mRepo ) {
181 $this->mRepo->invalidateImageRedirect( $this->mTitle );
184 return parent::doPurge(
$flags );
202 wfDebug( __CLASS__ .
'::' . __METHOD__ .
" is not supported for this file\n" );
207 $repo = $file->getRepo();
208 $dbr = $repo->getSlaveDB();
211 [
'page',
'categorylinks' ],
213 'page_title' =>
'cl_to',
217 'page_namespace' =>
$title->getNamespace(),
218 'page_title' =>
$title->getDBkey(),
222 [
'categorylinks' => [
'INNER JOIN',
'page_id = cl_from' ] ]
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfLocalFile( $title)
Get an object referring to a locally registered file.
wfFindFile( $title, $options=[])
Find a file.
Overloads the relevant methods of the real ResultsWrapper so it doesn't go anywhere near an actual da...
Implements some public methods and some protected utility functions which are required by multiple ch...
Class to invalidate the HTML cache of all the pages linking to a given title.
Class to represent a local file in the wiki's own database.
A repository that stores files in the local filesystem and registers them in the wiki's own database.
static singleton()
Get a RepoGroup instance.
static newFromResult( $res)
Special handling for file pages.
doPurge( $flags=self::PURGE_ALL)
Perform the actions of a page purging.
getForeignCategories()
Get the categories this file is a member of on the wiki where it was uploaded.
Class representing a MediaWiki article and history.
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
the array() calling protocol came about after MediaWiki 1.4rc1.
namespace and then decline to actually register it file or subcat img or subcat $title
it s the revision text itself In either if gzip is the revision text is gzipped $flags
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