31 parent::__construct(
$query, $moduleName,
'df' );
43 $this->
run( $resultPageSet );
49 private function run( $resultPageSet =
null ) {
57 if (
$params[
'dir'] ==
'descending' ) {
61 $skipUntilThisDup =
false;
63 $cont = explode(
'|',
$params[
'continue'] );
65 $fromImage = $cont[0];
66 $skipUntilThisDup = $cont[1];
68 foreach ( $images as
$image => $pageId ) {
69 if (
$image < $fromImage ) {
89 foreach ( $files as $file ) {
91 $sha1s[$file->getName()] = $file->getSha1();
104 foreach ( $images as
$image => $pageId ) {
109 $dupFiles = $filesBySha1s[$sha1];
110 if (
$params[
'dir'] ==
'descending' ) {
114 foreach ( $dupFiles as $dupFile ) {
115 $dupName = $dupFile->getName();
116 if (
$image == $dupName && $dupFile->isLocal() ) {
119 if ( $skipUntilThisDup !==
false && $dupName < $skipUntilThisDup ) {
122 $skipUntilThisDup =
false;
123 if ( ++$count >
$params[
'limit'] ) {
130 if ( !
is_null( $resultPageSet ) ) {
131 $titles[] = $dupFile->getTitle();
135 'user' => $dupFile->getUser(
'text' ),
136 'timestamp' =>
wfTimestamp( TS_ISO_8601, $dupFile->getTimestamp() ),
137 'shared' => !$dupFile->isLocal(),
150 if ( !
is_null( $resultPageSet ) ) {
151 $resultPageSet->populateFromTitles(
$titles );
174 'localonly' =>
false,
180 'action=query&titles=File:Albert_Einstein_Head.jpg&prop=duplicatefiles'
181 =>
'apihelp-query+duplicatefiles-example-simple',
182 'action=query&generator=allimages&prop=duplicatefiles'
183 =>
'apihelp-query+duplicatefiles-example-generated',
188 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Duplicatefiles';
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section provided that you also meet all of these that in whole or in part contains or is derived from the Program or any part to be licensed as a whole at no charge to all third parties under the terms of this License c If the modified program normally reads commands interactively when run
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
const LIMIT_BIG1
Fast query, standard limit.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
const LIMIT_BIG2
Fast query, apihighlimits limit.
addPageSubItem( $pageId, $item, $elemname=null)
Same as addPageSubItems(), but one element of $data at a time.
A query module to list duplicates of the given file(s)
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
executeGenerator( $resultPageSet)
Execute this module as a generator.
run( $resultPageSet=null)
__construct(ApiQuery $query, $moduleName)
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getCacheMode( $params)
Get the cache mode for the data generated by this module.
getExamplesMessages()
Returns usage examples for this module.
getHelpUrls()
Return links to more detailed help pages about the module.
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
getPageSet()
Get the PageSet object to work on.
This is the main query class.
static singleton()
Get a RepoGroup instance.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check $image
namespace and then decline to actually register it & $namespaces
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
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