r85200 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85199‎ | r85200 | r85201 >
Date:17:14, 2 April 2011
Author:demon
Status:ok
Tags:
Comment:
MFT r85199
Modified paths:
  • /branches/wmf/1.17wmf1/includes/filerepo/LocalFile.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/filerepo/LocalFile.php
@@ -850,8 +850,9 @@
851851 /**
852852 * Record a file upload in the upload log and the image table
853853 */
854 - function recordUpload2( $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null )
855 - {
 854+ function recordUpload2(
 855+ $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null
 856+ ) {
856857 if ( is_null( $user ) ) {
857858 global $wgUser;
858859 $user = $wgUser;
@@ -864,10 +865,14 @@
865866 $props = $this->repo->getFileProps( $this->getVirtualUrl() );
866867 }
867868
 869+ if ( $timestamp === false ) {
 870+ $timestamp = $dbw->timestamp();
 871+ }
 872+
868873 $props['description'] = $comment;
869874 $props['user'] = $user->getId();
870875 $props['user_text'] = $user->getName();
871 - $props['timestamp'] = wfTimestamp( TS_MW );
 876+ $props['timestamp'] = wfTimestamp( TS_MW, $timestamp ); // DB -> TS_MW
872877 $this->setProps( $props );
873878
874879 # Delete thumbnails
@@ -884,10 +889,6 @@
885890
886891 $reupload = false;
887892
888 - if ( $timestamp === false ) {
889 - $timestamp = $dbw->timestamp();
890 - }
891 -
892893 # Test to see if the row exists using INSERT IGNORE
893894 # This avoids race conditions by locking the row until the commit, and also
894895 # doesn't deadlock. SELECT FOR UPDATE causes a deadlock for every race condition.
Property changes on: branches/wmf/1.17wmf1/includes/filerepo/LocalFile.php
___________________________________________________________________
Added: svn:mergeinfo
895896 Merged /branches/sqlite/includes/filerepo/LocalFile.php:r58211-58321
896897 Merged /trunk/phase3/includes/filerepo/LocalFile.php:r83590,85199
897898 Merged /branches/new-installer/phase3/includes/filerepo/LocalFile.php:r43664-66004
898899 Merged /branches/wmf-deployment/includes/filerepo/LocalFile.php:r53381,60970
899900 Merged /branches/REL1_15/phase3/includes/filerepo/LocalFile.php:r51646
900901 Merged /branches/wmf/1.16wmf4/includes/filerepo/LocalFile.php:r67177,69199,76243,77266

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85199(bug 28348) Don't call wfTimestamp() twice really fast in recordUpload2() and...aaron16:49, 2 April 2011

Status & tagging log