Remove FSRepo

Change-Id: Id6ca36cfa14077efc3d07fd5129ad9e4cc224e2c
This commit is contained in:
Reedy 2016-11-29 23:34:47 +00:00
parent af614d2c3b
commit 8b18ae7b59
4 changed files with 4 additions and 85 deletions

View 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 ==

View 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',

View file

@ -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." );
}
}
}

View 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() );
}
/**