r25231 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25230‎ | r25231 | r25232 >
Date:14:09, 28 August 2007
Author:kim
Status:old
Tags:
Comment:
Added __tostring methods to several classes
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Attribute.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Fetcher.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/ViewInformation.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/small/apiview.pl (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/small/autoreplace.sh (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/small/wfMsg.pl (added) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/Fetcher.php
@@ -32,6 +32,12 @@
3333 // public function fetch($keyPath, $record) {
3434 // return $keyPath->peek($this->objectIdAttributeLevel)->getAttributeValue($this->objectIdAttribute);
3535 // }
 36+ function __tostring(){
 37+ $attributeLevel=$this->attributeLevel;
 38+ $attribute=$this->attribute;
 39+ return "ObjectIdFetcher($attributeLevel, $attribute)";
 40+ }
 41+
3642 }
3743
3844 class DefinitionObjectIdFetcher extends DefaultFetcher {
@@ -39,6 +45,12 @@
4046 $definedMeaningId = $keyPath->peek($this->attributeLevel)->getAttributeValue($this->attribute);
4147 return getDefinedMeaningDefinitionId($definedMeaningId);
4248 }
 49+
 50+ function __tostring(){
 51+ $attributeLevel=$this->attributeLevel;
 52+ $attribute=$this->attribute;
 53+ return "DefinitionObjectIdFetcher($attributeLevel, $attribute)";
 54+ }
4355 }
4456
4557
Index: trunk/extensions/Wikidata/OmegaWiki/Attribute.php
@@ -39,6 +39,12 @@
4040 }
4141 }
4242
 43+ function __tostring() {
 44+ $id=$this->id;
 45+ $name=$this->name;
 46+ $type=$this->type;
 47+ return "Attribute($id, $name, $type)";
 48+ }
4349 }
4450
4551 class Structure {
@@ -111,7 +117,7 @@
112118 throw new Exception("Invalid structure constructor: ".print_r($args,true));
113119 }
114120 }
115 -
 121+
116122 public function supportsAttributeId($attributeId) {
117123 // $result = false;
118124 // $i = 0;
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php
@@ -756,6 +756,7 @@
757757 $classMembershipEditor = getDefinedMeaningClassMembershipEditor($viewInformation);
758758 $collectionMembershipEditor = getDefinedMeaningCollectionMembershipEditor($viewInformation);
759759
 760+ #var_dump($definitionEditor);
760761 $possiblySynonymousEditor = getGroupedRelationTypeEditor(
761762 $o->possiblySynonymous,
762763 $o->possiblySynonymousId,
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php
@@ -1175,8 +1175,9 @@
11761176 }
11771177
11781178 function getDefiningExpressionRecord($definedMeaningId) {
1179 - $o=OmegaWikiAttributes::getInstance();
11801179
 1180+ $o=OmegaWikiAttributes::getInstance();
 1181+
11811182 $definingExpression=definingExpressionRow($definedMeaningId);
11821183 $definingExpressionRecord = new ArrayRecord($o->definedMeaningCompleteDefiningExpression->type);
11831184 $definingExpressionRecord->expressionId = $definingExpression[0];
Index: trunk/extensions/Wikidata/OmegaWiki/ViewInformation.php
@@ -58,6 +58,10 @@
5959 $this->showRecordLifeSpan.",".
6060 $this->viewOrEdit;
6161 }
 62+
 63+ public function __tostring(){
 64+ return "viewinformation object>";
 65+ }
6266 }
6367
6468 ?>
Index: trunk/extensions/Wikidata/OmegaWiki/small/wfMsg.pl
@@ -0,0 +1,8 @@
 2+#!/usr/bin/perl
 3+
 4+
 5+while(<>) {
 6+ s/wfMsg\(\s*\"(ow_)?(.*?)\"(.*?)\)/wfMsg_sc("$2"$3)/;
 7+ s/wfMsg\(\s*\'(ow_)?(.*?)\'(.*?)\)/wfMsg_sc("$2"$3)/;
 8+ print;
 9+}
Property changes on: trunk/extensions/Wikidata/OmegaWiki/small/wfMsg.pl
___________________________________________________________________
Added: svn:executable
110 + *
Index: trunk/extensions/Wikidata/OmegaWiki/small/autoreplace.sh
@@ -1,5 +1,5 @@
22 #!/bin/bash
33 export myfile=$1;
44
5 -perl -pe "s/wfMsg_sc/wfMsgSc/g" $myfile > $myfile.new &&
 5+small/apiview.pl $myfile > $myfile.new &&
66 mv $myfile.new $myfile
Index: trunk/extensions/Wikidata/OmegaWiki/small/apiview.pl
@@ -1,6 +1,10 @@
22 #!/usr/bin/perl
33
 4+my $myclass="";
45 while(<>) {
5 - s/(function.*)/$1\nprint"$1";\n/;
 6+ if (/class/){
 7+ $myclass=$_;
 8+ }
 9+ s/function(.*?)(\(.*$)/function$1$2\nwfDebug("$myclass--$1\\n");\n/;
610 print;
711 }
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -88,6 +88,10 @@
8989 public function getKeyStack() {
9090 return $this->keyStack;
9191 }
 92+
 93+ public function __tostring() {
 94+ return "<object of class IdStack>";
 95+ }
9296 }
9397
9498 //added the "allow add controller" to be able to control the usage of the add field in different circumstances
@@ -2208,4 +2212,4 @@
22092213 public function showsData($value) {
22102214 return true;
22112215 }
2212 -}
\ No newline at end of file
 2216+}

Status & tagging log