r90203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90202‎ | r90203 | r90204 >
Date:14:35, 16 June 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
address bug 29431
Modified paths:
  • /trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php
@@ -107,11 +107,16 @@
108108 }
109109
110110 protected function getResultText( SMWQueryResult $res, $outputmode ) {
 111+ if ( !is_callable( 'renderGraphviz' ) ) {
 112+ wfWarn( 'The SRF Graph printer needs the GraphViz extension to be installed.' );
 113+ return '';
 114+ }
 115+
111116 global $wgGraphVizSettings;
112117 $this->isHTML = true;
113118
114119 $graphInput = "digraph $this->m_graphName {";
115 - if ( $this->m_graphSize != '' ) $graphInput .= "size=\"$this->m_graphSize\";"; // pack=true; layout=dot;
 120+ if ( $this->m_graphSize != '' ) $graphInput .= "size=\"$this->m_graphSize\";";
116121 if ( $this->m_nodeShape ) $graphInput .= "node [shape=$this->m_nodeShape];";
117122 $graphInput .= "rankdir=$this->m_rankdir;";
118123
@@ -119,7 +124,7 @@
120125 $graphInput .= $this->getGVForItem( $row, $outputmode );
121126 }
122127
123 - $graphInput .= "}";//var_dump($graphInput);exit;
 128+ $graphInput .= "}";
124129
125130 // Calls renderGraphViz function from MediaWiki GraphViz extension
126131 $result = renderGraphviz( $graphInput );
Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php
@@ -162,6 +162,11 @@
163163 *
164164 */
165165 protected function getResultText( SMWQueryResult $res, $outputmode ) {
 166+ if ( !is_callable( 'renderGraphviz' ) ) {
 167+ wfWarn( 'The SRF Graph printer needs the GraphViz extension to be installed.' );
 168+ return '';
 169+ }
 170+
166171 global $wgContLang; // content language object
167172
168173 //