r47589 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47588‎ | r47589 | r47590 >
Date:21:11, 20 February 2009
Author:jnatividad
Status:deferred
Tags:
Comment:
fixed bug 17573 - eliminate possible hash collisions in cache; removed redundant not when checking csv imageformat; made headers=hide default setting; improved README readability
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Ploticus/README (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Ploticus/SRF_Ploticus.php
@@ -36,7 +36,7 @@
3737 protected $m_tblheight = '';
3838 protected $m_width = '';
3939 protected $m_height = '';
40 - protected $m_params = array();
 40+ protected $mShowHeaders = false; // override and make it false by default coz of current known overflow problem with Ploticus
4141
4242 protected function readParameters($params, $outputmode) {
4343 SMWResultPrinter::readParameters($params, $outputmode);
@@ -94,6 +94,13 @@
9595 if (array_key_exists('height', $this->m_params)) {
9696 $this->m_height = trim($params['height']);
9797 }
 98+ if (array_key_exists('headers', $this->m_params)) {
 99+ if ( 'hide' == strtolower(trim($params['headers']))) {
 100+ $this->mShowHeaders = false;
 101+ } else {
 102+ $this->mShowHeaders = true;
 103+ }
 104+ }
98105 }
99106
100107 protected function getResultText($res, $outputmode) {
@@ -176,8 +183,8 @@
177184
178185 // we create a hash based on params
179186 // this is a great way to see if the params and/or the query result has changed
180 - $hashname = hash('md5', implode(',',$this->m_params));
181 - if (!$this->m_imageformat != 'csv' && $this->m_liveupdating) {
 187+ $hashname = hash('md5', $smwgIQRunningNumber . implode(',',$this->m_params));
 188+ if ($this->m_imageformat != 'csv' && $this->m_liveupdating) {
182189 // only include contents of result csv in hash when liveupdating is on and imageformat != csv
183190 // in this way, doing file_exists check against hash filename will fail when query result has changed
184191 $hashname .= hash_file('md5',$tmpFile);
Index: trunk/extensions/SemanticResultFormats/Ploticus/README
@@ -9,8 +9,8 @@
1010 2) Ploticus 2.40 (http://ploticus.sourceforge.net).
1111 Patch required if you plan to use SVG/SVGZ formats with imagemaps. (see Imagemap section below)
1212
13 -When both of them are up and running, you can install this extension like
14 -any other semantic result printer (refer to the separate README for that).
 13+When both required systems are up and running, you can install this extension like
 14+any other semantic result printer (refer to the Semantic Result Formats README for that).
1515
1616 LocalSettings.php Modifications:
1717 -------------------------------
@@ -25,8 +25,8 @@
2626 E.g. if you plan to use additional fonts in SWF files
2727 SWF_FONTS_DIR=/usr/share/ming/fonts/ttf-dejavu/fdb
2828
29 - E.g. set global ploticus config parameters with a config file. See ./ploticus-addons/ploticus.config for a sample config file and
30 - http://ploticus.sourceforge.net/doc/config.html for more info.
 29+ E.g. if you plan to set global ploticus config parameters with a config file.
 30+ See ./ploticus-addons/ploticus.config for a sample config file and http://ploticus.sourceforge.net/doc/config.html for more info.
3131 PLOTICUS_CONFIG=/etc/ploticus/ploticus.config
3232
3333 Remember, you can pass multiple environment variables, e.g.
@@ -48,10 +48,10 @@
4949 0 0 * * * MW_INSTALL_PATH=/var/www/wiki /usr/bin/php /var/www/wiki/extension/SemanticResultFormats/Ploticus/SRF_Ploticus_cleanCache.php -v 2>&1 > /var/log/ploticus_cleanCache.log
5050
5151 * $wgEnableUploads (default: false - this is a MediaWiki setting)
52 - - must be true. Be sure the upload directory has the proper permissions. If you wish to use SRF-Ploticus without enabling uploads,
53 - you can manually create the 'ploticus' directory under the MW upload. Further, under the ploticus directory, subdirectories from 0 to f hex
54 - (e.g. 0,1,2,3...9,a,b,c,d,e,f) should also be created, all with permission 777.
55 - (see http://www.mediawiki.org/wiki/Manual:$wgUploadPath)
 52+ - must be true. Be sure the upload directory has the proper permissions. (see http://www.mediawiki.org/wiki/Manual:$wgUploadPath)
 53+ If you MUST use SRF-Ploticus without enabling uploads, you can manually create the 'ploticus' directory under the
 54+ MediaWiki upload directory (Typically, MW_INSTALL_PATH/images). Further, under the ploticus directory, subdirectories from
 55+ 0 to f hex (e.g. 0,1,2...9,a,b,c,d,e,f) should also be created, all with permission 777.
5656
5757 == Configuration and Usage ==
5858
@@ -234,7 +234,7 @@
235235 At the moment, SRF-Ploticus corrects the clickmap URL targets for PNG, GIF and JPEG raster formats, swapping out the + for _.
236236 SVG clickmaps will require the patch to work properly.
237237
238 -Once the patch is applied, a new PLOTICUS_CONFIG parameter is now available - encodeclickmapurls. This should be set to
 238+Once the patch is applied, a new PLOTICUS_CONFIG parameter is exposed - encodeclickmapurls. This should be set to
239239 yes in the PLOTICUS_CONFIG file (e.g. encodeclickmapurls: yes). See http://ploticus.sourceforge.net/doc/config.html.
240240
241241

Follow-up revisions

RevisionCommit summaryAuthorDate
r47591really fixed bug 17573 - eliminate possible hash collisions in cache. Now al...jnatividad21:27, 20 February 2009

Status & tagging log