Index: trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php |
— | — | @@ -88,7 +88,6 @@ |
89 | 89 | |
90 | 90 | class DefinitionHelper extends Helper { |
91 | 91 | public function __construct($record) { |
92 | | - echo "DefinitionHelper\n"; |
93 | 92 | Helper::__construct($record); |
94 | 93 | } |
95 | 94 | |
— | — | @@ -97,34 +96,34 @@ |
98 | 97 | |
99 | 98 | class TranslatedTextHelper extends Helper { |
100 | 99 | public function __construct($record) { |
101 | | - echo "TranslatedTextHelper\n"; |
102 | 100 | Helper::__construct($record); |
103 | 101 | } |
104 | 102 | } |
105 | 103 | |
106 | 104 | class ObjectAttributesHelper extends Helper { |
107 | 105 | public function __construct($record) { |
108 | | - echo "ObjectAttributesHelper\n"; |
109 | 106 | Helper::__construct($record); |
110 | 107 | } |
111 | 108 | } |
112 | 109 | |
113 | 110 | class SynonymsTranslationsHelper extends Helper { |
114 | 111 | public function __construct($record) { |
115 | | - echo "SynonymsTranslationsHelper\n"; |
116 | 112 | Helper::__construct($record); |
117 | 113 | } |
118 | 114 | } |
119 | 115 | |
120 | 116 | class ExpressionHelper extends Helper { |
121 | 117 | public function __construct($record) { |
122 | | - echo "ExpressionHelper\n"; |
123 | 118 | Helper::__construct($record); |
124 | | - echo $record; |
| 119 | + #echo $record; |
125 | 120 | } |
126 | 121 | |
| 122 | + // Actually going to use save for now (kind of hack) |
127 | 123 | public function getSaveSQL($dc="uw") { |
128 | 124 | $dc=wdGetDataSetContext($dc); |
| 125 | + } |
| 126 | + |
| 127 | + public function save() { |
129 | 128 | |
130 | 129 | } |
131 | 130 | } |
— | — | @@ -132,56 +131,48 @@ |
133 | 132 | |
134 | 133 | class RelationsHelper extends Helper { |
135 | 134 | public function __construct($record) { |
136 | | - echo "RelationsHelper\n"; |
137 | 135 | Helper::__construct($record); |
138 | 136 | } |
139 | 137 | } |
140 | 138 | |
141 | 139 | class RelationTypeHelper extends Helper { |
142 | 140 | public function __construct($record) { |
143 | | - echo "RelationTypeHelper\n"; |
144 | 141 | Helper::__construct($record); |
145 | 142 | } |
146 | 143 | } |
147 | 144 | |
148 | 145 | class OtherDefinedMeaningHelper extends Helper { |
149 | 146 | public function __construct($record) { |
150 | | - echo "OtherDefinedMeaningHelper\n"; |
151 | 147 | Helper::__construct($record); |
152 | 148 | } |
153 | 149 | } |
154 | 150 | |
155 | 151 | class ReciprocalRelationsHelper extends Helper { |
156 | 152 | public function __construct($record) { |
157 | | - echo "ReciprocalRelationsHelper\n"; |
158 | 153 | Helper::__construct($record); |
159 | 154 | } |
160 | 155 | } |
161 | 156 | |
162 | 157 | class CollectionMembershipHelper extends Helper { |
163 | 158 | public function __construct($record) { |
164 | | - echo "CollectionMembershipHelper\n"; |
165 | 159 | Helper::__construct($record); |
166 | 160 | } |
167 | 161 | } |
168 | 162 | |
169 | 163 | class CollectionMeaningHelper extends Helper { |
170 | 164 | public function __construct($record) { |
171 | | - echo "CollectionMeaningHelper\n"; |
172 | 165 | Helper::__construct($record); |
173 | 166 | } |
174 | 167 | } |
175 | 168 | |
176 | 169 | class GotoSourceHelper extends Helper { |
177 | 170 | public function __construct($record) { |
178 | | - echo "GotoSourceHelper\n"; |
179 | 171 | Helper::__construct($record); |
180 | 172 | } |
181 | 173 | } |
182 | 174 | |
183 | 175 | class DefinedMeaningAttributesHelper extends Helper { |
184 | 176 | public function __construct($record) { |
185 | | - echo "DefinedMeaningAttributesHelper\n"; |
186 | 177 | Helper::__construct($record); |
187 | 178 | } |
188 | 179 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/SaveDM.php |
— | — | @@ -0,0 +1,49 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +# let's see... |
| 5 | + |
| 6 | +define('MEDIAWIKI', true ); |
| 7 | + |
| 8 | +# do we seriously need ALL of these? |
| 9 | +require_once("../../../StartProfiler.php"); |
| 10 | +require_once("../../../LocalSettings.php"); |
| 11 | +require_once("../php-tools/ProgressBar.php"); |
| 12 | +#require_once("DatabaseUtilities.php"); |
| 13 | +require_once("Setup.php"); |
| 14 | +require_once("DefinedMeaningModel.php"); |
| 15 | +require_once("Transaction.php"); |
| 16 | + |
| 17 | +/** Just get a defined meaning */ |
| 18 | +function getDM($dm_id,$dc="uw") { |
| 19 | + $definedMeaningId=663665; # UnitTest |
| 20 | + $filterLanguageId=0; # ??? What does this do ??? |
| 21 | + $possiblySynonymousRelationTypeId=0; # ??? What does this do ??? |
| 22 | + $queryTransactionInformation= new QueryLatestTransactionInformation(); |
| 23 | + $model=new DefinedMeaningModel($definedMeaningId, $filterLanguageId, $possiblySynonymousRelationTypeId, $queryTransactionInformation); |
| 24 | + $record=$model->getRecord(); |
| 25 | + $record->finish("DefinedMeaning"); |
| 26 | + return $model; |
| 27 | +} |
| 28 | + |
| 29 | +function saveDM($model) { |
| 30 | + $model->saveWithinTransaction(); |
| 31 | +} |
| 32 | + |
| 33 | +global |
| 34 | +$beginTime, $wgCommandLineMode, $dc; |
| 35 | + |
| 36 | +$beginTime = time(); |
| 37 | +$wgCommandLineMode = true; |
| 38 | +# $dc = "uw"; < can't modify from here |
| 39 | + |
| 40 | +/* insert code here */ |
| 41 | + |
| 42 | +$model=getDM(663655); |
| 43 | +$record=$model->getRecord(); |
| 44 | +echo $record; |
| 45 | + |
| 46 | + |
| 47 | +$endTime = time(); |
| 48 | +echo("\n\nTime elapsed: " . durationToString($endTime - $beginTime)); |
| 49 | + |
| 50 | + |