Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -101,6 +101,7 @@ |
102 | 102 | */ |
103 | 103 | static function softwareInformation() { |
104 | 104 | global $wgUseImageMagick, $wgImageMagickConvertCommand, $wgDiff3, $wgDiff; |
| 105 | + global $wgAllowTitlesInSVG, $wgSVGConverter, $wgSVGConverters, $wgSVGConverterPath; |
105 | 106 | $dbr = wfGetDB( DB_SLAVE ); |
106 | 107 | |
107 | 108 | // Put the software in an array of form 'name' => 'version'. All messages should |
— | — | @@ -116,6 +117,7 @@ |
117 | 118 | $swDiff3Info = self::execOutput( $wgDiff3 . ' -v' ); |
118 | 119 | $swDiff3Line = explode("\n",$swDiff3Info ,2); |
119 | 120 | $swDiff3Ver = $swDiff3Line[0]; |
| 121 | + $swDiff3Ver = str_replace( 'diff3 (GNU diffutils) ', '' , $swDiff3Ver); |
120 | 122 | $software['[http://www.gnu.org/software/diffutils/diffutils.html diff3]'] = $swDiff3Ver; |
121 | 123 | } |
122 | 124 | |
— | — | @@ -124,11 +126,12 @@ |
125 | 127 | $swDiffInfo = self::execOutput( $wgDiff . ' -v' ); |
126 | 128 | $swDiffLine = explode("\n",$swDiffInfo ,2); |
127 | 129 | $swDiffVer = $swDiffLine[0]; |
| 130 | + $swDiffVer = str_replace( 'diff (GNU diffutils) ', '' , $swDiffVer); |
128 | 131 | $software['[http://www.gnu.org/software/diffutils/diffutils.html diff]'] = $swDiffVer; |
129 | 132 | } |
130 | 133 | |
131 | 134 | // Look for ImageMagick's version, if did not found, try to find the GD library version |
132 | | - if ( $wgUseImageMagick === true ) { |
| 135 | + if ( $wgUseImageMagick ) { |
133 | 136 | if ( file_exists( trim( $wgImageMagickConvertCommand, '"' ) ) ) { |
134 | 137 | $swImageMagickInfo = self::execOutput( $wgImageMagickConvertCommand . ' -version' ); |
135 | 138 | list( $head, $tail ) = explode( 'ImageMagick', $swImageMagickInfo ); |
— | — | @@ -148,6 +151,47 @@ |
149 | 152 | } |
150 | 153 | } |
151 | 154 | |
| 155 | + // Look for SVG converter and print the version info |
| 156 | + if ( $wgAllowTitlesInSVG ) { |
| 157 | + $swSVGConvName = $wgSVGConverter; |
| 158 | + $haveSVGConvVer = false; |
| 159 | + $pathVar = '$path/'; |
| 160 | + $execPath = strtok(strstr($wgSVGConverters[$wgSVGConverter],$pathVar), ' '); |
| 161 | + $execPath = substr_replace($execPath, '', 0, strlen($pathVar)); |
| 162 | + $execFullPath = trim($wgSVGConverterPath,'"') . $execPath; |
| 163 | + if (strstr($execFullPath, ' ') != false) { |
| 164 | + $execFullPath = '"'.$execFullPath.'"'; |
| 165 | + } |
| 166 | + if ( !strcmp( $wgSVGConverter, 'ImageMagick') ) { |
| 167 | + // Get version info for ImageMagick |
| 168 | + if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) |
| 169 | + $swSVGConvInfo = self::execOutput( $execFullPath . ' -version' ); |
| 170 | + list( $head, $tail ) = explode( 'ImageMagick', $swSVGConvInfo ); |
| 171 | + list( $swSVGConvVer ) = explode('http://www.imagemagick.org', $tail ); |
| 172 | + $swSVGConvURL = 'http://www.imagemagick.org/'; |
| 173 | + $haveSVGConvVer = true; |
| 174 | + } else if (strstr ($execFullPath, 'rsvg') != false) { |
| 175 | + // Get version info for rsvg |
| 176 | + if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) |
| 177 | + $swSVGConvInfo = self::execOutput( $execFullPath . ' -v' ); |
| 178 | + $swSVGConvLine = explode("\n",$swSVGConvInfo ,2); |
| 179 | + $swSVGConvVer = $swSVGConvLine[0]; |
| 180 | + $swSVGConvURL = 'http://librsvg.sourceforge.net/'; |
| 181 | + $haveSVGConvVer = true; |
| 182 | + } else if (strstr ($execFullPath, 'inkscape') != false) { |
| 183 | + // Get version info for Inkscape |
| 184 | + if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) |
| 185 | + $swSVGConvInfo = self::execOutput( $execFullPath . ' -z -V' ); |
| 186 | + $swSVGConvLine = explode("\n",$swSVGConvInfo ,2); |
| 187 | + $swSVGConvVer = ltrim( $swSVGConvLine[0], 'Inkscape ' ); |
| 188 | + $swSVGConvURL = 'http://www.inkscape.org/'; |
| 189 | + $swSVGConvName = ucfirst( $wgSVGConverter ); |
| 190 | + $haveSVGConvVer = true; |
| 191 | + } |
| 192 | + if ( $haveSVGConvVer ) |
| 193 | + $software["[$swSVGConvURL $swSVGConvName]"] = $swSVGConvVer; |
| 194 | + } |
| 195 | + |
152 | 196 | // Allow a hook to add/remove items |
153 | 197 | wfRunHooks( 'SoftwareInfo', array( &$software ) ); |
154 | 198 | |