Revert r78000 (removing PHP version from environment checks), never got a chance...
[lhc/web/wiklou.git] / includes / BagOStuff.php
index 70a87a7..7f40001 100644 (file)
@@ -863,9 +863,11 @@ class WinCacheBagOStuff extends BagOStuff {
         * @return bool
         */
        public function set( $key, $value, $expire = 0 ) {
-               wincache_ucache_set( $key, serialize( $value ), $expire );
+               $result = wincache_ucache_set( $key, serialize( $value ), $expire );
 
-               return true;
+               /* wincache_ucache_set returns an empty array on success if $value
+                  was an array, bool otherwise */
+               return ( is_array( $result ) && $result === array() ) || $result;
        }
 
        /**
@@ -886,6 +888,10 @@ class WinCacheBagOStuff extends BagOStuff {
                $list = $info['ucache_entries'];
                $keys = array();
 
+               if ( is_null( $list ) ) {
+                       return array();
+               }
+
                foreach ( $list as $entry ) {
                        $keys[] = $entry['key_name'];
                }