r78322 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78321‎ | r78322 | r78323 >
Date:20:04, 13 December 2010
Author:btongminh
Status:resolved (Comments)
Tags:
Comment:
Follow-up r66364: wincache fixes
* Return the result of wincache_ucache_get() in get()
* In command line mode $info['ucache_entries'] returned from wincache_ucache_info() is null, so don't iterate over a non-array
Modified paths:
  • /trunk/phase3/includes/BagOStuff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/BagOStuff.php
@@ -863,9 +863,11 @@
864864 * @return bool
865865 */
866866 public function set( $key, $value, $expire = 0 ) {
867 - wincache_ucache_set( $key, serialize( $value ), $expire );
 867+ $result = wincache_ucache_set( $key, serialize( $value ), $expire );
868868
869 - return true;
 869+ /* wincache_ucache_set returns an empty array on success if $value
 870+ was an array, bool otherwise */
 871+ return ( is_array( $value ) && $result === array() ) || $result;
870872 }
871873
872874 /**
@@ -886,6 +888,10 @@
887889 $list = $info['ucache_entries'];
888890 $keys = array();
889891
 892+ if ( is_null( $list ) ) {
 893+ return array();
 894+ }
 895+
890896 foreach ( $list as $entry ) {
891897 $keys[] = $entry['key_name'];
892898 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r78373Fix for r78322, check $result not $valuedemon12:47, 14 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66364(bug 22844) Support Micosoft Windows Cache aka WINCACHEdemon17:41, 13 May 2010

Comments

#Comment by Bryan (talk | contribs)   20:10, 13 December 2010

In the commit summary, get is meant to be set.

#Comment by 😂 (talk | contribs)   20:11, 13 December 2010

I thought as much :p

#Comment by Bryan (talk | contribs)   08:44, 14 December 2010

is_array() should be on $result, not on $value, because $value gets serialized.

Status & tagging log