Kipcool has submitted this change and it was merged.

Change subject: Bug: 56220
......................................................................


Bug: 56220

Mostly documentation.

There are still query functions left.

There are those that are in unused files like Alert, SpecialTransaction,
copytest and update_bootstrap. These does not need to be changed for now,
since they are currently and may in the future be deleted, unless someone
uses these files.

Some are safe as is. RecordSetQueries and WikiDataAPI has one query
function each, but the query they execute are created by methods that
attach the database prefix, that is needed.

Then there is Copy.php. It uses php's mysql_query(), which means that
prefix is not attached by the software. Yet, only DefinedMeaningModel uses
Copy.php, and the only function it uses, CheckIfStub() is unused. This is
regarding the main program

A Special page, SpecialCopy, does use Copy.php, and if anyone is still
using this via SpecialPage Concept Mapping, then the mysql_query function
must be dealt with.  However, looking at Copy.php, I feel it is too
complex for me to fix.  If no one is using the Concept Mapping Page, Then
this bug can be labeled as fixed. If someone is going to use this special
page, then we will need to wait for someone else bold enough to fix this.
Sorry.

My contribution for this bug will only be up to this point. (In the
future, I may refactor RecordSetQueries and WikiDataAPI's query function,
and no more than that.)

Bug: 56220
Change-Id: I2a137d44786c0dec61c46ad20cb943097cd93e90
---
M OmegaWiki/Alert.php
M OmegaWiki/WikiDataAPI.php
M TODO.md
3 files changed, 30 insertions(+), 1 deletion(-)

Approvals:
  Kipcool: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/OmegaWiki/Alert.php b/OmegaWiki/Alert.php
index eae8e8a..9c23df4 100644
--- a/OmegaWiki/Alert.php
+++ b/OmegaWiki/Alert.php
@@ -1,4 +1,6 @@
 <?php
+/** @note this file is unused.
+ */
 
 require_once( "WikiDataAPI.php" );
 
diff --git a/OmegaWiki/WikiDataAPI.php b/OmegaWiki/WikiDataAPI.php
index 74aa70d..ff07d55 100644
--- a/OmegaWiki/WikiDataAPI.php
+++ b/OmegaWiki/WikiDataAPI.php
@@ -2094,11 +2094,14 @@
        return false;
 }
 
+/** @note function not used by the main OmegaWiki program.
+ */
 function getCollectionContents( $collectionId ) {
        global $wgWikidataDataSet;
 
        $dc = wdGetDataSetContext();
        $dbr = wfGetDB( DB_SLAVE );
+
        $queryResult = $dbr->query(
                selectLatest(
                        array( 
$wgWikidataDataSet->collectionMemberships->memberMid, 
$wgWikidataDataSet->collectionMemberships->internalMemberId ),
diff --git a/TODO.md b/TODO.md
index 0a52b5f..fef1d22 100644
--- a/TODO.md
+++ b/TODO.md
@@ -16,6 +16,12 @@
 * Start making use of recordhelpers
 * Refurbish the attribute system
 * Change WikiLexicalData globals prefixed with $wd to $wgWld.
+* WikiDataAPI and RecordSetQueries still have query() functions.
+  Thought the functions used to generate the SQL is good, it is
+  generally not ideal to use the generalized query() function.
+* There are mysql_query functions used in Copy.php are not currently
+  in use. If you decide to use them, kindly refactor the fuctions to
+  use MediaWiki's database function.
 
 Deferred Items (take into account)
 ----------------------------------
@@ -27,5 +33,23 @@
 Unit Testing
 ------------
 * Extend unit testing framework to also safely test on its own database.
-  Since wikidata is somewhat database based, this should allow testing
+  Since WikiLexicalData is somewhat database based, this should allow testing
   of a majority of the code.
+
+Decide upon unused files Unused
+-------------------------------
+The following files are unused.
+       * Alert.php
+       * SpecialTransaction.php
+       * copytest.php (broken)
+       * GotoSourceTemplate.php
+       * Skel.php
+       * update_bootstrap.php
+       * ApiWikiData (broken)
+       * ApiWikiDataFormatBase (broken)
+       * ApiWikiDataFormatXml (broken)
+       * Search.php ( maybe replaced by the SpecialSearch.php?)
+
+If no one is using them, these are candidates for deletion. In case someone 
have
+plans to use Alert.php, SpecialTransaction.php and copytest, Kindly refactor 
the
+query functions to select functions.

-- 
To view, visit https://gerrit.wikimedia.org/r/135511
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2a137d44786c0dec61c46ad20cb943097cd93e90
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Hiong3-eng5 <hiong3.e...@gmail.com>
Gerrit-Reviewer: Kipcool <kipmas...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to