MediaWiki  1.23.0
DataUpdate.php
Go to the documentation of this file.
1 <?php
32 abstract class DataUpdate implements DeferrableUpdate {
36  public function __construct() {
37  # noop
38  }
39 
44  public function beginTransaction() {
45  //noop
46  }
47 
52  public function commitTransaction() {
53  //noop
54  }
55 
60  public function rollbackTransaction() {
61  //noop
62  }
63 
79  public static function runUpdates( $updates ) {
80  if ( empty( $updates ) ) {
81  return; # nothing to do
82  }
83 
84  $open_transactions = array();
85  $exception = null;
86 
92  try {
93  // begin transactions
94  foreach ( $updates as $update ) {
95  $update->beginTransaction();
96  $open_transactions[] = $update;
97  }
98 
99  // do work
100  foreach ( $updates as $update ) {
101  $update->doUpdate();
102  }
103 
104  // commit transactions
105  while ( count( $open_transactions ) > 0 ) {
106  $trans = array_pop( $open_transactions );
107  $trans->commitTransaction();
108  }
109  } catch ( Exception $ex ) {
110  $exception = $ex;
111  wfDebug( "Caught exception, will rethrow after rollback: " .
112  $ex->getMessage() . "\n" );
113  }
114 
115  // rollback remaining transactions
116  while ( count( $open_transactions ) > 0 ) {
117  $trans = array_pop( $open_transactions );
118  $trans->rollbackTransaction();
119  }
120 
121  if ( $exception ) {
122  throw $exception; // rethrow after cleanup
123  }
124  }
125 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
DataUpdate\runUpdates
static runUpdates( $updates)
Convenience method, calls doUpdate() on every DataUpdate in the array.
Definition: DataUpdate.php:79
DataUpdate
Abstract base class for update jobs that do something with some secondary data extracted from article...
Definition: DataUpdate.php:32
DataUpdate\commitTransaction
commitTransaction()
Commit the transaction started via beginTransaction, if any.
Definition: DataUpdate.php:52
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
DataUpdate\beginTransaction
beginTransaction()
Begin an appropriate transaction, if any.
Definition: DataUpdate.php:44
wfDebug
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:933
DataUpdate\__construct
__construct()
Constructor.
Definition: DataUpdate.php:36
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
DataUpdate\rollbackTransaction
rollbackTransaction()
Abort / roll back the transaction started via beginTransaction, if any.
Definition: DataUpdate.php:60
DeferrableUpdate
Interface that deferrable updates should implement.
Definition: DeferredUpdates.php:29