From 9a3c7b43ea1e440a30dac778eee77627f56687db Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 24 Sep 2015 18:27:28 -0700 Subject: [PATCH] Move FileContentsHasher into includes/utils/ The class only contains two dependencies upon MediaWiki (ObjectCache & wfGlobalCacheKey) which are suitable for inclusion in the utils directory. Change-Id: I85b4c763be2670c40f26d93e75cedcb68eaa7987 --- autoload.php | 2 +- includes/{ => utils}/FileContentsHasher.php | 0 tests/phpunit/includes/{ => utils}/FileContentsHasherTest.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename includes/{ => utils}/FileContentsHasher.php (100%) rename tests/phpunit/includes/{ => utils}/FileContentsHasherTest.php (96%) diff --git a/autoload.php b/autoload.php index 9cb5b43ad9..f1b0a6cae7 100644 --- a/autoload.php +++ b/autoload.php @@ -430,7 +430,7 @@ $wgAutoloadLocalClasses = array( 'FileBackendStoreShardListIterator' => __DIR__ . '/includes/filebackend/FileBackendStore.php', 'FileBasedSiteLookup' => __DIR__ . '/includes/site/FileBasedSiteLookup.php', 'FileCacheBase' => __DIR__ . '/includes/cache/FileCacheBase.php', - 'FileContentsHasher' => __DIR__ . '/includes/FileContentsHasher.php', + 'FileContentsHasher' => __DIR__ . '/includes/utils/FileContentsHasher.php', 'FileDeleteForm' => __DIR__ . '/includes/FileDeleteForm.php', 'FileDependency' => __DIR__ . '/includes/cache/CacheDependency.php', 'FileDuplicateSearchPage' => __DIR__ . '/includes/specials/SpecialFileDuplicateSearch.php', diff --git a/includes/FileContentsHasher.php b/includes/utils/FileContentsHasher.php similarity index 100% rename from includes/FileContentsHasher.php rename to includes/utils/FileContentsHasher.php diff --git a/tests/phpunit/includes/FileContentsHasherTest.php b/tests/phpunit/includes/utils/FileContentsHasherTest.php similarity index 96% rename from tests/phpunit/includes/FileContentsHasherTest.php rename to tests/phpunit/includes/utils/FileContentsHasherTest.php index eb63649788..a03e1fc416 100644 --- a/tests/phpunit/includes/FileContentsHasherTest.php +++ b/tests/phpunit/includes/utils/FileContentsHasherTest.php @@ -8,7 +8,7 @@ class FileContentsHasherTest extends MediaWikiTestCase { public function provideSingleFile() { return array_map( function ( $file ) { return array( $file, file_get_contents( $file ) ); - }, glob( __DIR__ . '/../data/filecontentshasher/*.*' ) ); + }, glob( __DIR__ . '/../../data/filecontentshasher/*.*' ) ); } public function provideMultipleFiles() { -- 2.20.1