MediaWiki  1.27.1
Status Class Reference

Generic operation result class Has warning/error list, boolean status and arbitrary value. More...

Inheritance diagram for Status:
Collaboration diagram for Status:

Public Member Functions

 __construct (StatusValue $sv=null)
 
 __get ($name)
 Backwards compatibility logic. More...
 
 __set ($name, $value)
 Backwards compatibility logic. More...
 
 __sleep ()
 Don't save the callback when serializing, because Closures can't be serialized and we're going to clear it in __wakeup anyway. More...
 
 __toString ()
 
 __wakeup ()
 Sanitize the callback parameter on wakeup, to avoid arbitrary execution. More...
 
 error ($message)
 Add an error, do not set fatal flag This can be used for non-fatal errors. More...
 
 fatal ($message)
 Add an error and set OK to false, indicating that the operation as a whole was fatal. More...
 
 getErrorsArray ()
 Get the list of errors (but not warnings) More...
 
 getErrorsByType ($type)
 Returns a list of status messages of the given type, with message and params left untouched, like a sane version of getStatusArray. More...
 
 getHTML ($shortContext=false, $longContext=false, $lang=null)
 Get the error message as HTML. More...
 
 getMessage ($shortContext=false, $longContext=false, $lang=null)
 Get a bullet list of the errors as a Message object. More...
 
 getStatusValue ()
 Returns the wrapped StatusValue object. More...
 
 getValue ()
 
 getWarningsArray ()
 Get the list of warnings (but not errors) More...
 
 getWikiText ($shortContext=false, $longContext=false, $lang=null)
 Get the error list as a wikitext formatted list. More...
 
 hasMessage ($message)
 Returns true if the specified message is present as a warning or error. More...
 
 isGood ()
 Returns whether the operation completed and didn't have any error or warnings. More...
 
 isOK ()
 Returns whether the operation completed. More...
 
 merge ($other, $overwriteValue=false)
 Merge another status object into this one. More...
 
 replaceMessage ($source, $dest)
 If the specified source message exists, replace it with the specified destination message, but keep the same parameters as in the original error. More...
 
 setResult ($ok, $value=null)
 Change operation result. More...
 
 warning ($message)
 Add a new warning. More...
 

Static Public Member Functions

static newFatal ($message)
 Factory function for fatal errors. More...
 
static newGood ($value=null)
 Factory function for good results. More...
 
static wrap ($sv)
 Succinct helper method to wrap a StatusValue. More...
 

Public Attributes

callable $cleanCallback = false
 
int $failCount = 0
 Counter for batch operations. More...
 
array $success = []
 Map of (key => bool) to indicate success of each part of batch operations. More...
 
int $successCount = 0
 Counter for batch operations. More...
 
mixed $value
 

Protected Member Functions

 cleanParams (array $params)
 
 getErrorMessage ($error, $lang=null)
 Return the message for a single error. More...
 
 getErrorMessageArray ($errors, $lang=null)
 Return an array with a Message object for each error. More...
 
 getStatusArray ($type=false)
 Returns a list of status messages of the given type (or all if false) More...
 
 languageFromParam ($lang)
 

Protected Attributes

StatusValue $sv
 

Detailed Description

Generic operation result class Has warning/error list, boolean status and arbitrary value.

"Good" means the operation was completed with no warnings or errors.

"OK" means the operation was partially or wholly completed.

An operation which is not OK should have errors so that the user can be informed as to what went wrong. Calling the fatal() function sets an error message and simultaneously switches off the OK flag.

The recommended pattern for Status objects is to return a Status object unconditionally, i.e. both on success and on failure – so that the developer of the calling code is reminded that the function can fail, and so that a lack of error-handling will be explicit.

Definition at line 40 of file Status.php.

Constructor & Destructor Documentation

Status::__construct ( StatusValue  $sv = null)
Parameters
StatusValue$sv[optional]

Definition at line 59 of file Status.php.

References $sv.

Member Function Documentation

Status::__get (   $name)

Backwards compatibility logic.

Parameters
string$name

Definition at line 486 of file Status.php.

References $name.

Status::__set (   $name,
  $value 
)

Backwards compatibility logic.

Parameters
string$name
mixed$value

Definition at line 501 of file Status.php.

References $name, and $value.

Status::__sleep ( )

Don't save the callback when serializing, because Closures can't be serialized and we're going to clear it in __wakeup anyway.

Definition at line 523 of file Status.php.

References $keys.

Status::__toString ( )
Returns
string

Definition at line 515 of file Status.php.

Status::__wakeup ( )

Sanitize the callback parameter on wakeup, to avoid arbitrary execution.

Definition at line 531 of file Status.php.

Status::cleanParams ( array  $params)
protected
Parameters
array$params
Returns
array

Definition at line 178 of file Status.php.

References $params, and as.

Referenced by getErrorMessage().

Status::error (   $message)

Add an error, do not set fatal flag This can be used for non-fatal errors.

Parameters
string | Message$messageMessage name or object

Definition at line 160 of file Status.php.

Status::fatal (   $message)

Add an error and set OK to false, indicating that the operation as a whole was fatal.

Parameters
string | Message$messageMessage name or object

Definition at line 170 of file Status.php.

Referenced by EditPage\runPostMergeFilters().

Status::getErrorMessage (   $error,
  $lang = null 
)
protected

Return the message for a single error.

Parameters
mixed$errorWith an array & two values keyed by 'message' and 'params', use those keys-value pairs. Otherwise, if its an array, just use the first value as the message and the remaining items as the params.
string | Language$langLanguage to use for processing messages
Returns
Message

Definition at line 323 of file Status.php.

References $lang, cleanParams(), languageFromParam(), and wfMessage().

Referenced by getErrorMessageArray(), getMessage(), and getWikiText().

Status::getErrorMessageArray (   $errors,
  $lang = null 
)
protected

Return an array with a Message object for each error.

Parameters
array$errors
string | Language$langLanguage to use for processing messages
Returns
Message[]

Definition at line 365 of file Status.php.

References $e, $lang, getErrorMessage(), languageFromParam(), and use.

Referenced by getMessage(), and getWikiText().

Status::getErrorsArray ( )

Get the list of errors (but not warnings)

Returns
array A list in which each entry is an array with a message key as its first element. The remaining array elements are the message parameters.
Deprecated:
1.25

Definition at line 389 of file Status.php.

References getStatusArray().

Referenced by CliInstaller\showStatusMessage(), and WebInstaller\showStatusMessage().

Status::getErrorsByType (   $type)

Returns a list of status messages of the given type, with message and params left untouched, like a sane version of getStatusArray.

Each entry is a map of:

  • message: string message key or MessageSpecifier
  • params: array list of parameters
Parameters
string$type
Returns
array

Definition at line 444 of file Status.php.

References $type.

Referenced by ApiErrorFormatter_BackCompat\arrayFromStatus().

Status::getHTML (   $shortContext = false,
  $longContext = false,
  $lang = null 
)

Get the error message as HTML.

This is done by parsing the wikitext error message.

Parameters
string$shortContextA short enclosing context message name, to be used when there is a single error
string$longContextA long enclosing context message name, for a list
string | Language$langLanguage to use for processing messages
Returns
string

Definition at line 352 of file Status.php.

References $lang, $out, getWikiText(), languageFromParam(), and MessageCache\singleton().

Referenced by StatusTest\testGetHtml().

Status::getMessage (   $shortContext = false,
  $longContext = false,
  $lang = null 
)

Get a bullet list of the errors as a Message object.

$shortContext and $longContext can be used to wrap the error list in some text. $shortContext will be preferred when there is a single error; $longContext will be preferred when there are multiple ones. In either case, $1 will be replaced with the list of errors.

$shortContext is assumed to use $1 as an inline parameter: if there is a single item, it will not be made into a list; if there are multiple items, newlines will be inserted around the list. $longContext is assumed to use $1 as a standalone parameter; it will always receive a list.

If both parameters are missing, and there is only one error, no bullet will be added.

Parameters
string|string[]$shortContext A message name or an array of message names.
string|string[]$longContext A message name or an array of message names.
string | Language$langLanguage to use for processing messages
Returns
Message

Definition at line 272 of file Status.php.

References $lang, $s, getErrorMessage(), getErrorMessageArray(), languageFromParam(), and wfMessage().

Referenced by MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProvider\setPasswordResetFlag(), and StatusTest\testGetMessage().

Status::getStatusArray (   $type = false)
protected

Returns a list of status messages of the given type (or all if false)

Note
: this handles RawMessage poorly
Parameters
string | bool$type
Returns
array

Definition at line 412 of file Status.php.

References $type, and as.

Referenced by getErrorsArray(), and getWarningsArray().

Status::getStatusValue ( )

Returns the wrapped StatusValue object.

Returns
StatusValue

Definition at line 122 of file Status.php.

References $sv.

Status::getValue ( )
Returns
mixed

Definition at line 477 of file Status.php.

Status::getWarningsArray ( )

Get the list of warnings (but not errors)

Returns
array A list in which each entry is an array with a message key as its first element. The remaining array elements are the message parameters.
Deprecated:
1.25

Definition at line 400 of file Status.php.

References getStatusArray().

Referenced by CliInstaller\showStatusMessage(), and WebInstaller\showStatusMessage().

Status::getWikiText (   $shortContext = false,
  $longContext = false,
  $lang = null 
)

Get the error list as a wikitext formatted list.

Parameters
string | bool$shortContextA short enclosing context message name, to be used when there is a single error
string | bool$longContextA long enclosing context message name, for a list
string | Language$langLanguage to use for processing messages
Returns
string

Definition at line 216 of file Status.php.

References $lang, $s, as, getErrorMessage(), getErrorMessageArray(), languageFromParam(), and wfMessage().

Referenced by getHTML(), EditPage\handleStatus(), and StatusTest\testGetWikiText().

Status::hasMessage (   $message)

Returns true if the specified message is present as a warning or error.

Parameters
string | Message$messageMessage key or object to search for
Returns
bool

Definition at line 455 of file Status.php.

Status::isOK ( )

Returns whether the operation completed.

Returns
bool

Definition at line 141 of file Status.php.

Referenced by CliInstaller\showStatusMessage().

Status::languageFromParam (   $lang)
protected
Parameters
string | Language | null$langLanguage to use for processing messages, or null to default to the user language.
Returns
Language

Definition at line 194 of file Status.php.

References $lang, $wgLang, Language\factory(), and global.

Referenced by getErrorMessage(), getErrorMessageArray(), getHTML(), getMessage(), and getWikiText().

Status::merge (   $other,
  $overwriteValue = false 
)

Merge another status object into this one.

Parameters
Status$otherOther Status object
bool$overwriteValueWhether to override the "value" member

Definition at line 378 of file Status.php.

Referenced by ScopedLock\factory(), and FileOpBatch\runParallelBatches().

static Status::newFatal (   $message)
static

Factory function for fatal errors.

Parameters
string | Message$messageMessage name or object
Returns
Status

Definition at line 89 of file Status.php.

Referenced by MWHttpRequest\__construct(), UploadFromChunks\addChunk(), User\addToDatabase(), FileOp\attempt(), SpecialChangeEmail\attemptChange(), MediaWiki\Auth\AuthManager\autoCreateUser(), ChangeTags\canActivateTag(), ChangeTags\canAddTagsAccompanyingChange(), MediaWiki\Auth\AuthManager\canCreateAccount(), ChangeTags\canCreateTag(), ChangeTags\canDeactivateTag(), ChangeTags\canDeleteTag(), ChangeTags\canUpdateTags(), MediaWiki\Auth\AuthManager\checkAccountCreatePermissions(), FileBackend\clean(), ImportReporter\close(), UploadBase\convertVerifyErrorToStatus(), FileBackendStore\createInternal(), Installer\createSysop(), SqliteInstaller\dataDirOKmaybeCreate(), SpecialRedirect\dispatch(), FileDeleteForm\doDelete(), WikiPage\doEditContent(), Installer\doEnvironmentChecks(), SwiftFileBackend\doExecuteOpHandlesInternal(), SpecialImport\doImport(), FileBackend\doOperations(), FileBackendStore\doOperationsInternal(), FileBackend\doQuickOperations(), WatchAction\doUnwatch(), WikiPage\doUpdateRestrictions(), WatchAction\doWatch(), SpecialChangeCredentials\execute(), PoolCounterWork\execute(), CliInstaller\execute(), ZipDirectoryReader\execute(), LoginSignupSpecialPage\execute(), UploadFromUrl\fetchFile(), UserrightsPage\fetchUser(), PoolCounterRedis\getConnection(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\getPasswordResetData(), WebInstallerExistingWiki\handleExistingUpgrade(), BotPassword\login(), LoginSignupSpecialPage\mainLoginForm(), SqliteInstaller\makeStubDBFile(), User\newFatalPermissionDeniedStatus(), ImportStreamSource\newFromFile(), ImportStreamSource\newFromInterwiki(), ImportStreamSource\newFromUpload(), ImportStreamSource\newFromURL(), SpecialUnlockdb\onSubmit(), SpecialLockdb\onSubmit(), SpecialRandomInCategory\onSubmit(), SpecialChangeContentModel\onSubmit(), SpecialExpandTemplates\onSubmitInput(), FormatJson\parse(), DatabaseInstaller\populateInterwikiTable(), FileOp\precheck(), PoolCounter\precheckAcquire(), FileBackend\prepare(), AbstractContent\prepareSave(), MediaWiki\Auth\AuthManagerTest\provideAllowsAuthenticationDataChange(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProviderTest\provideProviderAllowsAuthenticationDataChange(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProviderTest\provideProviderAllowsAuthenticationDataChange(), MediaWiki\Auth\LegacyHookPreAuthenticationProviderTest\provideTestForAccountCreation(), FileBackend\publish(), UploadFromUrl\reallyFetchFile(), PoolCounterRedis\release(), LocalFileDeleteBatch\removeNonexistentFiles(), LocalFileRestoreBatch\removeNonexistentFiles(), LocalFileMoveBatch\removeNonexistentFiles(), ChangeTags\restrictedTagError(), AssembleUploadChunksJob\run(), PublishStashedFileJob\run(), SpecialBotPasswords\save(), FileBackend\secure(), UserMailer\send(), UserMailer\sendInternal(), UserMailer\sendWithPear(), User\setEmailWithConfirmation(), SqliteInstaller\setupDatabase(), PostgresInstaller\setupPLpgSQL(), PostgresInstaller\setupSchema(), PostgresInstaller\setupUser(), RevDelList\setVisibility(), FileBackendStore\storeInternal(), MediaTransformOutput\streamFileWithStatus(), WebInstallerDBConnect\submit(), SpecialEditTags\submit(), PostgresInstaller\submitConnectForm(), OracleInstaller\submitConnectForm(), MysqlInstaller\submitConnectForm(), MssqlInstaller\submitConnectForm(), EmailConfirmation\submitSend(), PostgresInstaller\submitSettingsForm(), MssqlInstaller\submitSettingsForm(), MysqlInstaller\submitSettingsForm(), DatabaseInstaller\submitWebUserBox(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProviderTest\testAuthentication(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProviderTest\testAuthentication(), MediaWiki\Auth\AuthManagerTest\testAutoAccountCreation(), MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProviderTest\testBeginSecondaryAccountCreation(), MediaWiki\Auth\AuthManagerTest\testCanCreateAccount(), MediaWiki\Auth\AuthManagerTest\testCheckAccountCreatePermissions(), PasswordResetTest\testIsAllowed(), BotPasswordTest\testLogin(), StatusTest\testNewFatalWithMessage(), StatusTest\testNewFatalWithString(), StatusTest\testOkAndErrors(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProviderTest\testProviderChangeAuthenticationDataEmail(), MediaWiki\Auth\LegacyHookPreAuthenticationProviderTest\testTestUserForCreation(), SpecialUploadStash\tryClearStashedUploads(), Preferences\tryFormSubmit(), AuthManagerSpecialPage\trySubmit(), PageArchive\undeleteRevisions(), ChangeTags\updateTagsWithChecks(), and PoolCounterRedis\waitForSlotOrNotif().

static Status::newGood (   $value = null)
static

Factory function for good results.

Parameters
mixed$value
Returns
Status

Definition at line 101 of file Status.php.

References $sv, and $value.

Referenced by MWHttpRequest\__construct(), FileBackendMultiWrite\accessibilityCheck(), PoolCounter_Stub\acquireForAnyone(), PoolCounter_Stub\acquireForMe(), ChangeTags\activateTagWithChecks(), SwiftFileBackend\addMissingMetadata(), ChangeTags\addTagsAccompanyingChangeWithChecks(), User\addToDatabase(), MediaWiki\Auth\AuthManager\allowsAuthenticationDataChange(), FileOpBatch\attempt(), FileOp\attempt(), MediaWiki\Auth\AuthManager\autoCreateUser(), ChangeTags\canActivateTag(), ChangeTags\canAddTagsAccompanyingChange(), MediaWiki\Auth\AuthManager\canCreateAccount(), ChangeTags\canCreateTag(), ChangeTags\canDeactivateTag(), ChangeTags\canDeleteTag(), ChangeTags\canUpdateTags(), User\changeAuthenticationData(), MWRestrictions\check(), MediaWiki\Auth\AuthManager\checkAccountCreatePermissions(), PasswordPolicyChecks\checkMaximalPasswordLength(), PasswordPolicyChecks\checkMinimalPasswordLength(), PasswordPolicyChecks\checkMinimumPasswordLengthToLogin(), PasswordPolicyChecks\checkPasswordCannotMatchBlacklist(), PasswordPolicyChecks\checkPasswordCannotMatchUsername(), User\checkPasswordValidity(), UserPasswordPolicy\checkPolicies(), PasswordPolicyChecks\checkPopularPasswordBlacklist(), SqliteInstaller\checkPrerequisites(), DatabaseInstaller\checkPrerequisites(), LocalRepo\cleanupDeletedBatch(), ImportReporter\close(), FSLockManager\closeLockHandles(), PostgresInstaller\commitChanges(), FileBackendStore\concatenate(), FileBackendMultiWrite\consistencyCheck(), MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider\continueLinkAttempt(), SwiftFileBackend\createContainer(), Installer\createMainpage(), Installer\createSysop(), ChangeTags\createTagWithChecks(), SqliteInstaller\dataDirOKmaybeCreate(), ChangeTags\deactivateTagWithChecks(), SwiftFileBackend\deleteContainer(), ChangeTags\deleteTagEverywhere(), FileBackendStore\describeInternal(), FileOp\doAttempt(), CreateFileOp\doAttempt(), StoreFileOp\doAttempt(), CopyFileOp\doAttempt(), MoveFileOp\doAttempt(), FileBackendStore\doClean(), FSFileBackend\doCleanInternal(), FileBackendStore\doCleanInternal(), SwiftFileBackend\doCleanInternal(), FileBackendStore\doConcatenate(), MemoryFileBackend\doCopyInternal(), FSFileBackend\doCopyInternal(), SwiftFileBackend\doCopyInternal(), WikiPage\doCreate(), MemoryFileBackend\doCreateInternal(), FSFileBackend\doCreateInternal(), SwiftFileBackend\doCreateInternal(), WikiPage\doDeleteArticleReal(), MemoryFileBackend\doDeleteInternal(), FSFileBackend\doDeleteInternal(), SwiftFileBackend\doDeleteInternal(), FileBackendStore\doDescribeInternal(), SwiftFileBackend\doDescribeInternal(), FileBackendMultiWrite\doDirectoryOp(), WikiPage\doEditContent(), Installer\doEnvironmentChecks(), FSFileBackend\doExecuteOpHandlesInternal(), SwiftFileBackend\doExecuteOpHandlesInternal(), MemcLockManager\doFreeLocksOnServer(), Installer\doGenerateKeys(), MemcLockManager\doGetLocksOnServer(), MySqlLockManager\doGetLocksOnServer(), PostgreSqlLockManager\doGetLocksOnServer(), FSLockManager\doLock(), NullLockManager\doLock(), QuorumLockManager\doLockByType(), LockManager\doLockByType(), QuorumLockManager\doLockingRequestBucket(), DBFileJournal\doLogChangeBatch(), NullFileJournal\doLogChangeBatch(), WikiPage\doModify(), FSFileBackend\doMoveInternal(), SwiftFileBackend\doMoveInternal(), FileBackend\doOperations(), FileBackendMultiWrite\doOperationsInternal(), FileBackendStore\doOperationsInternal(), RevDelArchiveList\doPostCommitUpdates(), RevDelFileList\doPostCommitUpdates(), RevDelRevisionList\doPostCommitUpdates(), RevDelList\doPostCommitUpdates(), FileOp\doPrecheck(), CreateFileOp\doPrecheck(), StoreFileOp\doPrecheck(), CopyFileOp\doPrecheck(), MoveFileOp\doPrecheck(), DeleteFileOp\doPrecheck(), DescribeFileOp\doPrecheck(), RevDelArchiveList\doPreCommitUpdates(), RevDelFileList\doPreCommitUpdates(), RevDelRevisionList\doPreCommitUpdates(), RevDelList\doPreCommitUpdates(), FileBackendStore\doPrepare(), FSFileBackend\doPrepareInternal(), FileBackendStore\doPrepareInternal(), SwiftFileBackend\doPrepareInternal(), FileBackendStore\doPublish(), FSFileBackend\doPublishInternal(), FileBackendStore\doPublishInternal(), SwiftFileBackend\doPublishInternal(), DBFileJournal\doPurgeOldLogs(), NullFileJournal\doPurgeOldLogs(), FileBackend\doQuickOperations(), FileBackendMultiWrite\doQuickOperationsInternal(), FileBackendStore\doQuickOperationsInternal(), FileBackendStore\doSecure(), FSFileBackend\doSecureInternal(), FileBackendStore\doSecureInternal(), SwiftFileBackend\doSecureInternal(), FSLockManager\doSingleLock(), FSLockManager\doSingleUnlock(), MemoryFileBackend\doStoreInternal(), FSFileBackend\doStoreInternal(), SwiftFileBackend\doStoreInternal(), MemoryFileBackend\doStreamFile(), FileBackendStore\doStreamFile(), SwiftFileBackend\doStreamFile(), FileBackendTest\doTestLockCalls(), FSLockManager\doUnlock(), NullLockManager\doUnlock(), QuorumLockManager\doUnlockByType(), LockManager\doUnlockByType(), QuorumLockManager\doUnlockingRequestBucket(), WatchAction\doUnwatch(), WikiPage\doUpdateRestrictions(), WatchAction\doWatch(), WatchAction\doWatchOrUnwatch(), ZipDirectoryReader\execute(), UploadBase\fetchFile(), UserrightsPage\fetchUser(), MemcLockManager\freeLocksOnServer(), DBLockManager\freeLocksOnServer(), RedisLockManager\freeLocksOnServer(), ApiUpload\getChunkResult(), PoolCounterRedis\getConnection(), DatabaseInstaller\getConnection(), RedisLockManager\getLocksOnServer(), MemcLockManager\getLocksOnServer(), DBLockManager\getLocksOnServer(), PostgresInstaller\getPgConnection(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProviderTest\getProvider(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProviderTest\getProvider(), SpecialUnlinkAccounts\handleFormSubmit(), SpecialChangeCredentials\handleFormSubmit(), AuthManagerSpecialPage\handleFormSubmit(), WebInstallerExistingWiki\importVariables(), Installer\includeExtensions(), EditPage\internalAttemptSave(), FileJournal\logChangeBatch(), BotPassword\login(), SqliteInstaller\makeStubDBFile(), MovePage\move(), ImportStreamSource\newFromFile(), ImportStreamSource\newFromURL(), FileRepo\newGood(), FileBackendStore\nullInternal(), SwiftFileBackend\objectListing(), SpecialUnlockdb\onSubmit(), SpecialLockdb\onSubmit(), SpecialBotPasswords\onSubmit(), SpecialExpandTemplates\onSubmitInput(), MysqlInstaller\openConnection(), OracleInstaller\openConnection(), SqliteInstaller\openConnection(), MssqlInstaller\openConnection(), PostgresInstaller\openConnectionToAnyDB(), PostgresInstaller\openConnectionWithParams(), OracleInstaller\openSYSDBAConnection(), FormatJson\parse(), ApiUpload\performUpload(), DatabaseInstaller\populateInterwikiTable(), Installer\populateSiteStats(), PoolCounter\precheckAcquire(), FileOp\precheckDestExistence(), AbstractContent\prepareSave(), MediaWiki\Auth\AuthManagerTest\provideAllowsAuthenticationDataChange(), MWRestrictionsTest\provideCheck(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProviderTest\provideProviderAllowsAuthenticationDataChange(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProviderTest\provideProviderAllowsAuthenticationDataChange(), FSLockManager\pruneKeyLockFiles(), PoolCounterRedis\release(), PoolCounter_Stub\release(), RedisLockManager\releaseAllLocks(), MemcLockManager\releaseAllLocks(), MySqlLockManager\releaseAllLocks(), PostgreSqlLockManager\releaseAllLocks(), LocalFileDeleteBatch\removeNonexistentFiles(), LocalFileRestoreBatch\removeNonexistentFiles(), LocalFileMoveBatch\removeNonexistentFiles(), FileBackendMultiWrite\resyncFiles(), AssembleUploadChunksJob\run(), PublishStashedFileJob\run(), SpecialBotPasswords\save(), UserMailer\send(), UserMailer\sendInternal(), UserMailer\sendWithPear(), SwiftFileBackend\setContainerAccess(), User\setEmailWithConfirmation(), WikiImporter\setTargetRootPage(), SqliteInstaller\setupDatabase(), OracleInstaller\setupDatabase(), PostgresInstaller\setupDatabase(), PostgresInstaller\setupPLpgSQL(), PostgresInstaller\setupSchema(), OracleInstaller\setupUser(), MysqlInstaller\setupUser(), MssqlInstaller\setupUser(), PostgresInstaller\setupUser(), RevDelList\setVisibility(), LocalRepo\skipWriteOperationIfSha1(), FileBackendStore\streamFile(), MediaTransformOutput\streamFileWithStatus(), PostgresInstaller\submitConnectForm(), OracleInstaller\submitConnectForm(), MysqlInstaller\submitConnectForm(), MssqlInstaller\submitConnectForm(), OracleInstaller\submitInstallUserBox(), DatabaseInstaller\submitInstallUserBox(), EmailConfirmation\submitSend(), DatabaseInstaller\submitSettingsForm(), PostgresInstaller\submitSettingsForm(), MssqlInstaller\submitSettingsForm(), MysqlInstaller\submitSettingsForm(), DatabaseInstaller\submitWebUserBox(), SyncFileBackend\syncFileBatch(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProviderTest\testAuthentication(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProviderTest\testAuthentication(), MediaWiki\Auth\AuthManagerTest\testAutoAccountCreation(), MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProviderTest\testBeginSecondaryAccountCreation(), MediaWiki\Auth\AuthManagerTest\testCanCreateAccount(), MediaWiki\Auth\AuthManagerTest\testCheckAccountCreatePermissions(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProviderTest\testCheckPasswordValidity(), ApiResultTest\testDeprecatedFunctions(), ApiErrorFormatterTest\testErrorFormatter(), ApiErrorFormatterTest\testErrorFormatterBC(), PasswordResetTest\testExecute_email(), PasswordResetTest\testIsAllowed(), StatusTest\testNewGood(), StatusTest\testOkAndErrors(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProviderTest\testSetPasswordResetFlag(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProviderTest\testSetPasswordResetFlag(), MediaWiki\Auth\LegacyHookPreAuthenticationProviderTest\testTestUserForCreation(), SpecialUploadStash\tryClearStashedUploads(), AuthManagerSpecialPage\trySubmit(), Preferences\tryUISubmit(), PageArchive\undeleteRevisions(), ChangeTags\updateTagsWithChecks(), SpecialBlock\validateTarget(), MediaHandler\verifyUpload(), and PoolCounterRedis\waitForSlotOrNotif().

Status::replaceMessage (   $source,
  $dest 
)

If the specified source message exists, replace it with the specified destination message, but keep the same parameters as in the original error.

Note, due to the lack of tools for comparing Message objects, this function will not work when using a Message object as the search parameter.

Parameters
Message | string$sourceMessage key or object to search for
Message | string$destReplacement message key or object
Returns
bool Return true if the replacement was done, false otherwise.

Definition at line 470 of file Status.php.

References $source.

Status::setResult (   $ok,
  $value = null 
)

Change operation result.

Parameters
bool$okWhether the operation completed
mixed$value

Definition at line 114 of file Status.php.

Status::warning (   $message)

Add a new warning.

Parameters
string | Message$messageMessage name or object

Definition at line 150 of file Status.php.

Referenced by Installer\subscribeToMediaWikiAnnounce().

Member Data Documentation

callable Status::$cleanCallback = false

Definition at line 54 of file Status.php.

int Status::$failCount = 0

Counter for batch operations.

Definition at line 51 of file Status.php.

array Status::$success = []

Map of (key => bool) to indicate success of each part of batch operations.

Definition at line 47 of file Status.php.

int Status::$successCount = 0

Counter for batch operations.

Definition at line 49 of file Status.php.

StatusValue Status::$sv
protected

Definition at line 42 of file Status.php.

Referenced by __construct(), getStatusValue(), newGood(), and wrap().

mixed Status::$value

Definition at line 45 of file Status.php.

Referenced by __set(), and newGood().


The documentation for this class was generated from the following file: