r98234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98233‎ | r98234 | r98235 >
Date:18:42, 27 September 2011
Author:reedy
Status:deferred (Comments)
Tags:
Comment:
Do something with the deployments tab
Modified paths:
  • /trunk/extensions/MetricsReporting/fetchGoogleSpreadsheet.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/fetchGoogleSpreadsheet.php
@@ -58,7 +58,6 @@
5959
6060 $worksheets = array();
6161 while ( $reader->name === 'entry' ) {
62 -
6362 $node = new SimpleXMLElement( $reader->readOuterXML() );
6463
6564 // Worksheet based feed
@@ -93,9 +92,13 @@
9493
9594 $this->output( 'Spreadsheet tab title: ' . $xml->title . "\n" );
9695 $this->output( "\n" );
97 -
 96+ var_dump( $xml->title );
 97+ if ( $xml->title != 'Deployments' ) {
 98+ continue;
 99+ }
 100+ //continue;
98101 $sheetData = array();
99 - // foreach "tab"
 102+ // foreach "tab"/worksheet
100103 foreach( $xml->entry as $entry ) {
101104 $namespaces = $entry->getNameSpaces( true );
102105 $gsx = $entry->children( $namespaces['gsx'] );
@@ -108,7 +111,8 @@
109112 }
110113 }
111114 $this->output( "\n" );
112 - var_dump( $sheetData );
 115+ $this->getDeploymentFigures( $sheetData );
 116+ // var_dump( $sheetData );
113117 $this->output( "\n" );
114118 }
115119
@@ -116,6 +120,21 @@
117121 }
118122
119123 /**
 124+ * @param $data array
 125+ */
 126+ function getDeploymentFigures( $data ) {
 127+ $count = count( $data["name"] );
 128+
 129+ for( $i = 0; $i < ( $count - 1 ); $i++ ) {
 130+ $data['date'][] = ''; // TODO: The date needs to come from... somewhere?
 131+ }
 132+
 133+ $db = $this->getDb();
 134+
 135+ $db->update( 'offline', $data, __METHOD__, array( 'IGNORE' ) );
 136+ }
 137+
 138+ /**
120139 * Pretty print xml string
121140 *
122141 * @param $xml string

Comments

#Comment by 😂 (talk | contribs)   20:00, 27 September 2011

Leftover var_dump()?

#Comment by Reedy (talk | contribs)   20:32, 27 September 2011

Sorta, script is not finished, but will remove it out again

Status & tagging log