r110927 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110926‎ | r110927 | r110928 >
Date:10:00, 8 February 2012
Author:hashar
Status:ok
Tags:
Comment:
debug statement for FileRepo::storeBatch()

also nicely align some variable assignements
Modified paths:
  • /trunk/phase3/includes/filerepo/FileRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/FileRepo.php
@@ -657,6 +657,9 @@
658658 // Validate each triplet and get the store operation...
659659 foreach ( $triplets as $triplet ) {
660660 list( $srcPath, $dstZone, $dstRel ) = $triplet;
 661+ wfDebug( __METHOD__
 662+ . "( \$src='$srcPath', \$dstZone='$dstZone', \$dstRel='$dstRel' )\n"
 663+ );
661664
662665 // Resolve destination path
663666 $root = $this->getZonePath( $dstZone );
@@ -667,8 +670,7 @@
668671 throw new MWException( 'Validation error in $dstRel' );
669672 }
670673 $dstPath = "$root/$dstRel";
671 - $dstDir = dirname( $dstPath );
672 -
 674+ $dstDir = dirname( $dstPath );
673675 // Create destination directories for this triplet
674676 if ( !$backend->prepare( array( 'dir' => $dstDir ) )->isOK() ) {
675677 return $this->newFatal( 'directorycreateerror', $dstDir );
@@ -774,9 +776,9 @@
775777 * @return FileRepoStatus object with the URL in the value.
776778 */
777779 public function storeTemp( $originalName, $srcPath ) {
778 - $date = gmdate( "YmdHis" );
779 - $hashPath = $this->getHashPath( $originalName );
780 - $dstRel = "{$hashPath}{$date}!{$originalName}";
 780+ $date = gmdate( "YmdHis" );
 781+ $hashPath = $this->getHashPath( $originalName );
 782+ $dstRel = "{$hashPath}{$date}!{$originalName}";
781783 $dstUrlRel = $hashPath . $date . '!' . rawurlencode( $originalName );
782784
783785 $result = $this->store( $srcPath, 'temp', $dstRel, self::SKIP_LOCKING );

Status & tagging log