class ImageBuilder extends Maintenance {
/**
- * @var DatabaseBase
+ * @var Database
*/
protected $dbw;
$this->init( $count, $table );
$this->output( "Processing $table...\n" );
- $result = $this->getDB( DB_SLAVE )->select( $table, '*', array(), __METHOD__ );
+ $result = $this->getDB( DB_REPLICA )->select( $table, '*', [], __METHOD__ );
foreach ( $result as $row ) {
$update = call_user_func( $callback, $row, null );
}
function buildImage() {
- $callback = array( $this, 'imageCallback' );
+ $callback = [ $this, 'imageCallback' ];
$this->buildTable( 'image', 'img_name', $callback );
}
}
function buildOldImage() {
- $this->buildTable( 'oldimage', 'oi_archive_name', array( $this, 'oldimageCallback' ) );
+ $this->buildTable( 'oldimage', 'oi_archive_name', [ $this, 'oldimageCallback' ] );
}
function oldimageCallback( $row, $copy ) {
}
function crawlMissing() {
- $this->getRepo()->enumFiles( array( $this, 'checkMissingImage' ) );
+ $this->getRepo()->enumFiles( [ $this, 'checkMissingImage' ] );
}
function checkMissingImage( $fullpath ) {
$filename = wfBaseName( $fullpath );
$row = $this->dbw->selectRow( 'image',
- array( 'img_name' ),
- array( 'img_name' => $filename ),
+ [ 'img_name' ],
+ [ 'img_name' => $filename ],
__METHOD__ );
if ( !$row ) { // file not registered