r23715 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23714‎ | r23715 | r23716 >
Date:17:14, 4 July 2007
Author:kim
Status:old
Tags:
Comment:
Save works somewhat, I'm possibly still missing bits
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SaveDM.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -91,7 +91,8 @@
9292
9393 #here we assume the DM is not there yet.. not entirely wise
9494 #in the long run.
95 - $definedMeaningId=createNewDefinedMeaning($expressionId, $langaugeId, $text);
 95+ echo "id: $expressionId lang: $languageId";
 96+ $definedMeaningId=createNewDefinedMeaning($expressionId, $languageId, $text);
9697
9798 getDefinedMeaningEditor($this->viewInformation)->save(
9899 $this->getIdStack($definedMeaningId),
@@ -117,23 +118,26 @@
118119 /*horrible cannibalised hack. Use at own risk*/
119120 /* this particular function doesn't actually work yet */
120121 public function saveWithinTransaction() {
121 - global
122 - $wgTitle, $wgUser, $wgRequest;
 122+ #global
 123+ # $wgTitle, $wgUser, $wgRequest;
123124
124 - $summary = $wgRequest->getText('summary');
 125+ #$summary = $wgRequest->getText('summary');
125126
 127+
126128 // Insert transaction information into the DB
127 - startNewTransaction($wgUser->getID(), wfGetIP(), $summary);
 129+ #startNewTransaction($wgUser->getID(), wfGetIP(), $summary);
 130+ startNewTransaction(0, "0.0.0.0", "copy operation");
128131
129132 // Perform regular save
130 - $this->save(new QueryAtTransactionInformation($wgRequest->getInt('transaction'), false));
 133+ #$this->save(new QueryAtTransactionInformation($wgRequest->getInt('transaction'), false));
 134+ $this->save();
131135
132136 // Update page caches
133 - Title::touchArray(array($wgTitle));
 137+ #Title::touchArray(array($wgTitle));
134138
135139 // Add change to RC log
136 - $now = wfTimestampNow();
137 - RecentChange::notifyEdit($now, $wgTitle, false, $wgUser, $summary, 0, $now, false, '', 0, 0, 0);
 140+ #$now = wfTimestampNow();
 141+ #RecentChange::notifyEdit($now, $wgTitle, false, $wgUser, $summary, 0, $now, false, '', 0, 0, 0);
138142 }
139143
140144 public function getRecord() {
Index: trunk/extensions/Wikidata/OmegaWiki/SaveDM.php
@@ -34,7 +34,7 @@
3535 $wdCurrentContext;
3636 $wdCurrentContext=$dc;
3737 #echo $model->getRecord();
38 - $model->save();
 38+ $model->saveWithinTransaction();
3939 }
4040
4141 global
@@ -47,7 +47,6 @@
4848 /* insert code here */
4949
5050 $model=getDM(663672,"uw");
51 -#saveDM($model,"tt");
5251
5352 $record=$model->getRecord();
5453 echo $record;
@@ -60,6 +59,8 @@
6160
6261 echo "id: $id, spelling:$spelling, language:$language";
6362
 63+saveDM($model,"tt");
 64+
6465 $endTime = time();
6566 echo("\n\nTime elapsed: " . durationToString($endTime - $beginTime));
6667

Status & tagging log