X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FOldLocalFile.php;h=ad95bb42101bf08087d1d411afe576884ed7e386;hb=2181f406ead57c296f85257ac299cf20f17d857f;hp=9759b79289d228e9d029d96a79095fb26960b67d;hpb=97af92da48f0d434cf4b541e7a3f2d96619a95b2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php index 9759b79289..ad95bb4210 100644 --- a/includes/filerepo/file/OldLocalFile.php +++ b/includes/filerepo/file/OldLocalFile.php @@ -115,13 +115,14 @@ class OldLocalFile extends LocalFile { global $wgActorTableSchemaMigrationStage; wfDeprecated( __METHOD__, '1.31' ); - if ( $wgActorTableSchemaMigrationStage > MIGRATION_WRITE_BOTH ) { + if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) { // If code is using this instead of self::getQueryInfo(), there's a // decent chance it's going to try to directly access // $row->oi_user or $row->oi_user_text and we can't give it - // useful values here once those aren't being written anymore. + // useful values here once those aren't being used anymore. throw new BadMethodCallException( - 'Cannot use ' . __METHOD__ . ' when $wgActorTableSchemaMigrationStage > MIGRATION_WRITE_BOTH' + 'Cannot use ' . __METHOD__ + . ' when $wgActorTableSchemaMigrationStage has SCHEMA_COMPAT_READ_NEW' ); } @@ -138,7 +139,7 @@ class OldLocalFile extends LocalFile { 'oi_minor_mime', 'oi_user', 'oi_user_text', - 'oi_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'oi_actor' : 'NULL', + 'oi_actor' => 'NULL', 'oi_timestamp', 'oi_deleted', 'oi_sha1', @@ -324,14 +325,14 @@ class OldLocalFile extends LocalFile { * @return string */ function getRel() { - return 'archive/' . $this->getHashPath() . $this->getArchiveName(); + return $this->getArchiveRel( $this->getArchiveName() ); } /** * @return string */ function getUrlRel() { - return 'archive/' . $this->getHashPath() . rawurlencode( $this->getArchiveName() ); + return $this->getArchiveRel( rawurlencode( $this->getArchiveName() ) ); } function upgradeRow() { @@ -415,7 +416,7 @@ class OldLocalFile extends LocalFile { function uploadOld( $srcPath, $archiveName, $timestamp, $comment, $user ) { $this->lock(); - $dstRel = 'archive/' . $this->getHashPath() . $archiveName; + $dstRel = $this->getArchiveRel( $archiveName ); $status = $this->publishTo( $srcPath, $dstRel ); if ( $status->isGood() ) {