X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupImages.php;h=915a2c0801a6483f6abe19afdb2cabcda4c88646;hb=58ebffe914d1c6fcc8840daba60b911a0fe767ad;hp=1b46ab87a449944df1b67b8ec9a0beea869911c9;hpb=92ca07413b935ad05928caf1cc8f76eb7807a2b6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupImages.php b/maintenance/cleanupImages.php index 1b46ab87a4..915a2c0801 100644 --- a/maintenance/cleanupImages.php +++ b/maintenance/cleanupImages.php @@ -56,6 +56,7 @@ class ImageCleanup extends TableCleanup { if ( $source == '' ) { // Ye olde empty rows. Just kill them. $this->killRow( $source ); + return $this->progress( 1 ); } @@ -82,6 +83,7 @@ class ImageCleanup extends TableCleanup { return $this->progress( 0 ); } $this->pokeFile( $source, $safe ); + return $this->progress( 1 ); } @@ -89,6 +91,7 @@ class ImageCleanup extends TableCleanup { $munged = $title->getDBkey(); $this->output( "page $source ($munged) doesn't match self.\n" ); $this->pokeFile( $source, $munged ); + return $this->progress( 1 ); } @@ -114,6 +117,7 @@ class ImageCleanup extends TableCleanup { if ( !isset( $this->repo ) ) { $this->repo = RepoGroup::singleton()->getLocalRepo(); } + return $this->repo->getRootDirectory() . '/' . $this->repo->getHashPath( $name ) . $name; } @@ -135,6 +139,7 @@ class ImageCleanup extends TableCleanup { if ( !file_exists( $path ) ) { $this->output( "missing file: $path\n" ); $this->killRow( $orig ); + return; } @@ -150,7 +155,7 @@ class ImageCleanup extends TableCleanup { $version = 0; $final = $new; $conflict = ( $this->imageExists( $final, $db ) || - ( $this->pageExists( $orig, $db ) && $this->pageExists( $final, $db ) ) ); + ( $this->pageExists( $orig, $db ) && $this->pageExists( $final, $db ) ) ); while ( $conflict ) { $this->output( "Rename conflicts with '$final'...\n" ); @@ -184,6 +189,7 @@ class ImageCleanup extends TableCleanup { if ( !wfMkdirParents( $dir, null, __METHOD__ ) ) { $this->output( "RENAME FAILED, COULD NOT CREATE $dir" ); $db->rollback( __METHOD__ ); + return; } } @@ -210,6 +216,7 @@ class ImageCleanup extends TableCleanup { $test = Title::makeTitleSafe( NS_FILE, $x ); if ( is_null( $test ) || $test->getDBkey() !== $x ) { $this->error( "Unable to generate safe title from '$name', got '$x'" ); + return false; }