// Optional settings
$this->authTTL = isset( $config['swiftAuthTTL'] )
? $config['swiftAuthTTL']
- : 5 * 60; // some sane number
+ : 15 * 60; // some sane number
$this->swiftTempUrlKey = isset( $config['swiftTempUrlKey'] )
? $config['swiftTempUrlKey']
: '';
return $status; // already there
} elseif ( $stat === null ) {
$status->fatal( 'backend-fail-internal', $this->name );
+ wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
return $status;
}
$status->fatal( 'backend-fail-usable', $params['dir'] );
} else {
$status->fatal( 'backend-fail-internal', $this->name );
+ wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
}
return $status;
$status->fatal( 'backend-fail-usable', $params['dir'] );
} else {
$status->fatal( 'backend-fail-internal', $this->name );
+ wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
}
return $status;
return $status; // ok, nothing to do
} elseif ( !is_array( $stat ) ) {
$status->fatal( 'backend-fail-internal', $this->name );
+ wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' );
return $status;
}
$timestamp = new MWTimestamp( $ts );
return $timestamp->getTimestamp( $format );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
throw new FileBackendError( $e->getMessage() );
}
}
return $objHdrs; // nothing to do
}
- $section = new ProfileSection( __METHOD__ . '-' . $this->name );
+ $ps = Profiler::instance()->scopedProfileIn( __METHOD__ . "-{$this->name}" );
trigger_error( "$path was not stored with SHA-1 metadata.", E_USER_WARNING );
$auth = $this->getAuthentication();
return $dirs; // nothing more
}
- $section = new ProfileSection( __METHOD__ . '-' . $this->name );
+ $ps = Profiler::instance()->scopedProfileIn( __METHOD__ . "-{$this->name}" );
$prefix = ( $dir == '' ) ? null : "{$dir}/";
// Non-recursive: only list dirs right under $dir
return $files; // nothing more
}
- $section = new ProfileSection( __METHOD__ . '-' . $this->name );
+ $ps = Profiler::instance()->scopedProfileIn( __METHOD__ . "-{$this->name}" );
$prefix = ( $dir == '' ) ? null : "{$dir}/";
// $objects will contain a list of unfiltered names or CF_Object items
if ( $rcode != 204 && $rcode !== 202 ) {
$status->fatal( 'backend-fail-internal', $this->name );
+ wfDebugLog( 'SwiftBackend', __METHOD__ . ': unexpected rcode value (' . $rcode . ')' );
}
return $status;
* @return array|bool|null False on 404, null on failure
*/
protected function getContainerStat( $container, $bypassCache = false ) {
- $section = new ProfileSection( __METHOD__ . '-' . $this->name );
+ $ps = Profiler::instance()->scopedProfileIn( __METHOD__ . "-{$this->name}" );
if ( $bypassCache ) { // purge cache
$this->containerStatCache->clear( $container );
return null;
}
- wfProfileIn( __METHOD__ . "-{$this->name}-miss" );
list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
'method' => 'HEAD',
'url' => $this->storageUrl( $auth, $container ),
'headers' => $this->authTokenHeaders( $auth )
) );
- wfProfileOut( __METHOD__ . "-{$this->name}-miss" );
if ( $rcode === 204 ) {
$stat = array(