Reverted r70151 and re-did what it was intended to do in a proper way: instead of...
authorMax Semenik <maxsem@users.mediawiki.org>
Sat, 23 Oct 2010 11:16:44 +0000 (11:16 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sat, 23 Oct 2010 11:16:44 +0000 (11:16 +0000)
includes/BacklinkCache.php
includes/db/DatabaseSqlite.php

index b23fd56..02b0f17 100644 (file)
@@ -21,6 +21,14 @@ class BacklinkCache {
                $this->title = $title;
        }
 
+       /**
+        * Serialization handler, diasallows to serialize the database to prevent
+        * failures after this class is deserialized from cache with dead DB connection.
+        */
+       function __sleep() {
+               return array( 'partitionCache', 'fullResultCache', 'title' );
+       }
+
        /**
         * Clear locally stored data
         */
index 3663d31..103744a 100644 (file)
@@ -34,16 +34,6 @@ class DatabaseSqlite extends DatabaseBase {
                }
        }
 
-       /**
-        * Serialization handler, see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep
-        * for details. Instances of this class sometimes get serialized, e.g. with Title and its BacklinkCache
-        * Because attempts to serialize mConn end in "can't serialize PDO objects" exceptions, we simply disallow
-        * to serialize anything in this class.
-        */
-       function __sleep() {
-               return array();
-       }
-
        function getType() {
                return 'sqlite';
        }