dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "EditPage: Extract some edit conflict code into EditConflictHelper"
[lhc/web/wiklou.git]
/
maintenance
/
refreshImageMetadata.php
diff --git
a/maintenance/refreshImageMetadata.php
b/maintenance/refreshImageMetadata.php
index
372c352
..
b7f03d9
100644
(file)
--- a/
maintenance/refreshImageMetadata.php
+++ b/
maintenance/refreshImageMetadata.php
@@
-29,6
+29,9
@@
require_once __DIR__ . '/Maintenance.php';
require_once __DIR__ . '/Maintenance.php';
+use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
/**
* Maintenance script to refresh image metadata fields.
*
/**
* Maintenance script to refresh image metadata fields.
*
@@
-37,7
+40,7
@@
require_once __DIR__ . '/Maintenance.php';
class RefreshImageMetadata extends Maintenance {
/**
class RefreshImageMetadata extends Maintenance {
/**
- * @var Database
+ * @var
IMaintainable
Database
*/
protected $dbw;
*/
protected $dbw;
@@
-121,21
+124,22
@@
class RefreshImageMetadata extends Maintenance {
'ORDER BY' => 'img_name ASC',
];
'ORDER BY' => 'img_name ASC',
];
+ $fileQuery = LocalFile::getQueryInfo();
+
do {
$res = $dbw->select(
do {
$res = $dbw->select(
-
'image'
,
-
'*'
,
+
$fileQuery['tables']
,
+
$fileQuery['fields']
,
array_merge( $conds, $conds2 ),
__METHOD__,
array_merge( $conds, $conds2 ),
__METHOD__,
- $options
+ $options,
+ $fileQuery['joins']
);
if ( $res->numRows() > 0 ) {
$row1 = $res->current();
);
if ( $res->numRows() > 0 ) {
$row1 = $res->current();
- $this->output( "Processing next {$
this->mBatchSize} rows
starting with {$row1->img_name}.\n" );
+ $this->output( "Processing next {$
res->numRows()} row(s)
starting with {$row1->img_name}.\n" );
$res->rewind();
$res->rewind();
- } else {
- $this->error( "No images to process.", 4 );
}
foreach ( $res as $row ) {
}
foreach ( $res as $row ) {
@@
-205,7
+209,7
@@
class RefreshImageMetadata extends Maintenance {
}
/**
}
/**
- * @param Database $dbw
+ * @param
I
Database $dbw
* @return array
*/
function getConditions( $dbw ) {
* @return array
*/
function getConditions( $dbw ) {