aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/filebackend/FileBackend.php
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2023-04-28 23:08:03 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2023-04-29 01:01:07 +0200
commit03e3868a4393c92bc2b060768d7477d44a1f7e0a (patch)
tree85f25b8dd4edaf23b25dc92d22758626556bba4e /includes/libs/filebackend/FileBackend.php
parentddc1cfc94e6a963d16557faddb4b25422abc1ae7 (diff)
downloadmediawikicore-03e3868a4393c92bc2b060768d7477d44a1f7e0a.tar.gz
mediawikicore-03e3868a4393c92bc2b060768d7477d44a1f7e0a.zip
filebackend: Split missing file and error on getLocalReference/Copy
FileBackend::getLocalReference and FileBackend::getLocalCopy should report failure and missing with different values to make error reporting for the caller easier (FileBackendStore::doConcatenate in this case). The existing subclass implementation for FileBackendStore::doGetLocalCopyMulti already doing that. Change-Id: Ie29aed48dc33bcd9fe1ed1e91685596044dfd988
Diffstat (limited to 'includes/libs/filebackend/FileBackend.php')
-rw-r--r--includes/libs/filebackend/FileBackend.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/libs/filebackend/FileBackend.php b/includes/libs/filebackend/FileBackend.php
index fbf1837838ec..2dea18bd88a8 100644
--- a/includes/libs/filebackend/FileBackend.php
+++ b/includes/libs/filebackend/FileBackend.php
@@ -1147,7 +1147,7 @@ abstract class FileBackend implements LoggerAwareInterface {
* @param array $params Parameters include:
* - src : source storage path
* - latest : use the latest available data
- * @return FSFile|null Local file copy or null (missing file or I/O error)
+ * @return FSFile|null|false Local file copy or false (missing) or null (error)
*/
final public function getLocalReference( array $params ) {
$fsFiles = $this->getLocalReferenceMulti( [ 'srcs' => [ $params['src'] ] ] + $params );
@@ -1169,7 +1169,7 @@ abstract class FileBackend implements LoggerAwareInterface {
* - srcs : list of source storage paths
* - latest : use the latest available data
* - parallelize : try to do operations in parallel when possible
- * @return array Map of (path name => FSFile or null on failure)
+ * @return array Map of (path name => FSFile or false (missing) or null (error))
* @since 1.20
*/
abstract public function getLocalReferenceMulti( array $params );
@@ -1184,7 +1184,7 @@ abstract class FileBackend implements LoggerAwareInterface {
* @param array $params Parameters include:
* - src : source storage path
* - latest : use the latest available data
- * @return TempFSFile|null Temporary local file copy or null (missing file or I/O error)
+ * @return TempFSFile|null|false Temporary local file copy or false (missing) or null (error)
*/
final public function getLocalCopy( array $params ) {
$tmpFiles = $this->getLocalCopyMulti( [ 'srcs' => [ $params['src'] ] ] + $params );
@@ -1204,7 +1204,7 @@ abstract class FileBackend implements LoggerAwareInterface {
* - srcs : list of source storage paths
* - latest : use the latest available data
* - parallelize : try to do operations in parallel when possible
- * @return array Map of (path name => TempFSFile or null on failure)
+ * @return array Map of (path name => TempFSFile or false (missing) or null (error))
* @since 1.20
*/
abstract public function getLocalCopyMulti( array $params );