From 53f96171cccb378824f8708c3fe41cfb0fcdd62e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 20 Dec 2011 23:47:53 +0000 Subject: [PATCH] FU r106752: use "media-" instead of "images-" in container names. Long live books, video, 3D meshes, and animated holograms from the future! --- includes/Setup.php | 10 +++++----- includes/filerepo/FSRepo.php | 10 +++++----- includes/filerepo/FileRepo.php | 2 +- includes/filerepo/backend/FileBackendGroup.php | 1 + tests/parser/parserTest.inc | 10 +++++----- tests/phpunit/includes/LocalFileTest.php | 16 ++++++++-------- .../phpunit/includes/media/ExifRotationTest.php | 2 +- tests/phpunit/includes/parser/NewParserTest.php | 4 ++-- tests/phpunit/suites/UploadFromUrlTestSuite.php | 10 +++++----- 9 files changed, 33 insertions(+), 32 deletions(-) diff --git a/includes/Setup.php b/includes/Setup.php index d842e7abfb..cf8c7cb94f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -240,7 +240,7 @@ function wfBackendForLegacyRepoConf( &$info ) { // Disable "deleted" zone in repo config if deleted dir not set if ( $deletedDir !== false ) { $info['zones']['deleted'] = array( - 'container' => 'images-deleted', 'directory' => '' ); + 'container' => 'media-deleted', 'directory' => '' ); } // Get the FS backend configuration return array( @@ -248,10 +248,10 @@ function wfBackendForLegacyRepoConf( &$info ) { 'class' => 'FSFileBackend', 'lockManager' => 'fsLockManager', 'containerPaths' => array( - "images-public" => "{$directory}", - "images-temp" => "{$directory}/temp", - "images-thumb" => $thumbDir, - "images-deleted" => $deletedDir + "media-public" => "{$directory}", + "media-temp" => "{$directory}/temp", + "media-thumb" => $thumbDir, + "media-deleted" => $deletedDir ), 'fileMode' => $fileMode, ); diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php index f33f09e5ba..92e7295083 100644 --- a/includes/filerepo/FSRepo.php +++ b/includes/filerepo/FSRepo.php @@ -35,10 +35,10 @@ class FSRepo extends FileRepo { 'name' => $info['name'] . '-backend', 'lockManager' => 'fsLockManager', 'containerPaths' => array( - "images-public" => "{$directory}", - "images-temp" => "{$directory}/temp", - "images-thumb" => $thumbDir, - "images-deleted" => $deletedDir + "media-public" => "{$directory}", + "media-temp" => "{$directory}/temp", + "media-thumb" => $thumbDir, + "media-deleted" => $deletedDir ), 'fileMode' => $fileMode, ) ); @@ -47,7 +47,7 @@ class FSRepo extends FileRepo { // Set "deleted" zone in repo if deletedDir is configured if ( $deletedDir !== false ) { $info['zones']['deleted'] = array( - 'container' => 'images-deleted', 'directory' => '' ); + 'container' => 'media-deleted', 'directory' => '' ); } } diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index ec0711ec53..4097db127a 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -89,7 +89,7 @@ class FileRepo { ); } else { $this->zones[$zone] = array( - 'container' => "images-$zone", + 'container' => "media-$zone", 'directory' => '' // container root ); } diff --git a/includes/filerepo/backend/FileBackendGroup.php b/includes/filerepo/backend/FileBackendGroup.php index a0c1e85b7b..dc9da98d3f 100644 --- a/includes/filerepo/backend/FileBackendGroup.php +++ b/includes/filerepo/backend/FileBackendGroup.php @@ -2,6 +2,7 @@ /** * @file * @ingroup FileBackend + * @author Aaron Schulz */ /** diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 37ae04fe8c..8e40de5651 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -153,10 +153,10 @@ class ParserTest { 'name' => 'local-backend', 'lockManager' => 'fsLockManager', 'containerPaths' => array( - 'images-public' => wfTempDir() . '/test-repo/public', - 'images-thumb' => wfTempDir() . '/test-repo/thumb', - 'images-temp' => wfTempDir() . '/test-repo/temp', - 'images-deleted' => wfTempDir() . '/test-repo/delete', + 'media-public' => wfTempDir() . '/test-repo/public', + 'media-thumb' => wfTempDir() . '/test-repo/thumb', + 'media-temp' => wfTempDir() . '/test-repo/temp', + 'media-deleted' => wfTempDir() . '/test-repo/delete', ) ) ); $wgLocalFileRepo = array( @@ -167,7 +167,7 @@ class ParserTest { 'transformVia404' => false, 'backend' => $backend, 'zones' => array( 'deleted' => array( - 'container' => 'images-deleted', 'directory' => '' ) ) + 'container' => 'media-deleted', 'directory' => '' ) ) ); $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'; $wgNamespaceAliases['Image'] = NS_FILE; diff --git a/tests/phpunit/includes/LocalFileTest.php b/tests/phpunit/includes/LocalFileTest.php index cae2e10878..c0982d2fab 100644 --- a/tests/phpunit/includes/LocalFileTest.php +++ b/tests/phpunit/includes/LocalFileTest.php @@ -54,17 +54,17 @@ class LocalFileTest extends MediaWikiTestCase { } function testGetArchivePath() { - $this->assertEquals( 'mwstore://local-backend/images-public/archive', $this->file_hl0->getArchivePath() ); - $this->assertEquals( 'mwstore://local-backend/images-public/archive/a/a2', $this->file_hl2->getArchivePath() ); - $this->assertEquals( 'mwstore://local-backend/images-public/archive/!', $this->file_hl0->getArchivePath( '!' ) ); - $this->assertEquals( 'mwstore://local-backend/images-public/archive/a/a2/!', $this->file_hl2->getArchivePath( '!' ) ); + $this->assertEquals( 'mwstore://local-backend/media-public/archive', $this->file_hl0->getArchivePath() ); + $this->assertEquals( 'mwstore://local-backend/media-public/archive/a/a2', $this->file_hl2->getArchivePath() ); + $this->assertEquals( 'mwstore://local-backend/media-public/archive/!', $this->file_hl0->getArchivePath( '!' ) ); + $this->assertEquals( 'mwstore://local-backend/media-public/archive/a/a2/!', $this->file_hl2->getArchivePath( '!' ) ); } function testGetThumbPath() { - $this->assertEquals( 'mwstore://local-backend/images-thumb/Test!', $this->file_hl0->getThumbPath() ); - $this->assertEquals( 'mwstore://local-backend/images-thumb/a/a2/Test!', $this->file_hl2->getThumbPath() ); - $this->assertEquals( 'mwstore://local-backend/images-thumb/Test!/x', $this->file_hl0->getThumbPath( 'x' ) ); - $this->assertEquals( 'mwstore://local-backend/images-thumb/a/a2/Test!/x', $this->file_hl2->getThumbPath( 'x' ) ); + $this->assertEquals( 'mwstore://local-backend/media-thumb/Test!', $this->file_hl0->getThumbPath() ); + $this->assertEquals( 'mwstore://local-backend/media-thumb/a/a2/Test!', $this->file_hl2->getThumbPath() ); + $this->assertEquals( 'mwstore://local-backend/media-thumb/Test!/x', $this->file_hl0->getThumbPath( 'x' ) ); + $this->assertEquals( 'mwstore://local-backend/media-thumb/a/a2/Test!/x', $this->file_hl2->getThumbPath( 'x' ) ); } function testGetArchiveUrl() { diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php index 6cabd9a557..592b193514 100644 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ b/tests/phpunit/includes/media/ExifRotationTest.php @@ -13,7 +13,7 @@ class ExifRotationTest extends MediaWikiTestCase { $this->backend = new FSFileBackend( array( 'name' => 'localtesting', 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'images-thumb' => $tmpDir, 'data' => $filePath ) + 'containerPaths' => array( 'media-thumb' => $tmpDir, 'data' => $filePath ) ) ); $this->repo = new FSRepo( array( 'name' => 'temp', diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index a939e91e51..4bf428df68 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -321,8 +321,8 @@ class NewParserTest extends MediaWikiTestCase { 'class' => 'FSFileBackend', 'lockManager' => 'nullLockManager', 'containerPaths' => array( - 'images-public' => $this->uploadDir, - 'images-thumb' => $this->uploadDir . '/thumb' ) + 'media-public' => $this->uploadDir, + 'media-thumb' => $this->uploadDir . '/thumb' ) ); FileBackendGroup::singleton()->register( array( $backend ) ); diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index 92a00d2f19..e9c1963263 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -30,10 +30,10 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { 'name' => 'local-backend', 'lockManager' => 'fsLockManager', 'containerPaths' => array( - 'images-public' => wfTempDir() . '/test-repo/public', - 'images-thumb' => wfTempDir() . '/test-repo/thumb', - 'images-temp' => wfTempDir() . '/test-repo/temp', - 'images-deleted' => wfTempDir() . '/test-repo/delete', + 'media-public' => wfTempDir() . '/test-repo/public', + 'media-thumb' => wfTempDir() . '/test-repo/thumb', + 'media-temp' => wfTempDir() . '/test-repo/temp', + 'media-deleted' => wfTempDir() . '/test-repo/delete', ) ) ); $wgLocalFileRepo = array( @@ -44,7 +44,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { 'transformVia404' => false, 'backend' => $backend, 'zones' => array( 'deleted' => array( - 'container' => 'images-deleted', 'directory' => '' ) ) + 'container' => 'media-deleted', 'directory' => '' ) ) ); $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'; $wgNamespaceAliases['Image'] = NS_FILE; -- 2.20.1