Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371206 )

Change subject: Rename CargoHierarchy.php and its class variable
......................................................................


Rename CargoHierarchy.php and its class variable

Change-Id: Iff9694bcc519851ee696e1881aa5bc07f792850c
---
M Cargo.php
R CargoHierarchyTree.php
M CargoUtils.php
M drilldown/CargoDrilldownHierarchy.php
M drilldown/CargoSpecialDrilldown.php
M extension.json
6 files changed, 16 insertions(+), 16 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  Nischayn22: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/Cargo.php b/Cargo.php
index 35fe54f..e5e5508 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -82,7 +82,7 @@
 $wgAutoloadClasses['CargoUtils'] = $dir . '/CargoUtils.php';
 $wgAutoloadClasses['CargoFieldDescription'] = $dir . 
'/CargoFieldDescription.php';
 $wgAutoloadClasses['CargoTableSchema'] = $dir . '/CargoTableSchema.php';
-$wgAutoloadClasses['CargoHierarchy'] = $dir . '/CargoHierarchy.php';
+$wgAutoloadClasses['CargoHierarchyTree'] = $dir . '/CargoHierarchyTree.php';
 $wgAutoloadClasses['CargoDeclare'] = $dir . 
'/parserfunctions/CargoDeclare.php';
 $wgAutoloadClasses['CargoAttach'] = $dir . '/parserfunctions/CargoAttach.php';
 $wgAutoloadClasses['CargoStore'] = $dir . '/parserfunctions/CargoStore.php';
diff --git a/CargoHierarchy.php b/CargoHierarchyTree.php
similarity index 90%
rename from CargoHierarchy.php
rename to CargoHierarchyTree.php
index 18caaf8..3eec753 100644
--- a/CargoHierarchy.php
+++ b/CargoHierarchyTree.php
@@ -1,20 +1,20 @@
 <?php
 /**
-* CargoHierarchy - holds the tree for hierarchy inorder to implement Nested 
Set model for
+* CargoHierarchyTree - holds the tree for hierarchy inorder to implement 
Nested Set model for
 * efficient storage and query of hierarchy fields.
 *
 * @author Feroz Ahmad
 * @ingroup Cargo
 */
 
-class CargoHierarchy {
-       public $mTitle;
+class CargoHierarchyTree {
+       public $mRootValue;
        public $mChildren;
        public $mLeft = 0;
        public $mRight = 0;
 
        function __construct( $curTitle = '__pseudo_root__' ) {
-               $this->mTitle = $curTitle;
+               $this->mRootValue = $curTitle;
                $this->mChildren = array();
        }
 
@@ -62,7 +62,7 @@
                while ( !$stack->isEmpty() ) {
                        $node = $stack->pop();
                        $row = array();
-                       $row['_value'] = $node->mTitle;
+                       $row['_value'] = $node->mRootValue;
                        $row['_left'] = $node->mLeft;
                        $row['_right'] = $node->mRight;
                        $tableData[] = $row;
diff --git a/CargoUtils.php b/CargoUtils.php
index a1686be..d8628a4 100644
--- a/CargoUtils.php
+++ b/CargoUtils.php
@@ -732,7 +732,7 @@
                                $cdb->query( $createIndexSQL );
                                $fieldHelperTableNames[] = 
$fieldHelperTableName;
                                // Insert hierarchy information in the 
__hierarchy table
-                               $hierarchyTree = 
CargoHierarchy::newFromWikiText( $fieldDescription->mHierarchyStructure );
+                               $hierarchyTree = 
CargoHierarchyTree::newFromWikiText( $fieldDescription->mHierarchyStructure );
                                $hierarchyStructureTableData = 
$hierarchyTree->generateHierarchyStructureTableData();
                                foreach( $hierarchyStructureTableData as $entry 
) {
                                        $cdb->insert( $fieldHelperTableName, 
$entry );
diff --git a/drilldown/CargoDrilldownHierarchy.php 
b/drilldown/CargoDrilldownHierarchy.php
index 42598a0..07f889b 100644
--- a/drilldown/CargoDrilldownHierarchy.php
+++ b/drilldown/CargoDrilldownHierarchy.php
@@ -6,7 +6,7 @@
  * @ingroup Cargo
  */
 
-class CargoDrilldownHierarchy extends CargoHierarchy {
+class CargoDrilldownHierarchy extends CargoHierarchyTree {
        public $mWithinTreeMatchCount = 0;
        public $mExactRootMatchCount = 0;
 
@@ -67,11 +67,11 @@
                        if ( $node->mLeft !== 1 ) {
                                // check if its not __pseudo_root__ node, then 
only add count
                                
CargoDrilldownHierarchy::computeNodeCountByFilter( $node, $f, 
$fullTextSearchTerm, $appliedFilters );
-                               $filter_values[$node->mTitle] = 
$node->mWithinTreeMatchCount;
+                               $filter_values[$node->mRootValue] = 
$node->mWithinTreeMatchCount;
                        }
                        if ( count( $node->mChildren ) > 0 ) {
                                if ( $node->mLeft !== 1 ) {
-                                       $filter_values[$node->mTitle . " only"] 
= $node->mWithinTreeMatchCount;
+                                       $filter_values[$node->mRootValue . " 
only"] = $node->mWithinTreeMatchCount;
                                }
                                for ( $i = count( $node->mChildren ) - 1; $i >= 
0; $i-- ) {
                                        $stack->push( $node->mChildren[$i] );
diff --git a/drilldown/CargoSpecialDrilldown.php 
b/drilldown/CargoSpecialDrilldown.php
index 7f7e062..b89561a 100644
--- a/drilldown/CargoSpecialDrilldown.php
+++ b/drilldown/CargoSpecialDrilldown.php
@@ -499,7 +499,7 @@
 
        function printUnappliedFilterValuesForHierarchy( $cur_url, $f, 
$fullTextSearchTerm, $applied_filters ) {
                $results_line = "";
-               // construct the tree of CargoHierarchy
+               // construct the tree of CargoDrilldownHierarchy
                $drilldownHierarchyTreeRoot = 
CargoDrilldownHierarchy::newFromWikiText( 
$f->fieldDescription->mHierarchyStructure );
                // compute counts
                $filter_values = 
CargoDrilldownHierarchy::computeNodeCountForTreeByFilter( 
$drilldownHierarchyTreeRoot,
@@ -518,18 +518,18 @@
                                        }
                                        // generate a url to encode WITHIN 
search information by a "~within_" prefix in value_str
                                        $filter_url = $cur_url . urlencode( 
str_replace( ' ', '_', $f->name ) ) . '=' .
-                                               urlencode( str_replace( ' ', 
'_', "~within_" . $node->mTitle ) );
+                                               urlencode( str_replace( ' ', 
'_', "~within_" . $node->mRootValue ) );
                                        // generate respective <a> tag with 
value and its count
-                                       $results_line .= 
$this->printFilterValueLink( $f, $node->mTitle,
+                                       $results_line .= 
$this->printFilterValueLink( $f, $node->mRootValue,
                                                $node->mWithinTreeMatchCount, 
$filter_url, $filter_values );
                                }
                                if ( count( $node->mChildren ) > 0 ) {
                                        if ( $node->mLeft !== 1 ) {
                                                $filter_url = $cur_url . 
urlencode( str_replace( ' ', '_', $f->name ) ) . '=' .
-                                                       urlencode( str_replace( 
' ', '_', $node->mTitle ) );
+                                                       urlencode( str_replace( 
' ', '_', $node->mRootValue ) );
                                                $results_line .= " ยท ";
                                                $results_line .= "(" . 
$this->printFilterValueLink( $f,
-                                                       wfMessage( 
'cargo-drilldown-hierarchy-only', $node->mTitle )->parse() ,
+                                                       wfMessage( 
'cargo-drilldown-hierarchy-only', $node->mRootValue )->parse() ,
                                                        
$node->mExactRootMatchCount, $filter_url, $filter_values );
                                                $stack->push( ")" );
                                        }
diff --git a/extension.json b/extension.json
index 4d124ec..442d6f6 100755
--- a/extension.json
+++ b/extension.json
@@ -45,7 +45,7 @@
                "CargoUtils": "CargoUtils.php",
                "CargoFieldDescription": "CargoFieldDescription.php",
                "CargoTableSchema": "CargoTableSchema.php",
-               "CargoHierarchy": "CargoHierarchy.php",
+               "CargoHierarchyTree": "CargoHierarchyTree.php",
                "CargoDeclare": "parserfunctions/CargoDeclare.php",
                "CargoAttach": "parserfunctions/CargoAttach.php",
                "CargoStore": "parserfunctions/CargoStore.php",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff9694bcc519851ee696e1881aa5bc07f792850c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Fz-29 <f29ah...@gmail.com>
Gerrit-Reviewer: MarcoAurelio <maure...@tools.wmflabs.org>
Gerrit-Reviewer: Nischayn22 <nischay...@gmail.com>
Gerrit-Reviewer: Oetterer <oette...@uni-paderborn.de>
Gerrit-Reviewer: Yaron Koren <yaro...@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