aboutsummaryrefslogtreecommitdiffstats
path: root/includes/filerepo/backend
diff options
context:
space:
mode:
authorawjrichards <arichards@wikimedia.org>2012-06-02 08:43:04 -0700
committerawjrichards <arichards@wikimedia.org>2012-06-02 08:43:04 -0700
commitee0d3d330f76b97c451c168dc9b052ee84609b5b (patch)
treedc06c32ebd4db07e98a4e498b53feeb65f2e3b10 /includes/filerepo/backend
parent7e6cd60977e92c64f0a5a1f802b986d29b468229 (diff)
downloadmediawikicore-ee0d3d330f76b97c451c168dc9b052ee84609b5b.tar.gz
mediawikicore-ee0d3d330f76b97c451c168dc9b052ee84609b5b.zip
Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
Diffstat (limited to 'includes/filerepo/backend')
-rw-r--r--includes/filerepo/backend/FileBackend.php86
-rw-r--r--includes/filerepo/backend/FileOp.php2
-rw-r--r--includes/filerepo/backend/SwiftFileBackend.php27
-rw-r--r--includes/filerepo/backend/lockmanager/FSLockManager.php12
4 files changed, 12 insertions, 115 deletions
diff --git a/includes/filerepo/backend/FileBackend.php b/includes/filerepo/backend/FileBackend.php
index 3cc902194544..42ddcbf812eb 100644
--- a/includes/filerepo/backend/FileBackend.php
+++ b/includes/filerepo/backend/FileBackend.php
@@ -401,7 +401,6 @@ abstract class FileBackend {
*
* @param $ops Array Set of operations to execute
* @return Status
- * @since 1.20
*/
final public function doQuickOperations( array $ops ) {
if ( $this->isReadOnly() ) {
@@ -415,95 +414,10 @@ abstract class FileBackend {
/**
* @see FileBackend::doQuickOperations()
- * @since 1.20
*/
abstract protected function doQuickOperationsInternal( array $ops );
/**
- * Same as doQuickOperations() except it takes a single operation.
- * If you are doing a batch of operations, then use that function instead.
- *
- * @see FileBackend::doQuickOperations()
- *
- * @param $op Array Operation
- * @return Status
- * @since 1.20
- */
- final public function doQuickOperation( array $op ) {
- return $this->doQuickOperations( array( $op ) );
- }
-
- /**
- * Performs a single quick create operation.
- * This sets $params['op'] to 'create' and passes it to doQuickOperation().
- *
- * @see FileBackend::doQuickOperation()
- *
- * @param $params Array Operation parameters
- * @return Status
- * @since 1.20
- */
- final public function quickCreate( array $params ) {
- return $this->doQuickOperation( array( 'op' => 'create' ) + $params );
- }
-
- /**
- * Performs a single quick store operation.
- * This sets $params['op'] to 'store' and passes it to doQuickOperation().
- *
- * @see FileBackend::doQuickOperation()
- *
- * @param $params Array Operation parameters
- * @return Status
- * @since 1.20
- */
- final public function quickStore( array $params ) {
- return $this->doQuickOperation( array( 'op' => 'store' ) + $params );
- }
-
- /**
- * Performs a single quick copy operation.
- * This sets $params['op'] to 'copy' and passes it to doQuickOperation().
- *
- * @see FileBackend::doQuickOperation()
- *
- * @param $params Array Operation parameters
- * @return Status
- * @since 1.20
- */
- final public function quickCopy( array $params ) {
- return $this->doQuickOperation( array( 'op' => 'copy' ) + $params );
- }
-
- /**
- * Performs a single quick move operation.
- * This sets $params['op'] to 'move' and passes it to doQuickOperation().
- *
- * @see FileBackend::doQuickOperation()
- *
- * @param $params Array Operation parameters
- * @return Status
- * @since 1.20
- */
- final public function quickMove( array $params ) {
- return $this->doQuickOperation( array( 'op' => 'move' ) + $params );
- }
-
- /**
- * Performs a single quick delete operation.
- * This sets $params['op'] to 'delete' and passes it to doQuickOperation().
- *
- * @see FileBackend::doQuickOperation()
- *
- * @param $params Array Operation parameters
- * @return Status
- * @since 1.20
- */
- final public function quickDelete( array $params ) {
- return $this->doQuickOperation( array( 'op' => 'delete' ) + $params );
- }
-
- /**
* Concatenate a list of storage files into a single file system file.
* The target path should refer to a file that is already locked or
* otherwise safe from modification from other processes. Normally,
diff --git a/includes/filerepo/backend/FileOp.php b/includes/filerepo/backend/FileOp.php
index ac2496dc5e5a..d9fbafd9b155 100644
--- a/includes/filerepo/backend/FileOp.php
+++ b/includes/filerepo/backend/FileOp.php
@@ -438,6 +438,7 @@ abstract class FileOp {
* overwriteSame : override any existing file at destination
*/
class StoreFileOp extends FileOp {
+
/**
* @return array
*/
@@ -578,6 +579,7 @@ class CreateFileOp extends FileOp {
* overwriteSame : override any existing file at destination
*/
class CopyFileOp extends FileOp {
+
/**
* @return array
*/
diff --git a/includes/filerepo/backend/SwiftFileBackend.php b/includes/filerepo/backend/SwiftFileBackend.php
index e27744f66865..36d4334e7f51 100644
--- a/includes/filerepo/backend/SwiftFileBackend.php
+++ b/includes/filerepo/backend/SwiftFileBackend.php
@@ -42,9 +42,6 @@ class SwiftFileBackend extends FileBackendStore {
protected $authTTL; // integer seconds
protected $swiftAnonUser; // string; username to handle unauthenticated requests
protected $swiftUseCDN; // boolean; whether CloudFiles CDN is enabled
- protected $swiftCDNExpiry; // integer; how long to cache things in the CDN
- protected $swiftCDNPurgable; // boolean; whether object CDN purging is enabled
-
protected $maxContCacheSize = 300; // integer; max containers with entries
/** @var CF_Connection */
@@ -62,11 +59,6 @@ class SwiftFileBackend extends FileBackendStore {
* swiftAuthTTL : Swift authentication TTL (seconds)
* swiftAnonUser : Swift user used for end-user requests (account:username)
* swiftUseCDN : Whether a Cloud Files Content Delivery Network is set up
- * swiftCDNExpiry : How long (in seconds) to store content in the CDN.
- * If files may likely change, this should probably not exceed
- * a few days. For example, deletions may take this long to apply.
- * If object purging is enabled, however, this is not an issue.
- * swiftCDNPurgable : Whether object purge requests are allowed by the CDN.
* shardViaHashLevels : Map of container names to sharding config with:
* 'base' : base of hash characters, 16 or 36
* 'levels' : the number of hash levels (and digits)
@@ -98,12 +90,6 @@ class SwiftFileBackend extends FileBackendStore {
$this->swiftUseCDN = isset( $config['swiftUseCDN'] )
? $config['swiftUseCDN']
: false;
- $this->swiftCDNExpiry = isset( $config['swiftCDNExpiry'] )
- ? $config['swiftCDNExpiry']
- : 3600; // hour
- $this->swiftCDNPurgable = isset( $config['swiftCDNPurgable'] )
- ? $config['swiftCDNPurgable']
- : true;
// Cache container info to mask latency
$this->memCache = wfGetMainCache();
}
@@ -533,7 +519,7 @@ class SwiftFileBackend extends FileBackendStore {
) );
}
if ( $this->swiftUseCDN ) { // Rackspace style CDN
- $contObj->make_public( $this->swiftCDNExpiry );
+ $contObj->make_public();
}
} catch ( CDNNotEnabledException $e ) {
// CDN not enabled; nothing to see here
@@ -1032,14 +1018,13 @@ class SwiftFileBackend extends FileBackendStore {
}
/**
- * Purge the CDN cache of affected objects if CDN caching is enabled.
- * This is for Rackspace/Akamai CDNs.
+ * Purge the CDN cache of affected objects if CDN caching is enabled
*
* @param $objects Array List of CF_Object items
* @return void
*/
public function purgeCDNCache( array $objects ) {
- if ( $this->swiftUseCDN && $this->swiftCDNPurgable ) {
+ if ( $this->swiftUseCDN ) { // Rackspace style CDN
foreach ( $objects as $object ) {
try {
$object->purge_from_cdn();
@@ -1129,7 +1114,7 @@ class SwiftFileBackend extends FileBackendStore {
*
* @param $container string Container name
* @return CF_Container
- * @throws CloudFilesException
+ * @throws InvalidResponseException
*/
protected function createContainer( $container ) {
$conn = $this->getConnection(); // Swift proxy connection
@@ -1143,12 +1128,12 @@ class SwiftFileBackend extends FileBackendStore {
*
* @param $container string Container name
* @return void
- * @throws CloudFilesException
+ * @throws InvalidResponseException
*/
protected function deleteContainer( $container ) {
$conn = $this->getConnection(); // Swift proxy connection
- unset( $this->connContainers[$container] ); // purge cache
$conn->delete_container( $container );
+ unset( $this->connContainers[$container] ); // purge cache
}
/**
diff --git a/includes/filerepo/backend/lockmanager/FSLockManager.php b/includes/filerepo/backend/lockmanager/FSLockManager.php
index 2b727a8fd3ea..4f3b9596ec18 100644
--- a/includes/filerepo/backend/lockmanager/FSLockManager.php
+++ b/includes/filerepo/backend/lockmanager/FSLockManager.php
@@ -239,15 +239,11 @@ class FSLockManager extends LockManager {
return "{$this->lockDir}/{$hash}.lock";
}
- /**
- * Make sure remaining locks get cleared for sanity
- */
function __destruct() {
- while ( count( $this->locksHeld ) ) {
- foreach ( $this->locksHeld as $path => $locks ) {
- $this->doSingleUnlock( $path, self::LOCK_EX );
- $this->doSingleUnlock( $path, self::LOCK_SH );
- }
+ // Make sure remaining locks get cleared for sanity
+ foreach ( $this->locksHeld as $path => $locks ) {
+ $this->doSingleUnlock( $path, self::LOCK_EX );
+ $this->doSingleUnlock( $path, self::LOCK_SH );
}
}
}