Go to the documentation of this file.
35 parent::__construct(
$query, $moduleName,
'df' );
47 $this->
run( $resultPageSet );
53 private function run( $resultPageSet =
null ) {
61 if (
$params[
'dir'] ==
'descending' ) {
62 $images = array_reverse( $images );
65 $skipUntilThisDup =
false;
66 if ( isset(
$params[
'continue'] ) ) {
67 $cont = explode(
'|',
$params[
'continue'] );
69 $fromImage = $cont[0];
70 $skipUntilThisDup = $cont[1];
72 foreach ( $images
as $image => $pageId ) {
73 if ( $image < $fromImage ) {
74 unset( $images[$image] );
81 $filesToFind = array_keys( $images );
100 $filesToFindBySha1s = array_unique( array_values( $sha1s ) );
108 foreach ( $images
as $image => $pageId ) {
109 if ( !isset( $sha1s[$image] ) ) {
112 $sha1 = $sha1s[$image];
113 $dupFiles = $filesBySha1s[$sha1];
114 if (
$params[
'dir'] ==
'descending' ) {
115 $dupFiles = array_reverse( $dupFiles );
118 foreach ( $dupFiles
as $dupFile ) {
119 $dupName = $dupFile->getName();
120 if ( $image == $dupName && $dupFile->isLocal() ) {
123 if ( $skipUntilThisDup !==
false && $dupName < $skipUntilThisDup ) {
126 $skipUntilThisDup =
false;
134 if ( !is_null( $resultPageSet ) ) {
135 $titles[] = $dupFile->getTitle();
139 'user' => $dupFile->getUser(
'text' ),
142 if ( !$dupFile->isLocal() ) {
156 if ( !is_null( $resultPageSet ) ) {
157 $resultPageSet->populateFromTitles(
$titles );
178 'localonly' =>
false,
184 'limit' =>
'How many duplicate files to return',
185 'continue' =>
'When more results are available, use this to continue',
186 'dir' =>
'The direction in which to list',
187 'localonly' =>
'Look only for files in the local repository',
196 'timestamp' =>
'timestamp',
197 'shared' =>
'boolean',
203 return 'List all files that are duplicates of the given file(s) based on hash values.';
208 'api.php?action=query&titles=File:Albert_Einstein_Head.jpg&prop=duplicatefiles',
209 'api.php?action=query&generator=allimages&prop=duplicatefiles',
214 return 'https://www.mediawiki.org/wiki/API:Properties#duplicatefiles_.2F_df';
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
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
setContinueEnumParameter( $paramName, $paramValue)
Overrides base in case of generator & smart continue to notify ApiQueryMain instead of adding them to...
getPageSet()
Get the PageSet object to work on.
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
getCacheMode( $params)
Get the cache mode for the data generated by this module.
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
run( $resultPageSet=null)
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
getResultProperties()
Returns possible properties in the result, grouped by the value of the prop parameter that shows them...
getExamples()
Returns usage examples for this module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
dieContinueUsageIf( $condition)
Die with the $prefix.
getDescription()
Returns the description string for this module.
executeGenerator( $resultPageSet)
Execute this module as a generator.
if(PHP_SAPI !='cli') $file
namespace and then decline to actually register it & $namespaces
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
__construct( $query, $moduleName)
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
getParamDescription()
Returns an array of parameter descriptions.
A query module to list duplicates of the given file(s)
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
addPageSubItem( $pageId, $item, $elemname=null)
Same as addPageSubItems(), but one element of $data at a time.