r46644 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46643‎ | r46644 | r46645 >
Date:15:21, 31 January 2009
Author:demon
Status:deferred
Tags:
Comment:
Big commit: Remove the last of &wfGetDB(). Use wfGetDB() like everywhere else.
Modified paths:
  • /trunk/extensions/CategoryWatch/CategoryWatch.php (modified) (history)
  • /trunk/extensions/EmailPage/EmailPage_body.php (modified) (history)
  • /trunk/extensions/PdfBook/PdfBook.php (modified) (history)
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)
  • /trunk/extensions/Wikidata/Database+scripts/Convenience/Create+wikidata.php (modified) (history)
  • /trunk/extensions/Wikidata/Database+scripts/Convenience/RecreateIndexes.php (modified) (history)
  • /trunk/extensions/Wikidata/Database+scripts/Convenience/addcollection.php (modified) (history)
  • /trunk/extensions/Wikidata/Database+scripts/Incremental/23+-+Bootstrap+class+attribute+meanings.php (modified) (history)
  • /trunk/extensions/Wikidata/Database+scripts/Incremental/ReadPatch.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Alert.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/NeedsTranslationTo.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Search.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialAddCollection.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialDatasearch.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialImportLangNames.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialNeedsTranslation.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/languages.php (modified) (history)
  • /trunk/extensions/Wikidata/SpecialLanguages.php (modified) (history)
  • /trunk/extensions/Wikidata/php-tools/DataImport.php (modified) (history)
  • /trunk/extensions/Wikidata/php-tools/UMLSImport.php (modified) (history)
  • /trunk/extensions/Wikidata/php-tools/UMLSMainImport.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryWatch/CategoryWatch.php
@@ -44,7 +44,7 @@
4545 */
4646 function onArticleSave(&$article, &$user, &$text) {
4747 $this->before = array();
48 - $dbr = &wfGetDB(DB_SLAVE);
 48+ $dbr = wfGetDB(DB_SLAVE);
4949 $cl = $dbr->tableName('categorylinks');
5050 $id = $article->getID();
5151 $res = $dbr->select($cl, 'cl_to', "cl_from = $id", __METHOD__, array('ORDER BY' => 'cl_sortkey'));
@@ -60,7 +60,7 @@
6161
6262 # Get cats after update
6363 $this->after = array();
64 - $dbr = &wfGetDB(DB_SLAVE);
 64+ $dbr = wfGetDB(DB_SLAVE);
6565 $cl = $dbr->tableName('categorylinks');
6666 $id = $article->getID();
6767 $res = $dbr->select($cl, 'cl_to', "cl_from = $id", __METHOD__, array('ORDER BY' => 'cl_sortkey'));
Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -58,7 +58,7 @@
5959
6060 # Get titles in 'recordadmin-category' (default: Category:Records) and build option list
6161 $options = '';
62 - $dbr = &wfGetDB( DB_SLAVE );
 62+ $dbr = wfGetDB( DB_SLAVE );
6363 $cl = $dbr->tableName( 'categorylinks' );
6464 $cat = $dbr->addQuotes( wfMsgForContent( 'recordadmin-category' ) );
6565 $res = $dbr->select( $cl, 'cl_from', "cl_to = $cat", __METHOD__, array( 'ORDER BY' => 'cl_sortkey' ) );
@@ -187,7 +187,7 @@
188188 */
189189 function getRecords($type, $posted, $wpTitle = '', $invert = false, $orderby = 'created desc') {
190190 $records = array();
191 - $dbr = &wfGetDB( DB_SLAVE );
 191+ $dbr = wfGetDB( DB_SLAVE );
192192 $tbl = $dbr->tableName( 'templatelinks' );
193193 $ty = $dbr->addQuotes( $type );
194194 $res = $dbr->select( $tbl, 'tl_from', "tl_namespace = 10 AND tl_title = $ty", __METHOD__ );
Index: trunk/extensions/PdfBook/PdfBook.php
@@ -83,7 +83,7 @@
8484 else {
8585 $articles = array();
8686 if ($title->getNamespace() == NS_CATEGORY) {
87 - $db = &wfGetDB(DB_SLAVE);
 87+ $db = wfGetDB(DB_SLAVE);
8888 $cat = $db->addQuotes($title->getDBkey());
8989 $result = $db->select(
9090 'categorylinks',
Index: trunk/extensions/Wikidata/php-tools/UMLSMainImport.php
@@ -19,7 +19,7 @@
2020 $beginTime, $wgCommandLineMode, $wgUser, $numberOfBytes, $wdDefaultViewDataSet;
2121
2222 function getUserId($real_name){
23 - $dbr = &wfGetDB(DB_SLAVE);
 23+ $dbr = wfGetDB(DB_SLAVE);
2424 $queryResult = $dbr->query( "SELECT user_id FROM user where user_real_name = '$real_name'" );
2525 if ( $row = $dbr->fetchObject( $queryResult ) ){
2626 return( $row->user_id );
Index: trunk/extensions/Wikidata/php-tools/DataImport.php
@@ -21,7 +21,7 @@
2222 $beginTime, $wgCommandLineMode, $wgUser, $numberOfBytes, $wdDefaultViewDataSet;
2323
2424 function getUserId($real_name){
25 - $dbr = &wfGetDB(DB_SLAVE);
 25+ $dbr = wfGetDB(DB_SLAVE);
2626 $queryResult = $dbr->query( "SELECT user_id FROM user where user_real_name = '$real_name'" );
2727 if ( $row = $dbr->fetchObject( $queryResult ) ){
2828 return( $row->user_id );
Index: trunk/extensions/Wikidata/php-tools/UMLSImport.php
@@ -107,7 +107,7 @@
108108 }
109109
110110 function loadIsoLanguages(){
111 - $dbr = &wfGetDB(DB_SLAVE);
 111+ $dbr = wfGetDB(DB_SLAVE);
112112 $sql = "select language_id, iso639_2 from language";
113113
114114 $languages = array();
Index: trunk/extensions/Wikidata/SpecialLanguages.php
@@ -46,7 +46,7 @@
4747 if(!$action) {
4848 $wgOut->addWikiText(wfMsg('langman_header'));
4949 } else {
50 - $dbr=&wfGetDB(DB_MASTER);
 50+ $dbr=wfGetDB(DB_MASTER);
5151 $langname=$wgRequest->getText('langname');
5252 $langiso6393=$wgRequest->getText('langiso6393');
5353 $langiso6392=$wgRequest->getText('langiso6392');
Index: trunk/extensions/Wikidata/Database scripts/Incremental/23 - Bootstrap class attribute meanings.php
@@ -25,7 +25,7 @@
2626 $annotationMeaningName;
2727
2828 function getUserId( $userName ){
29 - $dbr = &wfGetDB(DB_SLAVE);
 29+ $dbr = wfGetDB(DB_SLAVE);
3030 $result = $dbr->query( "select user_id from user where user_name = '$userName'" );
3131 if ( $row = $dbr->fetchObject( $result ) ){
3232 return $row->user_id;
Index: trunk/extensions/Wikidata/Database scripts/Incremental/ReadPatch.php
@@ -77,7 +77,7 @@
7878 }
7979
8080 function getUserId( $userName ){
81 - $dbr = &wfGetDB(DB_SLAVE);
 81+ $dbr = wfGetDB(DB_SLAVE);
8282 $result = $dbr->query( "select user_id from user where user_name = '$userName'" );
8383 if ( $row = $dbr->fetchObject( $result ) ){
8484 return $row->user_id;
@@ -174,4 +174,4 @@
175175 $wdDatabase->close();
176176
177177
178 -?>
\ No newline at end of file
 178+?>
Index: trunk/extensions/Wikidata/Database scripts/Convenience/RecreateIndexes.php
@@ -34,7 +34,7 @@
3535 */
3636 function retrieve_datasets(){
3737 $prefixes = array();
38 - $dbr = &wfGetDB(DB_SLAVE);
 38+ $dbr = wfGetDB(DB_SLAVE);
3939 $queryResult = $dbr->query("select set_prefix from wikidata_sets");
4040 while ($datasetRecord = $dbr->fetchObject($queryResult) ) {
4141 array_push( $prefixes, $datasetRecord->set_prefix );
Index: trunk/extensions/Wikidata/Database scripts/Convenience/Create wikidata.php
@@ -75,7 +75,7 @@
7676 }
7777
7878 function getUserId( $userName ){
79 - $dbr = &wfGetDB(DB_SLAVE);
 79+ $dbr = wfGetDB(DB_SLAVE);
8080 $result = $dbr->query( "select user_id from user where user_name = '$userName'" );
8181 if ( $row = $dbr->fetchObject( $result ) ){
8282 return $row->user_id;
Index: trunk/extensions/Wikidata/Database scripts/Convenience/addcollection.php
@@ -7,7 +7,7 @@
88
99 function getDatasets(){
1010 $datasets = array();
11 - $dbr = &wfGetDB(DB_SLAVE);
 11+ $dbr = wfGetDB(DB_SLAVE);
1212 $result = $dbr->query( "select set_prefix from wikidata_sets" );
1313 while ($record = $dbr->fetchObject($result)) {
1414 array_push( $datasets, $record->set_prefix );
@@ -32,7 +32,7 @@
3333 }
3434
3535 function getUserId( $userName ){
36 - $dbr = &wfGetDB(DB_SLAVE);
 36+ $dbr = wfGetDB(DB_SLAVE);
3737 $result = $dbr->query( "select user_id from user where user_name = '$userName'" );
3838 if ( $row = $dbr->fetchObject( $result ) ){
3939 return $row->user_id;
@@ -51,7 +51,7 @@
5252 setUser( $userId );
5353 $datasets = getDatasets();
5454
55 -$dbr = &wfGetDB(DB_SLAVE);
 55+$dbr = wfGetDB(DB_SLAVE);
5656 foreach( $datasets as $dataset ){
5757 foreach( $datasets as $otherdataset ){
5858 if ( $dataset != $otherdataset ){
@@ -62,4 +62,4 @@
6363 }
6464 }
6565 }
66 -?>
\ No newline at end of file
 66+?>
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialDatasearch.php
@@ -172,7 +172,7 @@
173173 }
174174
175175 function getSpellingRestriction($spelling, $tableColumn) {
176 - $dbr = &wfGetDB(DB_SLAVE);
 176+ $dbr = wfGetDB(DB_SLAVE);
177177
178178 if (trim($spelling) != '')
179179 return " AND " . $tableColumn . " LIKE " . $dbr->addQuotes("%$spelling%");
@@ -188,7 +188,7 @@
189189 }
190190
191191 function getPositionSelectColumn($spelling, $tableColumn) {
192 - $dbr = &wfGetDB(DB_SLAVE);
 192+ $dbr = wfGetDB(DB_SLAVE);
193193
194194 if (trim($spelling) != '')
195195 return "INSTR(LCASE(" . $tableColumn . "), LCASE(". $dbr->addQuotes("$spelling") .")) as position, ";
@@ -198,7 +198,7 @@
199199
200200 function searchWords($text, $collectionId, $languageId) {
201201 $dc=wdGetDataSetContext();
202 - $dbr = &wfGetDB(DB_SLAVE);
 202+ $dbr = wfGetDB(DB_SLAVE);
203203
204204 $sql =
205205 "SELECT ". $this->getPositionSelectColumn($text, "{$dc}_expression.spelling") ." {$dc}_syntrans.defined_meaning_id AS defined_meaning_id, {$dc}_expression.spelling AS spelling, {$dc}_expression.language_id AS language_id ".
@@ -274,7 +274,7 @@
275275
276276 function searchExternalIdentifiers($text, $collectionId) {
277277 $dc=wdGetDataSetContext();
278 - $dbr = &wfGetDB(DB_SLAVE);
 278+ $dbr = wfGetDB(DB_SLAVE);
279279
280280 $sql =
281281 "SELECT ". $this->getPositionSelectColumn($text, "{$dc}_collection_contents.internal_member_id") ." {$dc}_collection_contents.member_mid AS member_mid, {$dc}_collection_contents.internal_member_id AS external_identifier, {$dc}_collection.collection_mid AS collection_mid ".
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialImportLangNames.php
@@ -30,7 +30,7 @@
3131 return false;
3232 }
3333
34 - $dbr = &wfGetDB(DB_MASTER);
 34+ $dbr = wfGetDB(DB_MASTER);
3535
3636 /* Get collection ID for "ISO 639-3 codes" collection. */
3737 $sql = "SELECT collection_id FROM {$dc}_collection" .
@@ -115,7 +115,7 @@
116116
117117 /* XXX: This is probably NOT the proper way to do this. It should be refactored. */
118118 function addDMsListToPage($content,$page) {
119 - $dbr = &wfGetDB(DB_MASTER);
 119+ $dbr = wfGetDB(DB_MASTER);
120120
121121 /* Get ID of the page we want to put the list on. */
122122 $sql = 'SELECT page_id FROM page' .
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialAddCollection.php
@@ -29,7 +29,7 @@
3030 return false;
3131 }
3232
33 - $dbr = &wfGetDB(DB_MASTER);
 33+ $dbr = wfGetDB(DB_MASTER);
3434
3535 if ($wgRequest->getText('collection')) {
3636 require_once('WikiDataAPI.php');
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialNeedsTranslation.php
@@ -55,7 +55,7 @@
5656 require_once("Editor.php");
5757 require_once("WikiDataAPI.php");
5858
59 - $dbr = &wfGetDB(DB_SLAVE);
 59+ $dbr = wfGetDB(DB_SLAVE);
6060
6161 $sql = 'SELECT source_expression.expression_id AS source_expression_id, source_expression.language_id AS source_language_id, source_expression.spelling AS source_spelling, source_syntrans.defined_meaning_id AS source_defined_meaning_id' .
6262 " FROM ({$dc}_syntrans source_syntrans, {$dc}_expression source_expression)";
Index: trunk/extensions/Wikidata/OmegaWiki/NeedsTranslationTo.php
@@ -53,7 +53,7 @@
5454 $dc=wdGetDataSetContext();
5555 $o=OmegaWikiAttributes::getInstance();
5656
57 - $dbr = &wfGetDB(DB_SLAVE);
 57+ $dbr = wfGetDB(DB_SLAVE);
5858 $queryResult = $dbr->query("SELECT source_expression.expression_id AS source_expression_id, source_expression.language_id AS source_language_id, source_expression.spelling AS source_spelling, source_syntrans.defined_meaning_id AS source_defined_meaning_id" .
5959 " FROM {$dc}_syntrans source_syntrans, {$dc}_expression source_expression" .
6060 " WHERE source_syntrans.expression_id=source_expression.expression_id AND source_expression.language_id=$sourceLanguageId" .
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php
@@ -445,7 +445,7 @@
446446 $recordSet = new ArrayRecordSet($o->translatedContentHistoryStructure, $o->translatedContentHistoryKeyStructure);
447447
448448 if ($isLatest) {
449 - $dbr = &wfGetDB(DB_SLAVE);
 449+ $dbr = wfGetDB(DB_SLAVE);
450450 $queryResult = $dbr->query(
451451 "SELECT text_text, add_transaction_id, remove_transaction_id " .
452452 " FROM {$dc}_translated_content, {$dc}_text" .
@@ -488,7 +488,7 @@
489489
490490 $dc=wdGetDataSetContext();
491491
492 - $dbr = &wfGetDB(DB_SLAVE);
 492+ $dbr = wfGetDB(DB_SLAVE);
493493 $queryResult = $dbr->query(
494494 "SELECT defined_meaning_id, translated_content_id, language_id, text_text, " .
495495 getOperationSelectColumn("{$dc}_translated_content", $transactionId) . ', ' .
@@ -523,7 +523,7 @@
524524 $o=OmegaWikiAttributes::getInstance();
525525
526526 $dc=wdGetDataSetContext();
527 - $dbr = &wfGetDB(DB_SLAVE);
 527+ $dbr = wfGetDB(DB_SLAVE);
528528 $queryResult = $dbr->query(
529529 "SELECT meaning_mid, meaning_text_tcid, source_id, " .
530530 getOperationSelectColumn("{$dc}_alt_meaningtexts", $transactionId) . ', ' .
@@ -561,7 +561,7 @@
562562 $o=OmegaWikiAttributes::getInstance();
563563
564564 $dc=wdGetDataSetContext();
565 - $dbr = &wfGetDB(DB_SLAVE);
 565+ $dbr = wfGetDB(DB_SLAVE);
566566 $queryResult = $dbr->query(
567567 "SELECT meaning_mid, translated_content_id, source_id, language_id, text_text, " .
568568 getOperationSelectColumn("{$dc}_translated_content", $transactionId) . ', ' .
@@ -599,7 +599,7 @@
600600 $o=OmegaWikiAttributes::getInstance();
601601 $dc=wdGetDataSetContext($dc);
602602
603 - $dbr = &wfGetDB(DB_SLAVE);
 603+ $dbr = wfGetDB(DB_SLAVE);
604604 $queryResult = $dbr->query(
605605 "SELECT syntrans_sid, defined_meaning_id, {$dc}_syntrans.expression_id, language_id, spelling, identical_meaning, " .
606606 getOperationSelectColumn("{$dc}_syntrans", $transactionId) . ', ' .
@@ -659,7 +659,7 @@
660660
661661 $dc=wdGetDataSetContext();
662662
663 - $dbr = &wfGetDB(DB_SLAVE);
 663+ $dbr = wfGetDB(DB_SLAVE);
664664 $queryResult = $dbr->query(
665665 "SELECT relation_id, meaning1_mid, meaning2_mid, relationtype_mid, " .
666666 getOperationSelectColumn("{$dc}_meaning_relations", $transactionId) . ', ' .
@@ -692,7 +692,7 @@
693693
694694 $dc=wdGetDataSetContext();
695695
696 - $dbr = &wfGetDB(DB_SLAVE);
 696+ $dbr = wfGetDB(DB_SLAVE);
697697 $queryResult = $dbr->query(
698698 "SELECT class_membership_id, class_mid, class_member_mid, " .
699699 getOperationSelectColumn("{$dc}_class_membership", $transactionId) . ', ' .
@@ -723,7 +723,7 @@
724724 $o=OmegaWikiAttributes::getInstance();
725725
726726 $dc=wdGetDataSetContext();
727 - $dbr = &wfGetDB(DB_SLAVE);
 727+ $dbr = wfGetDB(DB_SLAVE);
728728 $queryResult = $dbr->query(
729729 "SELECT {$dc}_collection_contents.collection_id, collection_mid, member_mid, internal_member_id, " .
730730 getOperationSelectColumn("{$dc}_collection_contents", $transactionId) . ', ' .
@@ -758,7 +758,7 @@
759759 $o=OmegaWikiAttributes::getInstance();
760760
761761 $dc=wdGetDataSetContext();
762 - $dbr = &wfGetDB(DB_SLAVE);
 762+ $dbr = wfGetDB(DB_SLAVE);
763763 $queryResult = $dbr->query(
764764 "SELECT object_id, class_mid, level_mid, attribute_mid, attribute_type, " .
765765 getOperationSelectColumn("{$dc}_class_attributes", $transactionId) . ', ' .
@@ -802,7 +802,7 @@
803803 $o=OmegaWikiAttributes::getInstance();
804804
805805 $dc=wdGetDataSetContext();
806 - $dbr = &wfGetDB(DB_SLAVE);
 806+ $dbr = wfGetDB(DB_SLAVE);
807807 $queryResult = $dbr->query(
808808 "SELECT value_id, object_id, attribute_mid, url, label, " .
809809 getOperationSelectColumn("{$dc}_url_attribute_values", $transactionId) . ', ' .
@@ -834,7 +834,7 @@
835835 $o=OmegaWikiAttributes::getInstance();
836836
837837 $dc=wdGetDataSetContext();
838 - $dbr = &wfGetDB(DB_SLAVE);
 838+ $dbr = wfGetDB(DB_SLAVE);
839839 $queryResult = $dbr->query(
840840 "SELECT value_id, object_id, attribute_mid, text, " .
841841 getOperationSelectColumn("{$dc}_text_attribute_values", $transactionId) . ', ' .
@@ -866,7 +866,7 @@
867867 $o=OmegaWikiAttributes::getInstance();
868868
869869 $dc=wdGetDataSetContext();
870 - $dbr = &wfGetDB(DB_SLAVE);
 870+ $dbr = wfGetDB(DB_SLAVE);
871871 $queryResult = $dbr->query(
872872 "SELECT value_id, object_id, attribute_mid, value_tcid, " .
873873 getOperationSelectColumn("{$dc}_translated_content_attribute_values", $transactionId) . ', ' .
@@ -902,7 +902,7 @@
903903 $o=OmegaWikiAttributes::getInstance();
904904
905905 $dc=wdGetDataSetContext();
906 - $dbr = &wfGetDB(DB_SLAVE);
 906+ $dbr = wfGetDB(DB_SLAVE);
907907 $queryResult = $dbr->query(
908908 "SELECT value_id, object_id, attribute_mid, translated_content_id, language_id, text_text, " .
909909 getOperationSelectColumn("{$dc}_translated_content", $transactionId) . ', ' .
@@ -1377,7 +1377,7 @@
13781378 function getTranslatedContentFromHistory($translatedContentId, $languageId, $addTransactionId) {
13791379
13801380 $dc=wdGetDataSetContext();
1381 - $dbr = &wfGetDB(DB_SLAVE);
 1381+ $dbr = wfGetDB(DB_SLAVE);
13821382 $queryResult = $dbr->query(
13831383 "SELECT text_text " .
13841384 " FROM {$dc}_translated_content, {$dc}_text " .
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php
@@ -79,7 +79,7 @@
8080 function newObjectId($table) {
8181 $dc=wdGetDataSetContext();
8282
83 - $dbr = &wfGetDB(DB_MASTER);
 83+ $dbr = wfGetDB(DB_MASTER);
8484 $dbr->query("INSERT INTO {$dc}_objects (`table`, `UUID`) VALUES (". $dbr->addQuotes($table) . ", UUID())");
8585
8686 return $dbr->insertId();
@@ -88,7 +88,7 @@
8989 function getTableNameWithObjectId($objectId) {
9090 $dc=wdGetDataSetContext();
9191
92 - $dbr = &wfGetDB(DB_SLAVE);
 92+ $dbr = wfGetDB(DB_SLAVE);
9393 $queryResult = $dbr->query(
9494 "SELECT `table`" .
9595 " FROM {$dc}_objects" .
@@ -105,7 +105,7 @@
106106
107107 $dc=wdGetDataSetContext();
108108
109 - $dbr = &wfGetDB(DB_SLAVE);
 109+ $dbr = wfGetDB(DB_SLAVE);
110110 $sql = "SELECT expression_id FROM {$dc}_expression " .
111111 'WHERE spelling=binary '. $dbr->addQuotes($spelling) . ' AND language_id=' . $languageId .
112112 ' AND '. getLatestTransactionRestriction("{$dc}_expression");
@@ -120,7 +120,7 @@
121121
122122 $expressionId = newObjectId("{$dc}_expression");
123123
124 - $dbr = &wfGetDB(DB_MASTER);
 124+ $dbr = wfGetDB(DB_MASTER);
125125 $spelling = $dbr->addQuotes($spelling);
126126
127127 $dbr->query("INSERT INTO {$dc}_expression(expression_id, spelling, language_id, add_transaction_id) values($expressionId, $spelling, $languageId, ". getUpdateTransactionId() .")");
@@ -134,7 +134,7 @@
135135
136136
137137 function createPage($namespace, $title) {
138 - $dbr = &wfGetDB(DB_MASTER);
 138+ $dbr = wfGetDB(DB_MASTER);
139139 $title = $dbr->addQuotes($title);
140140 $timestamp = $dbr->timestamp();
141141 $sql = "select page_id from page where page_namespace = $namespace and page_title = $title";
@@ -152,7 +152,7 @@
153153 }
154154
155155 function setPageLatestRevision($pageId, $latestRevision) {
156 - $dbr = &wfGetDB(DB_MASTER);
 156+ $dbr = wfGetDB(DB_MASTER);
157157 $sql = "update page set page_latest=$latestRevision where page_id=$pageId";
158158 $dbr->query($sql);
159159 }
@@ -160,7 +160,7 @@
161161 global
162162 $wgUser;
163163
164 - $dbr = &wfGetDB(DB_MASTER);
 164+ $dbr = wfGetDB(DB_MASTER);
165165 $userId = $wgUser->getID();
166166 $userName = $dbr->addQuotes($wgUser->getName());
167167 $comment = $dbr->addQuotes($comment);
@@ -221,7 +221,7 @@
222222 if ($synonymId == 0)
223223 $synonymId = newObjectId("{$dc}_syntrans");
224224
225 - $dbr = &wfGetDB(DB_MASTER);
 225+ $dbr = wfGetDB(DB_MASTER);
226226 $identicalMeaningInteger = (int) $identicalMeaning;
227227 $sql = "insert into {$dc}_syntrans(syntrans_sid, defined_meaning_id, expression_id, identical_meaning, add_transaction_id) ".
228228 "values($synonymId, $definedMeaningId, $expressionId, $identicalMeaningInteger, ". getUpdateTransactionId() .")";
@@ -233,7 +233,7 @@
234234 $dataSet;
235235
236236 $dc=wdGetDataSetContext();
237 - $dbr = &wfGetDB(DB_SLAVE);
 237+ $dbr = wfGetDB(DB_SLAVE);
238238
239239 $queryResult = $dbr->query(
240240 selectLatest(
@@ -255,7 +255,7 @@
256256 }
257257
258258 function getMaximum($field, $table) {
259 - $dbr = &wfGetDB(DB_SLAVE);
 259+ $dbr = wfGetDB(DB_SLAVE);
260260 $sql = "select max($field) as maximum from $table";
261261 $queryResult = $dbr->query($sql);
262262
@@ -551,7 +551,7 @@
552552
553553 function createText($text) {
554554 $dc=wdGetDataSetContext();
555 - $dbr = &wfGetDB(DB_MASTER);
 555+ $dbr = wfGetDB(DB_MASTER);
556556 $text = $dbr->addQuotes($text);
557557 $sql = "insert into {$dc}_text(text_text) values($text)";
558558 $dbr->query($sql);
@@ -562,7 +562,7 @@
563563 function createTranslatedContent($translatedContentId, $languageId, $textId) {
564564 $dc=wdGetDataSetContext();
565565
566 - $dbr = &wfGetDB(DB_MASTER);
 566+ $dbr = wfGetDB(DB_MASTER);
567567 $sql = "insert into {$dc}_translated_content(translated_content_id,language_id,text_id,add_transaction_id) values($translatedContentId, $languageId, $textId, ". getUpdateTransactionId() .")";
568568 $dbr->query($sql);
569569
@@ -577,7 +577,7 @@
578578 if (is_null($languageId))
579579 throw new Exception("languageId is null");
580580
581 - $dbr = &wfGetDB(DB_SLAVE);
 581+ $dbr = wfGetDB(DB_SLAVE);
582582 $queryResult = $dbr->query(
583583 "SELECT translated_content_id" .
584584 " FROM {$dc}_translated_content" .
@@ -601,7 +601,7 @@
602602
603603 function getDefinedMeaningDefinitionId($definedMeaningId) {
604604 $dc=wdGetDataSetContext();
605 - $dbr = &wfGetDB(DB_SLAVE);
 605+ $dbr = wfGetDB(DB_SLAVE);
606606 $queryResult = $dbr->query("SELECT meaning_text_tcid FROM {$dc}_defined_meaning WHERE defined_meaning_id=$definedMeaningId " .
607607 " AND " . getLatestTransactionRestriction("{$dc}_defined_meaning"));
608608
@@ -609,7 +609,7 @@
610610 }
611611
612612 function updateDefinedMeaningDefinitionId($definedMeaningId, $definitionId) {
613 - $dbr = &wfGetDB(DB_MASTER);
 613+ $dbr = wfGetDB(DB_MASTER);
614614 $dc=wdGetDataSetContext();
615615 $dbr->query("UPDATE {$dc}_defined_meaning SET meaning_text_tcid=$definitionId WHERE defined_meaning_id=$definedMeaningId" .
616616 " AND " . getLatestTransactionRestriction("{$dc}_defined_meaning"));
@@ -637,7 +637,7 @@
638638
639639 function createDefinedMeaningAlternativeDefinition($definedMeaningId, $translatedContentId, $sourceMeaningId) {
640640 $dc=wdGetDataSetContext();
641 - $dbr = &wfGetDB(DB_MASTER);
 641+ $dbr = wfGetDB(DB_MASTER);
642642 $dbr->query("INSERT INTO {$dc}_alt_meaningtexts (meaning_mid, meaning_text_tcid, source_id, add_transaction_id) " .
643643 "VALUES ($definedMeaningId, $translatedContentId, $sourceMeaningId, " . getUpdateTransactionId() . ")");
644644 }
@@ -651,14 +651,14 @@
652652
653653 function removeTranslatedText($translatedContentId, $languageId) {
654654 $dc=wdGetDataSetContext();
655 - $dbr = &wfGetDB(DB_MASTER);
 655+ $dbr = wfGetDB(DB_MASTER);
656656 $dbr->query("UPDATE {$dc}_translated_content SET remove_transaction_id=". getUpdateTransactionId() .
657657 " WHERE translated_content_id=$translatedContentId AND language_id=$languageId AND remove_transaction_id IS NULL");
658658 }
659659
660660 function removeTranslatedTexts($translatedContentId) {
661661 $dc=wdGetDataSetContext();
662 - $dbr = &wfGetDB(DB_MASTER);
 662+ $dbr = wfGetDB(DB_MASTER);
663663 $dbr->query("UPDATE {$dc}_translated_content SET remove_transaction_id=". getUpdateTransactionId() .
664664 " WHERE translated_content_id=$translatedContentId AND remove_transaction_id IS NULL");
665665 }
@@ -672,7 +672,7 @@
673673 // removeTranslatedTexts($definitionId);
674674
675675 $dc=wdGetDataSetContext();
676 - $dbr = &wfGetDB(DB_MASTER);
 676+ $dbr = wfGetDB(DB_MASTER);
677677 $dbr->query("UPDATE {$dc}_alt_meaningtexts SET remove_transaction_id=" . getUpdateTransactionId() .
678678 " WHERE meaning_text_tcid=$definitionId AND meaning_mid=$definedMeaningId" .
679679 " AND remove_transaction_id IS NULL");
@@ -687,7 +687,7 @@
688688
689689 function definedMeaningInCollection($definedMeaningId, $collectionId) {
690690 $dc=wdGetDataSetContext();
691 - $dbr = &wfGetDB(DB_SLAVE);
 691+ $dbr = wfGetDB(DB_SLAVE);
692692 $queryResult = $dbr->query("SELECT collection_id FROM {$dc}_collection_contents WHERE collection_id=$collectionId AND member_mid=$definedMeaningId " .
693693 "AND ". getLatestTransactionRestriction("{$dc}_collection_contents"));
694694
@@ -696,7 +696,7 @@
697697
698698 function addDefinedMeaningToCollection($definedMeaningId, $collectionId, $internalId) {
699699 $dc=wdGetDataSetContext();
700 - $dbr = &wfGetDB(DB_MASTER);
 700+ $dbr = wfGetDB(DB_MASTER);
701701 $dbr->query("INSERT INTO {$dc}_collection_contents(collection_id, member_mid, internal_member_id, add_transaction_id) " .
702702 "VALUES ($collectionId, $definedMeaningId, ". $dbr->addQuotes($internalId) .", ". getUpdateTransactionId() .")");
703703 }
@@ -708,7 +708,7 @@
709709
710710 function getDefinedMeaningFromCollection($collectionId, $internalMemberId) {
711711 $dc=wdGetDataSetContext();
712 - $dbr = &wfGetDB(DB_SLAVE);
 712+ $dbr = wfGetDB(DB_SLAVE);
713713 $query = "SELECT member_mid FROM {$dc}_collection_contents WHERE collection_id=$collectionId AND internal_member_id=". $dbr->addQuotes($internalMemberId) . " AND " .getLatestTransactionRestriction("{$dc}_collection_contents");
714714 $queryResult = $dbr->query( $query );
715715
@@ -720,7 +720,7 @@
721721
722722 function removeDefinedMeaningFromCollection($definedMeaningId, $collectionId) {
723723 $dc=wdGetDataSetContext();
724 - $dbr = &wfGetDB(DB_MASTER);
 724+ $dbr = wfGetDB(DB_MASTER);
725725 $dbr->query("UPDATE {$dc}_collection_contents SET remove_transaction_id=" . getUpdateTransactionId() .
726726 " WHERE collection_id=$collectionId AND member_mid=$definedMeaningId AND remove_transaction_id IS NULL");
727727 }
@@ -760,7 +760,7 @@
761761 $dc=wdGetDataSetContext();
762762 $collectionId = newObjectId("{$dc}_collection");
763763
764 - $dbr = &wfGetDB(DB_MASTER);
 764+ $dbr = wfGetDB(DB_MASTER);
765765 $dbr->query("INSERT INTO {$dc}_collection(collection_id, collection_mid, collection_type, add_transaction_id)" .
766766 " VALUES($collectionId, $definedMeaningId, '$collectionType', ". getUpdateTransactionId() .")");
767767
@@ -774,7 +774,7 @@
775775 $definedMeaningId = newObjectId("{$dc}_defined_meaning");
776776
777777 //wfDebug( "addDefinedMeaning(): $definedMeaningId has to be inserted to the database $dc" );
778 - $dbr = &wfGetDB(DB_MASTER);
 778+ $dbr = wfGetDB(DB_MASTER);
779779 $dbr->query("INSERT INTO {$dc}_defined_meaning(defined_meaning_id, expression_id, add_transaction_id) values($definedMeaningId, $definingExpressionId, ". getUpdateTransactionId() .")");
780780
781781 //wfDebug( "addDefinedMeaning(): after $definedMeaningId has been inserted in the database" );
@@ -804,7 +804,7 @@
805805
806806 function createTextAttributeValue($textValueAttributeId, $objectId, $textAttributeId, $text) {
807807 $dc=wdGetDataSetContext();
808 - $dbr = &wfGetDB(DB_MASTER);
 808+ $dbr = wfGetDB(DB_MASTER);
809809 $dbr->query(
810810 "INSERT INTO {$dc}_text_attribute_values (value_id, object_id, attribute_mid, text, add_transaction_id) " .
811811 "VALUES ($textValueAttributeId, $objectId, $textAttributeId, " . $dbr->addQuotes($text) . ", ". getUpdateTransactionId() .")"
@@ -813,7 +813,7 @@
814814
815815 function removeTextAttributeValue($textValueAttributeId) {
816816 $dc=wdGetDataSetContext();
817 - $dbr = &wfGetDB(DB_MASTER);
 817+ $dbr = wfGetDB(DB_MASTER);
818818 $dbr->query("UPDATE {$dc}_text_attribute_values SET remove_transaction_id=". getUpdateTransactionId() .
819819 " WHERE value_id=$textValueAttributeId" .
820820 " AND remove_transaction_id IS NULL");
@@ -827,7 +827,7 @@
828828
829829 function getTextValueAttribute($textValueAttributeId) {
830830 $dc=wdGetDataSetContext();
831 - $dbr = &wfGetDB(DB_SLAVE);
 831+ $dbr = wfGetDB(DB_SLAVE);
832832 $queryResult = $dbr->query(
833833 "SELECT object_id, attribute_mid, text" .
834834 " FROM {$dc}_text_attribute_values" .
@@ -846,7 +846,7 @@
847847
848848 function createLinkAttributeValue($linkValueAttributeId, $objectId, $linkAttributeId, $url, $label = "") {
849849 $dc=wdGetDataSetContext();
850 - $dbr = &wfGetDB(DB_MASTER);
 850+ $dbr = wfGetDB(DB_MASTER);
851851 $dbr->query(
852852 "INSERT INTO {$dc}_url_attribute_values (value_id, object_id, attribute_mid, url, label, add_transaction_id) " .
853853 "VALUES ($linkValueAttributeId, $objectId, $linkAttributeId, " . $dbr->addQuotes($url) . ", " . $dbr->addQuotes($label) . ", ". getUpdateTransactionId() .")"
@@ -855,7 +855,7 @@
856856
857857 function removeLinkAttributeValue($linkValueAttributeId) {
858858 $dc=wdGetDataSetContext();
859 - $dbr = &wfGetDB(DB_MASTER);
 859+ $dbr = wfGetDB(DB_MASTER);
860860 $dbr->query(
861861 "UPDATE {$dc}_url_attribute_values SET remove_transaction_id=". getUpdateTransactionId() .
862862 " WHERE value_id=$linkValueAttributeId" .
@@ -871,7 +871,7 @@
872872
873873 function getLinkValueAttribute($linkValueAttributeId) {
874874 $dc=wdGetDataSetContext();
875 - $dbr = &wfGetDB(DB_SLAVE);
 875+ $dbr = wfGetDB(DB_SLAVE);
876876 $queryResult = $dbr->query(
877877 "SELECT object_id, attribute_mid, url" .
878878 " FROM {$dc}_url_attribute_values WHERE value_id=$linkValueAttributeId " .
@@ -883,7 +883,7 @@
884884
885885 function createTranslatedTextAttributeValue($valueId, $objectId, $attributeId, $translatedContentId) {
886886 $dc=wdGetDataSetContext();
887 - $dbr = &wfGetDB(DB_MASTER);
 887+ $dbr = wfGetDB(DB_MASTER);
888888 $dbr->query("INSERT INTO {$dc}_translated_content_attribute_values (value_id, object_id, attribute_mid, value_tcid, add_transaction_id) " .
889889 "VALUES ($valueId, $objectId, $attributeId, $translatedContentId, ". getUpdateTransactionId() .")");
890890 }
@@ -899,7 +899,7 @@
900900
901901 function getTranslatedTextAttribute($valueId) {
902902 $dc=wdGetDataSetContext();
903 - $dbr = &wfGetDB(DB_SLAVE);
 903+ $dbr = wfGetDB(DB_SLAVE);
904904 $queryResult = $dbr->query("SELECT value_id, object_id, attribute_mid, value_tcid FROM {$dc}_translated_content_attribute_values WHERE value_id=$valueId " .
905905 " AND " . getLatestTransactionRestriction("{$dc}_translated_content_attribute_values"));
906906
@@ -917,7 +917,7 @@
918918 // back easier.
919919 // removeTranslatedTexts($translatedTextAttribute->value_tcid);
920920
921 - $dbr = &wfGetDB(DB_MASTER);
 921+ $dbr = wfGetDB(DB_MASTER);
922922 $dbr->query(
923923 "UPDATE {$dc}_translated_content_attribute_values" .
924924 " SET remove_transaction_id=". getUpdateTransactionId() .
@@ -1284,7 +1284,7 @@
12851285 }
12861286
12871287 function getMapping( $dc, $collid, $dm_id ){
1288 - $dbr = &wfGetDB(DB_SLAVE);
 1288+ $dbr = wfGetDB(DB_SLAVE);
12891289 $queryResult = $dbr->query( "select internal_member_id from {$dc}_collection_contents where collection_id = $collid AND member_mid = $dm_id" );
12901290 if ( $record = $dbr->fetchObject($queryResult) ){
12911291 return $record->internal_member_id;
Index: trunk/extensions/Wikidata/OmegaWiki/Search.php
@@ -25,7 +25,7 @@
2626
2727 function searchText($text) {
2828 $dc=wdGetDataSetContext();
29 - $dbr = &wfGetDB(DB_SLAVE);
 29+ $dbr = wfGetDB(DB_SLAVE);
3030
3131 $sql = "SELECT INSTR(LCASE({$dc}_expression.spelling), LCASE(". $dbr->addQuotes("$text") .")) as position, {$dc}_syntrans.defined_meaning_id AS defined_meaning_id, {$dc}_expression.spelling AS spelling, {$dc}_expression.language_id AS language_id ".
3232 "FROM {$dc}_expression, {$dc}_syntrans ".
Index: trunk/extensions/Wikidata/OmegaWiki/languages.php
@@ -18,7 +18,7 @@
1919 indicated by $code, with fallbacks in English where the language names
2020 aren't present in that language. */
2121 function getLangNames($code) {
22 - $dbr = &wfGetDB(DB_SLAVE);
 22+ $dbr = wfGetDB(DB_SLAVE);
2323 $names = array();
2424 $sql = getSQLForLanguageNames($code);
2525 $lang_res = $dbr->query($sql);
@@ -104,7 +104,7 @@
105105 }
106106
107107 function getLanguageIdForName($name) {
108 - $dbr = &wfGetDB(DB_SLAVE);
 108+ $dbr = wfGetDB(DB_SLAVE);
109109 $queryResult = $dbr->query("SELECT language_id FROM language_names WHERE language_name=".$dbr->addQuotes($name));
110110
111111 if ($languageId = $dbr->fetchObject($queryResult))
Index: trunk/extensions/Wikidata/OmegaWiki/Alert.php
@@ -16,7 +16,7 @@
1717
1818 function getDefinedMeaning( $dc, $textId ){
1919 // translate the text id to a translated text id
20 - $dbr = &wfGetDB(DB_SLAVE);
 20+ $dbr = wfGetDB(DB_SLAVE);
2121 $queryResult = $dbr->query( "select translated_content_id from {$dc}_translated_content where text_id = $textId and remove_transaction_id is NULL" );
2222 if ( $row = $dbr->fetchObject( $queryResult ) ){
2323 $tcid = $row->translated_content_id;
@@ -52,7 +52,7 @@
5353 function getInternalIdentifier( $dc, $definedMeaningId, $languageId ){
5454 $collectionName = "uw";
5555
56 - $dbr = &wfGetDB(DB_SLAVE);
 56+ $dbr = wfGetDB(DB_SLAVE);
5757 $query = "SELECT collection_id, internal_member_id FROM {$dc}_collection_contents where member_mid = $definedMeaningId";
5858 $queryResult = $dbr->query( "SELECT collection_id, internal_member_id FROM {$dc}_collection_contents where member_mid = $definedMeaningId" );
5959 if ( $row = $dbr->fetchObject( $queryResult ) ){
@@ -81,7 +81,7 @@
8282 }
8383
8484 function getTextForId( $dc, $text_id ){
85 - $dbr = &wfGetDB(DB_SLAVE);
 85+ $dbr = wfGetDB(DB_SLAVE);
8686 $textResult = $dbr->query( "select text_text from {$dc}_text where text_id = $text_id" );
8787 if ( $textRecord = $dbr->fetchObject($textResult) ){
8888 return $textRecord->text_text;
@@ -92,7 +92,7 @@
9393 }
9494
9595 function getDefinedMeaningTitle( $dc, $definedMeaningId ){
96 - $dbr = &wfGetDB(DB_SLAVE);
 96+ $dbr = wfGetDB(DB_SLAVE);
9797 $result = $dbr->query( "SELECT meaning_text_tcid FROM {$dc}_defined_meaning where defined_meaning_id = $definedMeaningId" );
9898 if ( $record = $dbr->fetchObject($result) ){
9999 $result = $dbr->query( "SELECT text_id FROM {$dc}_translated_content where translated_content_id = $record->meaning_text_tcid and remove_transaction_id IS NULL" );
@@ -104,7 +104,7 @@
105105 }
106106
107107 function getUser( $user_id ){
108 - $dbr = &wfGetDB(DB_SLAVE);
 108+ $dbr = wfGetDB(DB_SLAVE);
109109 $queryResult = $dbr->query( "SELECT user_name FROM `user` u where user_id = $user_id" );
110110 if ( $row = $dbr->fetchObject( $queryResult ) ){
111111 return $row->user_name;
@@ -150,7 +150,7 @@
151151 $endClause = "";
152152 }
153153
154 -$dbr = &wfGetDB(DB_SLAVE);
 154+$dbr = wfGetDB(DB_SLAVE);
155155
156156 $queryResult = $dbr->query( "select language_id from language where wikimedia_key='en'" );
157157 $languageId = $dbr->fetchObject($queryResult)->language_id;
@@ -191,4 +191,4 @@
192192 }
193193
194194
195 -?>
\ No newline at end of file
 195+?>
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -2262,7 +2262,7 @@
22632263
22642264 protected function resolveRelation($objectId) {
22652265 $dc=wdGetDataSetContext();
2266 - $dbr = &wfGetDB(DB_SLAVE);
 2266+ $dbr = wfGetDB(DB_SLAVE);
22672267 $queryResult = $dbr->query(
22682268 "SELECT meaning1_mid, relationtype_mid, meaning2_mid" .
22692269 " FROM {$dc}_meaning_relations" .
@@ -2279,7 +2279,7 @@
22802280 }
22812281
22822282 protected function resolveAttribute($objectId, $tableName) {
2283 - $dbr = &wfGetDB(DB_SLAVE);
 2283+ $dbr = wfGetDB(DB_SLAVE);
22842284 $queryResult = $dbr->query(
22852285 "SELECT object_id, attribute_mid" .
22862286 " FROM " . $tableName .
@@ -2296,7 +2296,7 @@
22972297
22982298 protected function resolveTranslatedContent($objectId) {
22992299 $dc=wdGetDataSetContext();
2300 - $dbr = &wfGetDB(DB_SLAVE);
 2300+ $dbr = wfGetDB(DB_SLAVE);
23012301 $queryResult = $dbr->query(
23022302 "SELECT defined_meaning_id" .
23032303 " FROM {$dc}_defined_meaning" .
@@ -2312,7 +2312,7 @@
23132313
23142314 protected function resolveSyntrans($objectId) {
23152315 $dc=wdGetDataSetContext();
2316 - $dbr = &wfGetDB(DB_SLAVE);
 2316+ $dbr = wfGetDB(DB_SLAVE);
23172317 $queryResult = $dbr->query(
23182318 "SELECT spelling, defined_meaning_id" .
23192319 " FROM {$dc}_syntrans, {$dc}_expression" .
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -346,7 +346,7 @@
347347
348348 # If processing first category rule, build a list of cats this article belongs to
349349 if (count($cats) == 0) {
350 - $dbr = &wfGetDB(DB_SLAVE);
 350+ $dbr = wfGetDB(DB_SLAVE);
351351 $cl = $dbr->tableName('categorylinks');
352352 $id = $title->getArticleID();
353353 $res = $dbr->select($cl, 'cl_to', "cl_from = '$id'", __METHOD__, array('ORDER BY' => 'cl_sortkey'));
Index: trunk/extensions/EmailPage/EmailPage_body.php
@@ -165,7 +165,7 @@
166166 return false;
167167 }
168168
169 - $db = &wfGetDB(DB_SLAVE);
 169+ $db = wfGetDB(DB_SLAVE);
170170 $title = Title::newFromText($this->title);
171171 $opt = new ParserOptions;
172172

Status & tagging log