Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/97338
Change subject: Break lon glines in file repo files
......................................................................
Break lon glines in file repo files
Change-Id: I6d95c1b3e14a947a92127efa681007baaeab89ba
---
M includes/filerepo/FileRepo.php
M includes/filerepo/ForeignAPIRepo.php
M includes/filerepo/file/File.php
M includes/filerepo/file/LocalFile.php
M includes/filerepo/file/UnregisteredLocalFile.php
5 files changed, 39 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/38/97338/1
diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php
index 963a252..55fa39d 100644
--- a/includes/filerepo/FileRepo.php
+++ b/includes/filerepo/FileRepo.php
@@ -72,7 +72,8 @@
|| !array_key_exists( 'name', $info )
|| !array_key_exists( 'backend', $info )
) {
- throw new MWException( __CLASS__ . " requires an array
of options having both 'name' and 'backend' keys.\n" );
+ throw new MWException( __CLASS__ .
+ " requires an array of options having both
'name' and 'backend' keys.\n" );
}
// Required settings
@@ -206,11 +207,14 @@
* @return String or false
*/
public function getZoneUrl( $zone, $ext = null ) {
- if ( in_array( $zone, array( 'public', 'temp', 'thumb',
'transcoded' ) ) ) { // standard public zones
+ if ( in_array( $zone, array( 'public', 'temp', 'thumb',
'transcoded' ) ) ) {
+ // standard public zones
if ( $ext !== null && isset(
$this->zones[$zone]['urlsByExt'][$ext] ) ) {
- return $this->zones[$zone]['urlsByExt'][$ext];
// custom URL for extension/zone
+ // custom URL for extension/zone
+ return $this->zones[$zone]['urlsByExt'][$ext];
} elseif ( isset( $this->zones[$zone]['url'] ) ) {
- return $this->zones[$zone]['url']; // custom
URL for zone
+ // custom URL for zone
+ return $this->zones[$zone]['url'];
}
}
switch ( $zone ) {
diff --git a/includes/filerepo/ForeignAPIRepo.php
b/includes/filerepo/ForeignAPIRepo.php
index b4db653..616f881 100644
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -316,7 +316,8 @@
* @param string $name is a dbkey form of a title
* @param $width
* @param $height
- * @param string $params Other rendering parameters (page number, etc)
from handler's makeParamString.
+ * @param string $params Other rendering parameters (page number, etc)
+ * from handler's makeParamString.
* @return bool|string
*/
function getThumbUrlFromCache( $name, $width, $height, $params = "" ) {
@@ -365,7 +366,8 @@
}
$localPath = $this->getZonePath( 'thumb' ) . "/" .
$this->getHashPath( $name ) . $name;
$localFilename = $localPath . "/" . $fileName;
- $localUrl = $this->getZoneUrl( 'thumb' ) . "/" .
$this->getHashPath( $name ) . rawurlencode( $name ) . "/" . rawurlencode(
$fileName );
+ $localUrl = $this->getZoneUrl( 'thumb' ) . "/" .
$this->getHashPath( $name ) .
+ rawurlencode( $name ) . "/" . rawurlencode( $fileName );
if ( $backend->fileExists( array( 'src' => $localFilename ) )
&& isset( $metadata['timestamp'] )
diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php
index b7a504a..8e6dc8d 100644
--- a/includes/filerepo/file/File.php
+++ b/includes/filerepo/file/File.php
@@ -1473,7 +1473,9 @@
* @return bool
* @throws MWException
*/
- function recordUpload( $oldver, $desc, $license = '', $copyStatus = '',
$source = '', $watch = false, $timestamp = false, User $user = null ) {
+ function recordUpload( $oldver, $desc, $license = '', $copyStatus = '',
$source = '',
+ $watch = false, $timestamp = false, User $user = null
+ ) {
$this->readOnlyError();
}
diff --git a/includes/filerepo/file/LocalFile.php
b/includes/filerepo/file/LocalFile.php
index d94bbad..3c15449 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -291,7 +291,8 @@
*/
function getCacheFields( $prefix = 'img_' ) {
static $fields = array( 'size', 'width', 'height', 'bits',
'media_type',
- 'major_mime', 'minor_mime', 'metadata', 'timestamp',
'sha1', 'user', 'user_text', 'description' );
+ 'major_mime', 'minor_mime', 'metadata', 'timestamp',
'sha1', 'user',
+ 'user_text', 'description' );
static $results = array();
if ( $prefix == '' ) {
@@ -1090,7 +1091,9 @@
* @return FileRepoStatus object. On success, the value member contains
the
* archive name, or an empty string if it was a new file.
*/
- function upload( $srcPath, $comment, $pageText, $flags = 0, $props =
false, $timestamp = false, $user = null ) {
+ function upload( $srcPath, $comment, $pageText, $flags = 0, $props =
false,
+ $timestamp = false, $user = null
+ ) {
global $wgContLang;
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
@@ -1369,7 +1372,13 @@
# There's already a log entry, so don't make a second
RC entry
# Squid and file cache for the description page are
purged by doEditContent.
$content = ContentHandler::makeContent( $pageText,
$descTitle );
- $status = $wikiPage->doEditContent( $content, $comment,
EDIT_NEW | EDIT_SUPPRESS_RC, false, $user );
+ $status = $wikiPage->doEditContent(
+ $content,
+ $comment,
+ EDIT_NEW | EDIT_SUPPRESS_RC,
+ false,
+ $user
+ );
$dbw->begin( __METHOD__ ); // XXX; doEdit() uses a
transaction
// Now that the page exists, make an RC entry.
@@ -2291,7 +2300,8 @@
continue;
}
- $deletedRel = $this->file->repo->getDeletedHashPath(
$row->fa_storage_key ) . $row->fa_storage_key;
+ $deletedRel = $this->file->repo->getDeletedHashPath(
$row->fa_storage_key ) .
+ $row->fa_storage_key;
$deletedUrl = $this->file->repo->getVirtualUrl() .
'/deleted/' . $deletedRel;
if ( isset( $row->fa_sha1 ) ) {
@@ -2671,13 +2681,15 @@
return $statusDb;
}
- wfDebugLog( 'imagemove', "Renamed {$this->file->getName()} in
database: {$statusDb->successCount} successes, {$statusDb->failCount} failures"
);
+ wfDebugLog( 'imagemove', "Renamed {$this->file->getName()} in
database: " .
+ "{$statusDb->successCount} successes,
{$statusDb->failCount} failures" );
// Copy the files into their new location.
// If a prior process fataled copying or cleaning up files we
tolerate any
// of the existing files if they are identical to the ones
being stored.
$statusMove = $repo->storeBatch( $triplets,
FileRepo::OVERWRITE_SAME );
- wfDebugLog( 'imagemove', "Moved files for
{$this->file->getName()}: {$statusMove->successCount} successes,
{$statusMove->failCount} failures" );
+ wfDebugLog( 'imagemove', "Moved files for
{$this->file->getName()}: " .
+ "{$statusMove->successCount} successes,
{$statusMove->failCount} failures" );
if ( !$statusMove->isGood() ) {
// Delete any files copied over (while the destination
is still locked)
$this->cleanupTarget( $triplets );
@@ -2764,7 +2776,10 @@
// $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->getName()}: {$srcUrl} :: public :: {$move[1]}" );
+ wfDebugLog(
+ 'imagemove',
+ "Generated move triplet for
{$this->file->getName()}: {$srcUrl} :: public :: {$move[1]}"
+ );
}
return $triplets;
diff --git a/includes/filerepo/file/UnregisteredLocalFile.php
b/includes/filerepo/file/UnregisteredLocalFile.php
index 0d9a830..e7fa46e 100644
--- a/includes/filerepo/file/UnregisteredLocalFile.php
+++ b/includes/filerepo/file/UnregisteredLocalFile.php
@@ -71,7 +71,8 @@
*/
function __construct( $title = false, $repo = false, $path = false,
$mime = false ) {
if ( !( $title && $repo ) && !$path ) {
- throw new MWException( __METHOD__ . ': not enough
parameters, must specify title and repo, or a full path' );
+ throw new MWException( __METHOD__ .
+ ': not enough parameters, must specify title
and repo, or a full path' );
}
if ( $title instanceof Title ) {
$this->title = File::normalizeTitle( $title,
'exception' );
--
To view, visit https://gerrit.wikimedia.org/r/97338
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d95c1b3e14a947a92127efa681007baaeab89ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits