20 if ( $fileName !==
null ) {
21 $this->file = fopen( $fileName,
'a' );
23 throw new \RuntimeException(
'Unable to open undo log' );
36 public function update( $table, array $newValues, array $oldValues, $fname ) {
37 $this->dbw->newUpdateQueryBuilder()
41 ->caller( $fname )->execute();
43 $updated = (bool)$this->dbw->affectedRows();
44 if ( $this->file && $updated ) {
45 $table = $this->dbw->tableName( $table );
Update a database while optionally writing SQL that reverses the update to a file.
__construct( $fileName, IDatabase $dbw)
update( $table, array $newValues, array $oldValues, $fname)