diff options
author | umherirrender <umherirrender_de.wp@web.de> | 2013-04-13 13:36:24 +0200 |
---|---|---|
committer | umherirrender <umherirrender_de.wp@web.de> | 2013-04-13 13:36:24 +0200 |
commit | 15abcf71ca7ec185b475e47ef0fe43884e764239 (patch) | |
tree | 7791eaf66b73bffa30de7b66b429fc045cbb0a55 /includes/filebackend | |
parent | d48005a696838e11ae8e6f2696f72c55c995224f (diff) | |
download | mediawikicore-15abcf71ca7ec185b475e47ef0fe43884e764239.tar.gz mediawikicore-15abcf71ca7ec185b475e47ef0fe43884e764239.zip |
Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
Diffstat (limited to 'includes/filebackend')
-rw-r--r-- | includes/filebackend/FileBackendStore.php | 4 | ||||
-rw-r--r-- | includes/filebackend/SwiftFileBackend.php | 6 | ||||
-rw-r--r-- | includes/filebackend/lockmanager/LockManager.php | 4 | ||||
-rw-r--r-- | includes/filebackend/lockmanager/MemcLockManager.php | 4 | ||||
-rw-r--r-- | includes/filebackend/lockmanager/QuorumLockManager.php | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index 18a59fa42082..5a91f9e8f557 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -1578,7 +1578,7 @@ abstract class FileBackendStore extends FileBackend { * @param $val mixed Information to cache */ final protected function setContainerCache( $container, $val ) { - $this->memCache->add( $this->containerCacheKey( $container ), $val, 14*86400 ); + $this->memCache->add( $this->containerCacheKey( $container ), $val, 14 * 86400 ); } /** @@ -1673,7 +1673,7 @@ abstract class FileBackendStore extends FileBackend { if ( $path === null ) { return; // invalid storage path } - $this->memCache->add( $this->fileCacheKey( $path ), $val, 7*86400 ); + $this->memCache->add( $this->fileCacheKey( $path ), $val, 7 * 86400 ); } /** diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 2f7e256710a0..00c0ff825cc8 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -132,7 +132,7 @@ class SwiftFileBackend extends FileBackendStore { : false; $this->swiftCDNExpiry = isset( $config['swiftCDNExpiry'] ) ? $config['swiftCDNExpiry'] - : 12*3600; // 12 hours is safe (tokens last 24 hours per http://docs.openstack.org) + : 12 * 3600; // 12 hours is safe (tokens last 24 hours per http://docs.openstack.org) $this->swiftCDNPurgable = isset( $config['swiftCDNPurgable'] ) ? $config['swiftCDNPurgable'] : true; @@ -1397,12 +1397,12 @@ class SwiftFileBackend extends FileBackendStore { if ( is_array( $creds ) ) { // cache hit $this->auth->load_cached_credentials( $creds['auth_token'], $creds['storage_url'], $creds['cdnm_url'] ); - $this->sessionStarted = time() - ceil( $this->authTTL/2 ); // skew for worst case + $this->sessionStarted = time() - ceil( $this->authTTL / 2 ); // skew for worst case } else { // cache miss try { $this->auth->authenticate(); $creds = $this->auth->export_credentials(); - $this->srvCache->add( $cacheKey, $creds, ceil( $this->authTTL/2 ) ); // cache + $this->srvCache->add( $cacheKey, $creds, ceil( $this->authTTL / 2 ) ); // cache $this->sessionStarted = time(); } catch ( CloudFilesException $e ) { $this->connException = $e; // don't keep re-trying diff --git a/includes/filebackend/lockmanager/LockManager.php b/includes/filebackend/lockmanager/LockManager.php index f534eff38bb4..9b7a7ff6c7d2 100644 --- a/includes/filebackend/lockmanager/LockManager.php +++ b/includes/filebackend/lockmanager/LockManager.php @@ -76,10 +76,10 @@ abstract class LockManager { if ( isset( $config['lockTTL'] ) ) { $this->lockTTL = max( 1, $config['lockTTL'] ); } elseif ( PHP_SAPI === 'cli' ) { - $this->lockTTL = 2*3600; + $this->lockTTL = 2 * 3600; } else { $met = ini_get( 'max_execution_time' ); // this is 0 in CLI mode - $this->lockTTL = max( 5*60, 2*(int)$met ); + $this->lockTTL = max( 5 * 60, 2 * (int)$met ); } } diff --git a/includes/filebackend/lockmanager/MemcLockManager.php b/includes/filebackend/lockmanager/MemcLockManager.php index fafc588a9eb6..757aeee1fab7 100644 --- a/includes/filebackend/lockmanager/MemcLockManager.php +++ b/includes/filebackend/lockmanager/MemcLockManager.php @@ -145,7 +145,7 @@ class MemcLockManager extends QuorumLockManager { foreach ( $paths as $path ) { $locksKey = $this->recordKeyForPath( $path ); $locksHeld = $lockRecords[$locksKey]; - $ok = $memc->set( $locksKey, $locksHeld, 7*86400 ); + $ok = $memc->set( $locksKey, $locksHeld, 7 * 86400 ); if ( !$ok ) { $status->fatal( 'lockmanager-fail-acquirelock', $path ); } else { @@ -297,7 +297,7 @@ class MemcLockManager extends QuorumLockManager { $start = microtime( true ); do { if ( ( ++$rounds % 4 ) == 0 ) { - usleep( 1000*50 ); // 50 ms + usleep( 1000 * 50 ); // 50 ms } foreach ( array_diff( $keys, $lockedKeys ) as $key ) { if ( $memc->add( "$key:mutex", 1, 180 ) ) { // lock record diff --git a/includes/filebackend/lockmanager/QuorumLockManager.php b/includes/filebackend/lockmanager/QuorumLockManager.php index b331b540fc52..3b96ad690608 100644 --- a/includes/filebackend/lockmanager/QuorumLockManager.php +++ b/includes/filebackend/lockmanager/QuorumLockManager.php @@ -125,7 +125,7 @@ abstract class QuorumLockManager extends LockManager { $yesVotes = 0; // locks made on trustable servers $votesLeft = count( $this->srvsByBucket[$bucket] ); // remaining peers - $quorum = floor( $votesLeft/2 + 1 ); // simple majority + $quorum = floor( $votesLeft / 2 + 1 ); // simple majority // Get votes for each peer, in order, until we have enough... foreach ( $this->srvsByBucket[$bucket] as $lockSrv ) { if ( !$this->isServerUp( $lockSrv ) ) { |