filebackend: Turn protected properties into actual constants
This is a direct follow up to Id0e4b0d from 2019 where these "constants" have been introduced. I believe the reason for using protected properties was that we still had to support PHP 7.0 back then, but class constants can only be marked as protected since PHP 7.1. According to codesearch these are apparently meant to be internal to the filebackend classes in core and not used anywhere else. Change-Id: I55683e3540f8d76324370efecb98d08e07547c28
This commit is contained in:
parent
31da51cec0
commit
5d9a3e6fb5
4 changed files with 66 additions and 66 deletions
|
|
@ -585,7 +585,7 @@ class FSFileBackend extends FileBackendStore {
|
|||
protected function doGetFileStat( array $params ) {
|
||||
$fsSrcPath = $this->resolveToFSPath( $params['src'] );
|
||||
if ( $fsSrcPath === null ) {
|
||||
return self::$RES_ERROR; // invalid storage path
|
||||
return self::RES_ERROR; // invalid storage path
|
||||
}
|
||||
|
||||
$this->trapWarnings(); // don't trust 'false' if there were errors
|
||||
|
|
@ -601,7 +601,7 @@ class FSFileBackend extends FileBackendStore {
|
|||
];
|
||||
}
|
||||
|
||||
return $hadError ? self::$RES_ERROR : self::$RES_ABSENT;
|
||||
return $hadError ? self::RES_ERROR : self::RES_ABSENT;
|
||||
}
|
||||
|
||||
protected function doClearCache( array $paths = null ) {
|
||||
|
|
@ -628,7 +628,7 @@ class FSFileBackend extends FileBackendStore {
|
|||
$exists = is_dir( $fsDirectory );
|
||||
$hadError = $this->untrapWarnings();
|
||||
|
||||
return $hadError ? self::$RES_ERROR : $exists;
|
||||
return $hadError ? self::RES_ERROR : $exists;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -653,11 +653,11 @@ class FSFileBackend extends FileBackendStore {
|
|||
} elseif ( is_dir( $fsDirectory ) ) {
|
||||
$this->logger->warning( __METHOD__ . ": unreadable directory: '$fsDirectory'" );
|
||||
|
||||
return self::$RES_ERROR; // bad permissions?
|
||||
return self::RES_ERROR; // bad permissions?
|
||||
} else {
|
||||
$this->logger->warning( __METHOD__ . ": unreachable directory: '$fsDirectory'" );
|
||||
|
||||
return self::$RES_ERROR;
|
||||
return self::RES_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -687,12 +687,12 @@ class FSFileBackend extends FileBackendStore {
|
|||
$this->logger->warning( __METHOD__ .
|
||||
": unreadable directory: '$fsDirectory': $error" );
|
||||
|
||||
return self::$RES_ERROR; // bad permissions?
|
||||
return self::RES_ERROR; // bad permissions?
|
||||
} else {
|
||||
$this->logger->warning( __METHOD__ .
|
||||
": unreachable directory: '$fsDirectory': $error" );
|
||||
|
||||
return self::$RES_ERROR;
|
||||
return self::RES_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -705,7 +705,7 @@ class FSFileBackend extends FileBackendStore {
|
|||
foreach ( $params['srcs'] as $src ) {
|
||||
$source = $this->resolveToFSPath( $src );
|
||||
if ( $source === null ) {
|
||||
$fsFiles[$src] = self::$RES_ERROR; // invalid path
|
||||
$fsFiles[$src] = self::RES_ERROR; // invalid path
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -716,9 +716,9 @@ class FSFileBackend extends FileBackendStore {
|
|||
if ( $isFile ) {
|
||||
$fsFiles[$src] = new FSFile( $source );
|
||||
} elseif ( $hadError ) {
|
||||
$fsFiles[$src] = self::$RES_ERROR;
|
||||
$fsFiles[$src] = self::RES_ERROR;
|
||||
} else {
|
||||
$fsFiles[$src] = self::$RES_ABSENT;
|
||||
$fsFiles[$src] = self::RES_ABSENT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -731,14 +731,14 @@ class FSFileBackend extends FileBackendStore {
|
|||
foreach ( $params['srcs'] as $src ) {
|
||||
$source = $this->resolveToFSPath( $src );
|
||||
if ( $source === null ) {
|
||||
$tmpFiles[$src] = self::$RES_ERROR; // invalid path
|
||||
$tmpFiles[$src] = self::RES_ERROR; // invalid path
|
||||
continue;
|
||||
}
|
||||
// Create a new temporary file with the same extension...
|
||||
$ext = FileBackend::extensionFromPath( $src );
|
||||
$tmpFile = $this->tmpFileFactory->newTempFSFile( 'localcopy_', $ext );
|
||||
if ( !$tmpFile ) {
|
||||
$tmpFiles[$src] = self::$RES_ERROR;
|
||||
$tmpFiles[$src] = self::RES_ERROR;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -753,9 +753,9 @@ class FSFileBackend extends FileBackendStore {
|
|||
$this->chmod( $tmpPath );
|
||||
$tmpFiles[$src] = $tmpFile;
|
||||
} elseif ( $hadError ) {
|
||||
$tmpFiles[$src] = self::$RES_ERROR; // copy failed
|
||||
$tmpFiles[$src] = self::RES_ERROR; // copy failed
|
||||
} else {
|
||||
$tmpFiles[$src] = self::$RES_ABSENT;
|
||||
$tmpFiles[$src] = self::RES_ABSENT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,14 +61,14 @@ abstract class FileBackendStore extends FileBackend {
|
|||
protected const CACHE_EXPENSIVE_SIZE = 5; // integer; max entries in "expensive cache"
|
||||
|
||||
/** @var false Idiom for "no result due to missing file" (since 1.34) */
|
||||
protected static $RES_ABSENT = false;
|
||||
protected const RES_ABSENT = false;
|
||||
/** @var null Idiom for "no result due to I/O errors" (since 1.34) */
|
||||
protected static $RES_ERROR = null;
|
||||
protected const RES_ERROR = null;
|
||||
|
||||
/** @var string File does not exist according to a normal stat query */
|
||||
protected static $ABSENT_NORMAL = 'FNE-N';
|
||||
protected const ABSENT_NORMAL = 'FNE-N';
|
||||
/** @var string File does not exist according to a "latest"-mode stat query */
|
||||
protected static $ABSENT_LATEST = 'FNE-L';
|
||||
protected const ABSENT_LATEST = 'FNE-L';
|
||||
|
||||
/**
|
||||
* @see FileBackend::__construct()
|
||||
|
|
@ -425,7 +425,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
$fsFile = $this->getLocalReference( [ 'src' => $path ] );
|
||||
if ( !$fsFile ) { // retry failed?
|
||||
$status->fatal(
|
||||
$fsFile === self::$RES_ERROR ? 'backend-fail-read' : 'backend-fail-notexists',
|
||||
$fsFile === self::RES_ERROR ? 'backend-fail-read' : 'backend-fail-notexists',
|
||||
$path
|
||||
);
|
||||
|
||||
|
|
@ -656,7 +656,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
return true;
|
||||
}
|
||||
|
||||
return ( $stat === self::$RES_ABSENT ) ? false : self::EXISTENCE_ERROR;
|
||||
return $stat === self::RES_ABSENT ? false : self::EXISTENCE_ERROR;
|
||||
}
|
||||
|
||||
final public function getFileTimestamp( array $params ) {
|
||||
|
|
@ -722,9 +722,9 @@ abstract class FileBackendStore extends FileBackend {
|
|||
) {
|
||||
return $stat;
|
||||
}
|
||||
} elseif ( $stat === self::$ABSENT_LATEST ) {
|
||||
} elseif ( $stat === self::ABSENT_LATEST ) {
|
||||
return self::STAT_ABSENT;
|
||||
} elseif ( $stat === self::$ABSENT_NORMAL ) {
|
||||
} elseif ( $stat === self::ABSENT_NORMAL ) {
|
||||
if ( !$latest ) {
|
||||
return self::STAT_ABSENT;
|
||||
}
|
||||
|
|
@ -738,7 +738,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
return $stat;
|
||||
}
|
||||
|
||||
return ( $stat === self::$RES_ERROR ) ? self::STAT_ERROR : self::STAT_ABSENT;
|
||||
return $stat === self::RES_ERROR ? self::STAT_ERROR : self::STAT_ABSENT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -776,11 +776,11 @@ abstract class FileBackendStore extends FileBackend {
|
|||
}
|
||||
// Update persistent cache (@TODO: set all entries in one batch)
|
||||
$this->setFileCache( $path, $stat );
|
||||
} elseif ( $stat === self::$RES_ABSENT ) {
|
||||
} elseif ( $stat === self::RES_ABSENT ) {
|
||||
$this->cheapCache->setField(
|
||||
$path,
|
||||
'stat',
|
||||
$latest ? self::$ABSENT_LATEST : self::$ABSENT_NORMAL
|
||||
$latest ? self::ABSENT_LATEST : self::ABSENT_NORMAL
|
||||
);
|
||||
$this->cheapCache->setField(
|
||||
$path,
|
||||
|
|
@ -842,9 +842,9 @@ abstract class FileBackendStore extends FileBackend {
|
|||
AtEase::suppressWarnings();
|
||||
$content = file_get_contents( $fsFile->getPath() );
|
||||
AtEase::restoreWarnings();
|
||||
$contents[$path] = is_string( $content ) ? $content : self::$RES_ERROR;
|
||||
$contents[$path] = is_string( $content ) ? $content : self::RES_ERROR;
|
||||
} else {
|
||||
// self::$RES_ERROR or self::$RES_ABSENT
|
||||
// self::RES_ERROR or self::RES_ABSENT
|
||||
$contents[$path] = $fsFile;
|
||||
}
|
||||
}
|
||||
|
|
@ -877,7 +877,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
'xattr',
|
||||
[ 'map' => $fields, 'latest' => $latest ]
|
||||
);
|
||||
} elseif ( $fields === self::$RES_ABSENT ) {
|
||||
} elseif ( $fields === self::RES_ABSENT ) {
|
||||
$this->cheapCache->setField(
|
||||
$path,
|
||||
'xattr',
|
||||
|
|
@ -924,7 +924,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
'sha1',
|
||||
[ 'hash' => $sha1, 'latest' => $latest ]
|
||||
);
|
||||
} elseif ( $sha1 === self::$RES_ABSENT ) {
|
||||
} elseif ( $sha1 === self::RES_ABSENT ) {
|
||||
$this->cheapCache->setField(
|
||||
$path,
|
||||
'sha1',
|
||||
|
|
@ -948,10 +948,10 @@ abstract class FileBackendStore extends FileBackend {
|
|||
if ( $fsFile instanceof FSFile ) {
|
||||
$sha1 = $fsFile->getSha1Base36();
|
||||
|
||||
return is_string( $sha1 ) ? $sha1 : self::$RES_ERROR;
|
||||
return is_string( $sha1 ) ? $sha1 : self::RES_ERROR;
|
||||
}
|
||||
|
||||
return ( $fsFile === self::$RES_ERROR ) ? self::$RES_ERROR : self::$RES_ABSENT;
|
||||
return $fsFile === self::RES_ERROR ? self::RES_ERROR : self::RES_ABSENT;
|
||||
}
|
||||
|
||||
final public function getFileProps( array $params ) {
|
||||
|
|
@ -975,7 +975,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
foreach ( $params['srcs'] as $src ) {
|
||||
$path = self::normalizeStoragePath( $src );
|
||||
if ( $path === null ) {
|
||||
$fsFiles[$src] = self::$RES_ERROR; // invalid storage path
|
||||
$fsFiles[$src] = self::RES_ERROR; // invalid storage path
|
||||
} elseif ( $this->expensiveCache->hasField( $path, 'localRef' ) ) {
|
||||
$val = $this->expensiveCache->getField( $path, 'localRef' );
|
||||
// If we want the latest data, check that this cached
|
||||
|
|
@ -996,7 +996,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
[ 'object' => $fsFile, 'latest' => $latest ]
|
||||
);
|
||||
} else {
|
||||
// self::$RES_ERROR or self::$RES_ABSENT
|
||||
// self::RES_ERROR or self::RES_ABSENT
|
||||
$fsFiles[$path] = $fsFile;
|
||||
}
|
||||
}
|
||||
|
|
@ -1112,7 +1112,7 @@ abstract class FileBackendStore extends FileBackend {
|
|||
if ( $exists === true ) {
|
||||
$res = true;
|
||||
break; // found one!
|
||||
} elseif ( $exists === self::$RES_ERROR ) {
|
||||
} elseif ( $exists === self::RES_ERROR ) {
|
||||
$res = self::EXISTENCE_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ class MemoryFileBackend extends FileBackendStore {
|
|||
protected function doGetFileStat( array $params ) {
|
||||
$src = $this->resolveHashKey( $params['src'] );
|
||||
if ( $src === null ) {
|
||||
return self::$RES_ERROR; // invalid path
|
||||
return self::RES_ERROR; // invalid path
|
||||
}
|
||||
|
||||
if ( isset( $this->files[$src] ) ) {
|
||||
|
|
@ -159,7 +159,7 @@ class MemoryFileBackend extends FileBackendStore {
|
|||
];
|
||||
}
|
||||
|
||||
return self::$RES_ABSENT;
|
||||
return self::RES_ABSENT;
|
||||
}
|
||||
|
||||
protected function doGetLocalCopyMulti( array $params ) {
|
||||
|
|
@ -167,9 +167,9 @@ class MemoryFileBackend extends FileBackendStore {
|
|||
foreach ( $params['srcs'] as $srcPath ) {
|
||||
$src = $this->resolveHashKey( $srcPath );
|
||||
if ( $src === null ) {
|
||||
$fsFile = self::$RES_ERROR;
|
||||
$fsFile = self::RES_ERROR;
|
||||
} elseif ( !isset( $this->files[$src] ) ) {
|
||||
$fsFile = self::$RES_ABSENT;
|
||||
$fsFile = self::RES_ABSENT;
|
||||
} else {
|
||||
// Create a new temporary file with the same extension...
|
||||
$ext = FileBackend::extensionFromPath( $src );
|
||||
|
|
@ -177,7 +177,7 @@ class MemoryFileBackend extends FileBackendStore {
|
|||
if ( $fsFile ) {
|
||||
$bytes = file_put_contents( $fsFile->getPath(), $this->files[$src]['data'] );
|
||||
if ( $bytes !== strlen( $this->files[$src]['data'] ) ) {
|
||||
$fsFile = self::$RES_ERROR;
|
||||
$fsFile = self::RES_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -648,7 +648,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$stat = $this->getContainerStat( $fullCont );
|
||||
if ( is_array( $stat ) ) {
|
||||
return $status; // already there
|
||||
} elseif ( $stat === self::$RES_ERROR ) {
|
||||
} elseif ( $stat === self::RES_ERROR ) {
|
||||
$status->fatal( 'backend-fail-internal', $this->name );
|
||||
$this->logger->error( __METHOD__ . ': cannot get container stat' );
|
||||
} else {
|
||||
|
|
@ -676,7 +676,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$readUsers,
|
||||
$writeUsers
|
||||
) );
|
||||
} elseif ( $stat === self::$RES_ABSENT ) {
|
||||
} elseif ( $stat === self::RES_ABSENT ) {
|
||||
$status->fatal( 'backend-fail-usable', $params['dir'] );
|
||||
} else {
|
||||
$status->fatal( 'backend-fail-internal', $this->name );
|
||||
|
|
@ -700,7 +700,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$readUsers,
|
||||
$writeUsers
|
||||
) );
|
||||
} elseif ( $stat === self::$RES_ABSENT ) {
|
||||
} elseif ( $stat === self::RES_ABSENT ) {
|
||||
$status->fatal( 'backend-fail-usable', $params['dir'] );
|
||||
} else {
|
||||
$status->fatal( 'backend-fail-internal', $this->name );
|
||||
|
|
@ -720,9 +720,9 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
|
||||
// (a) Check the container
|
||||
$stat = $this->getContainerStat( $fullCont, true );
|
||||
if ( $stat === self::$RES_ABSENT ) {
|
||||
if ( $stat === self::RES_ABSENT ) {
|
||||
return $status; // ok, nothing to do
|
||||
} elseif ( $stat === self::$RES_ERROR ) {
|
||||
} elseif ( $stat === self::RES_ERROR ) {
|
||||
$status->fatal( 'backend-fail-internal', $this->name );
|
||||
$this->logger->error( __METHOD__ . ': cannot get container stat' );
|
||||
} elseif ( is_array( $stat ) && $stat['count'] == 0 ) {
|
||||
|
|
@ -834,7 +834,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$reqs = []; // (path => op)
|
||||
|
||||
// Initial dummy values to preserve path order
|
||||
$contents = array_fill_keys( $params['srcs'], self::$RES_ERROR );
|
||||
$contents = array_fill_keys( $params['srcs'], self::RES_ERROR );
|
||||
foreach ( $params['srcs'] as $path ) { // each path in this concurrent batch
|
||||
[ $srcCont, $srcRel ] = $this->resolveStoragePathReal( $path );
|
||||
if ( $srcRel === null || !$auth ) {
|
||||
|
|
@ -867,15 +867,15 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
if ( $size === (int)$rhdrs['content-length'] ) {
|
||||
$contents[$path] = $content;
|
||||
} else {
|
||||
$contents[$path] = self::$RES_ERROR;
|
||||
$contents[$path] = self::RES_ERROR;
|
||||
$rerr = "Got {$size}/{$rhdrs['content-length']} bytes";
|
||||
$this->onError( null, __METHOD__,
|
||||
[ 'src' => $path ] + $ep, $rerr, $rcode, $rdesc );
|
||||
}
|
||||
} elseif ( $rcode === 404 ) {
|
||||
$contents[$path] = self::$RES_ABSENT;
|
||||
$contents[$path] = self::RES_ABSENT;
|
||||
} else {
|
||||
$contents[$path] = self::$RES_ERROR;
|
||||
$contents[$path] = self::RES_ERROR;
|
||||
$this->onError( null, __METHOD__,
|
||||
[ 'src' => $path ] + $ep, $rerr, $rcode, $rdesc, $rbody );
|
||||
}
|
||||
|
|
@ -892,7 +892,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
return ( count( $status->value ) ) > 0;
|
||||
}
|
||||
|
||||
return self::$RES_ERROR;
|
||||
return self::RES_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1112,7 +1112,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
return $stat['xattr'];
|
||||
}
|
||||
|
||||
return ( $stat === self::$RES_ERROR ) ? self::$RES_ERROR : self::$RES_ABSENT;
|
||||
return $stat === self::RES_ERROR ? self::RES_ERROR : self::RES_ABSENT;
|
||||
}
|
||||
|
||||
protected function doGetFileSha1base36( array $params ) {
|
||||
|
|
@ -1125,7 +1125,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
return $stat['sha1'];
|
||||
}
|
||||
|
||||
return ( $stat === self::$RES_ERROR ) ? self::$RES_ERROR : self::$RES_ABSENT;
|
||||
return $stat === self::RES_ERROR ? self::RES_ERROR : self::RES_ABSENT;
|
||||
}
|
||||
|
||||
protected function doStreamFile( array $params ) {
|
||||
|
|
@ -1203,7 +1203,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$reqs = []; // (path => op)
|
||||
|
||||
// Initial dummy values to preserve path order
|
||||
$tmpFiles = array_fill_keys( $params['srcs'], self::$RES_ERROR );
|
||||
$tmpFiles = array_fill_keys( $params['srcs'], self::RES_ERROR );
|
||||
foreach ( $params['srcs'] as $path ) { // each path in this concurrent batch
|
||||
[ $srcCont, $srcRel ] = $this->resolveStoragePathReal( $path );
|
||||
if ( $srcRel === null || !$auth ) {
|
||||
|
|
@ -1242,7 +1242,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
// Make sure that the stream finished and fully wrote to disk
|
||||
$size = $tmpFile->getSize();
|
||||
if ( $size !== (int)$rhdrs['content-length'] ) {
|
||||
$tmpFiles[$path] = self::$RES_ERROR;
|
||||
$tmpFiles[$path] = self::RES_ERROR;
|
||||
$rerr = "Got {$size}/{$rhdrs['content-length']} bytes";
|
||||
$this->onError( null, __METHOD__,
|
||||
[ 'src' => $path ] + $ep, $rerr, $rcode, $rdesc );
|
||||
|
|
@ -1252,14 +1252,14 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$stat['latest'] = $latest;
|
||||
$this->cheapCache->setField( $path, 'stat', $stat );
|
||||
} elseif ( $rcode === 404 ) {
|
||||
$tmpFiles[$path] = self::$RES_ABSENT;
|
||||
$tmpFiles[$path] = self::RES_ABSENT;
|
||||
$this->cheapCache->setField(
|
||||
$path,
|
||||
'stat',
|
||||
$latest ? self::$ABSENT_LATEST : self::$ABSENT_NORMAL
|
||||
$latest ? self::ABSENT_LATEST : self::ABSENT_NORMAL
|
||||
);
|
||||
} else {
|
||||
$tmpFiles[$path] = self::$RES_ERROR;
|
||||
$tmpFiles[$path] = self::RES_ERROR;
|
||||
$this->onError( null, __METHOD__,
|
||||
[ 'src' => $path ] + $ep, $rerr, $rcode, $rdesc, $rbody );
|
||||
}
|
||||
|
|
@ -1471,7 +1471,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
if ( !$this->containerStatCache->hasField( $container, 'stat' ) ) {
|
||||
$auth = $this->getAuthentication();
|
||||
if ( !$auth ) {
|
||||
return self::$RES_ERROR;
|
||||
return self::RES_ERROR;
|
||||
}
|
||||
|
||||
[ $rcode, $rdesc, $rhdrs, $rbody, $rerr ] = $this->http->run( [
|
||||
|
|
@ -1492,12 +1492,12 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$this->setContainerCache( $container, $stat ); // update persistent cache
|
||||
}
|
||||
} elseif ( $rcode === 404 ) {
|
||||
return self::$RES_ABSENT;
|
||||
return self::RES_ABSENT;
|
||||
} else {
|
||||
$this->onError( null, __METHOD__,
|
||||
[ 'cont' => $container ], $rerr, $rcode, $rdesc, $rbody );
|
||||
|
||||
return self::$RES_ERROR;
|
||||
return self::RES_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1667,16 +1667,16 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
foreach ( $params['srcs'] as $path ) {
|
||||
[ $srcCont, $srcRel ] = $this->resolveStoragePathReal( $path );
|
||||
if ( $srcRel === null || !$auth ) {
|
||||
$stats[$path] = self::$RES_ERROR;
|
||||
$stats[$path] = self::RES_ERROR;
|
||||
continue; // invalid storage path or auth error
|
||||
}
|
||||
|
||||
$cstat = $this->getContainerStat( $srcCont );
|
||||
if ( $cstat === self::$RES_ABSENT ) {
|
||||
$stats[$path] = self::$RES_ABSENT;
|
||||
if ( $cstat === self::RES_ABSENT ) {
|
||||
$stats[$path] = self::RES_ABSENT;
|
||||
continue; // ok, nothing to do
|
||||
} elseif ( $cstat === self::$RES_ERROR ) {
|
||||
$stats[$path] = self::$RES_ERROR;
|
||||
} elseif ( $cstat === self::RES_ERROR ) {
|
||||
$stats[$path] = self::RES_ERROR;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1705,9 +1705,9 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$stat['latest'] = true; // strong consistency
|
||||
}
|
||||
} elseif ( $rcode === 404 ) {
|
||||
$stat = self::$RES_ABSENT;
|
||||
$stat = self::RES_ABSENT;
|
||||
} else {
|
||||
$stat = self::$RES_ERROR;
|
||||
$stat = self::RES_ERROR;
|
||||
$this->onError( null, __METHOD__, $params, $rerr, $rcode, $rdesc, $rbody );
|
||||
}
|
||||
$stats[$path] = $stat;
|
||||
|
|
|
|||
Loading…
Reference in a new issue