From: Victor Vasiliev Date: Sun, 6 Jul 2008 20:39:11 +0000 (+0000) Subject: Some debug logging for image moving X-Git-Tag: 1.31.0-rc.0~46684 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=0c553878f22c37a477cc46768c6dbd8a7c668287;p=lhc%2Fweb%2Fwiklou.git Some debug logging for image moving --- diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 84839afd02..26c732a9ff 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -968,15 +968,19 @@ class LocalFile extends File * @return FileRepoStatus object. */ function move( $target ) { + wfDebugLog( 'imagemove', "Got request to move {$this->name} to " . $target->getText() ); $this->lock(); $batch = new LocalFileMoveBatch( $this, $target ); $batch->addCurrent(); $batch->addOlds(); if( !$this->repo->canTransformVia404() ) { + wfDebugLog( 'imagemove', 'Cannot transform via 404, so move thumbnails' ); $batch->addThumbs(); - } + } else + wfDebugLog( 'imagemove', 'No moving thumbnails, ok to transform via 404' ); $status = $batch->execute(); + wfDebugLog( 'imagemove', "Finished moving {$this->name}" ); $this->purgeEverything(); $this->unlock(); @@ -1764,8 +1768,11 @@ class LocalFileMoveBatch { $triplets = $this->getMoveTriplets(); $statusDb = $this->doDBUpdates(); + wfDebugLog( 'imagemove', "Renamed {$this->file->name} in database: {$statusDb->successCount} successes, {$statusDb->failCount} failures" ); $statusMove = $repo->storeBatch( $triplets, FSRepo::DELETE_SOURCE ); + wfDebugLog( 'imagemove', "Moved files for {$this->file->name}: {$statusMove->successCount} successes, {$statusMove->failCount} failures" ); if( !$statusMove->isOk() ) { + wfDebugLog( 'imagemove', "Error in moving files: " . $statusMove->getWikiText() ); $this->db->rollback(); } $status->merge( $statusDb ); @@ -1817,6 +1824,7 @@ class LocalFileMoveBatch { // $move: (oldRelativePath, newRelativePath) $srcUrl = $this->file->repo->getVirtualUrl() . '/public/' . rawurlencode( $move[0] ); $triplets[] = array( $srcUrl, 'public', $move[1] ); + wfDebugLog( 'imagemove', "Generated move triplet for {$this->file->name}: {$srcUrl} :: public :: {$move[1]}" ); } return $triplets; }