Remove FSRepo
authorReedy <reedy@wikimedia.org>
Tue, 29 Nov 2016 23:34:47 +0000 (23:34 +0000)
committerReedy <reedy@wikimedia.org>
Wed, 21 Dec 2016 19:08:41 +0000 (19:08 +0000)
Change-Id: Id6ca36cfa14077efc3d07fd5129ad9e4cc224e2c

RELEASE-NOTES-1.29
autoload.php
includes/filerepo/FSRepo.php [deleted file]
tests/phpunit/includes/media/MediaWikiMediaTestCase.php

index a205f01..43f21ef 100644 (file)
@@ -136,6 +136,7 @@ changes to languages because of Phabricator reports.
 * User::getPassword() (deprecated in 1.27) was removed.
 * User::getTemporaryPassword() (deprecated in 1.27) was removed.
 * User::isPasswordReminderThrottled() (deprecated in 1.27) was removed.
+* FSRepo (deprecated in 1.19) was removed.
 
 == Compatibility ==
 
index d85b679..38bf7cd 100644 (file)
@@ -447,7 +447,6 @@ $wgAutoloadLocalClasses = [
        'FSFileBackendList' => __DIR__ . '/includes/libs/filebackend/FSFileBackend.php',
        'FSFileOpHandle' => __DIR__ . '/includes/libs/filebackend/FSFileBackend.php',
        'FSLockManager' => __DIR__ . '/includes/libs/lockmanager/FSLockManager.php',
-       'FSRepo' => __DIR__ . '/includes/filerepo/FSRepo.php',
        'FakeAuthTemplate' => __DIR__ . '/includes/specialpage/LoginSignupSpecialPage.php',
        'FakeConverter' => __DIR__ . '/languages/FakeConverter.php',
        'FakeMaintenance' => __DIR__ . '/maintenance/Maintenance.php',
diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php
deleted file mode 100644 (file)
index d06acf2..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-/**
- * A repository for files accessible via the local filesystem.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup FileRepo
- */
-
-/**
- * A repository for files accessible via the local filesystem.
- * Does not support database access or registration.
- *
- * This is a mostly a legacy class. New uses should not be added.
- *
- * @ingroup FileRepo
- * @deprecated since 1.19
- */
-class FSRepo extends FileRepo {
-       /**
-        * @param array $info
-        * @throws MWException
-        */
-       function __construct( array $info ) {
-               if ( !isset( $info['backend'] ) ) {
-                       // B/C settings...
-                       $directory = $info['directory'];
-                       $deletedDir = isset( $info['deletedDir'] )
-                               ? $info['deletedDir']
-                               : false;
-                       $thumbDir = isset( $info['thumbDir'] )
-                               ? $info['thumbDir']
-                               : "{$directory}/thumb";
-                       $transcodedDir = isset( $info['transcodedDir'] )
-                               ? $info['transcodedDir']
-                               : "{$directory}/transcoded";
-                       $fileMode = isset( $info['fileMode'] )
-                               ? $info['fileMode']
-                               : 0644;
-
-                       $repoName = $info['name'];
-                       // Get the FS backend configuration
-                       $backend = new FSFileBackend( [
-                               'name' => $info['name'] . '-backend',
-                               'wikiId' => wfWikiID(),
-                               'lockManager' => LockManagerGroup::singleton( wfWikiID() )->get( 'fsLockManager' ),
-                               'containerPaths' => [
-                                       "{$repoName}-public" => "{$directory}",
-                                       "{$repoName}-temp" => "{$directory}/temp",
-                                       "{$repoName}-thumb" => $thumbDir,
-                                       "{$repoName}-transcoded" => $transcodedDir,
-                                       "{$repoName}-deleted" => $deletedDir
-                               ],
-                               'fileMode' => $fileMode,
-                               'tmpDirectory' => wfTempDir()
-                       ] );
-                       // Update repo config to use this backend
-                       $info['backend'] = $backend;
-               }
-
-               parent::__construct( $info );
-
-               if ( !( $this->backend instanceof FSFileBackend ) ) {
-                       throw new MWException( "FSRepo only supports FSFileBackend." );
-               }
-       }
-}
index e854ab5..43eb299 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 /**
- * Specificly for testing Media handlers. Sets up a FSFile backend
+ * Specificly for testing Media handlers. Sets up a FileRepo backend
  */
 abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
 
-       /** @var FSRepo */
+       /** @var FileRepo */
        protected $repo;
        /** @var FSFileBackend */
        protected $backend;
@@ -29,7 +29,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
                        'containerPaths' => $containers,
                        'tmpDirectory' => $this->getNewTempDirectory()
                ] );
-               $this->repo = new FSRepo( $this->getRepoOptions() );
+               $this->repo = new FileRepo( $this->getRepoOptions() );
        }
 
        /**