Manual:Status.php

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Status.php and the translation is 22% complete.

Other languages:
English • ‎dansk • ‎polski • ‎日本語

Status is the generic operation result class. It 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.

Statiske funktioner

  • newFatal( $message )
  • newGood( $message )