: IP::sanitizeRange( "$ip/16" );
# Bail out if a request already came from this range...
- $key = wfMemcKey( get_class( $this ), 'attempt', $this->mType, $this->mKey, $ip );
+ $key = wfMemcKey( static::class, 'attempt', $this->mType, $this->mKey, $ip );
if ( $cache->get( $key ) ) {
return; // possibly the same user
}
* @return string
*/
protected function cacheMissKey() {
- return wfMemcKey( get_class( $this ), 'misses', $this->mType, $this->mKey );
+ return wfMemcKey( static::class, 'misses', $this->mType, $this->mKey );
}
}
}
}
- wfDebugLog( 'caches', get_class( $this ) . ": using store $storeClass" );
+ wfDebugLog( 'caches', static::class . ": using store $storeClass" );
if ( !empty( $conf['storeDirectory'] ) ) {
$storeConf['directory'] = $conf['storeDirectory'];
}
// Do a consistency check to see if the backends are consistent...
$syncStatus = $this->consistencyCheck( $relevantPaths );
if ( !$syncStatus->isOK() ) {
- wfDebugLog( 'FileOperation', get_class( $this ) .
+ wfDebugLog( 'FileOperation', static::class .
" failed sync check: " . FormatJson::encode( $relevantPaths ) );
// Try to resync the clone backends to the master on the spot...
if ( $this->autoResync === false
}
if ( !$status->isOK() ) {
- wfDebugLog( 'FileOperation', get_class( $this ) .
+ wfDebugLog( 'FileOperation', static::class .
" failed to resync: " . FormatJson::encode( $paths ) );
}
$status->merge( $this->doConcatenate( $params ) );
$sec = microtime( true ) - $start_time;
if ( !$status->isOK() ) {
- $this->logger->error( get_class( $this ) . "-{$this->name}" .
+ $this->logger->error( static::class . "-{$this->name}" .
" failed to concatenate " . count( $params['srcs'] ) . " file(s) [$sec sec]" );
}
}
$subStatus->success[$i] = false;
++$subStatus->failCount;
}
- $this->logger->error( get_class( $this ) . "-{$this->name} " .
+ $this->logger->error( static::class . "-{$this->name} " .
" stat failure; aborted operations: " . FormatJson::encode( $ops ) );
}
$params = $this->params;
$params['failedAction'] = $action;
try {
- $this->logger->error( get_class( $this ) .
+ $this->logger->error( static::class .
" failed (batch #{$this->batchId}): " . FormatJson::encode( $params ) );
} catch ( Exception $e ) {
// bad config? debug log error?
protected function debug( $text ) {
if ( $this->debugMode ) {
$this->logger->debug( "{class} debug: $text", [
- 'class' => get_class( $this ),
+ 'class' => static::class,
] );
}
}
*/
public function __clone() {
$this->connLogger->warning(
- "Cloning " . get_class( $this ) . " is not recomended; forking connection:\n" .
+ "Cloning " . static::class . " is not recomended; forking connection:\n" .
( new RuntimeException() )->getTraceAsString()
);
*/
private function getDB() {
if ( !$this->db ) {
- throw new RuntimeException( get_class( $this ) . ' needs a DB handle for iteration.' );
+ throw new RuntimeException( static::class . ' needs a DB handle for iteration.' );
}
return $this->db;
* @return string The name of the service behind this VRS object.
*/
public function getName() {
- return isset( $this->params['name'] ) ? $this->params['name'] :
- get_class( $this );
+ return isset( $this->params['name'] ) ? $this->params['name'] : static::class;
}
/**