r75228 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75227‎ | r75228 | r75229 >
Date:11:16, 23 October 2010
Author:maxsem
Status:ok
Tags:
Comment:
Reverted r70151 and re-did what it was intended to do in a proper way: instead of just quietly serializing a crippled connection, fix the caller and receive nice exceptions when something else is broken instead of bug-hunting later.
Modified paths:
  • /trunk/phase3/includes/BacklinkCache.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseSqlite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseSqlite.php
@@ -34,16 +34,6 @@
3535 }
3636 }
3737
38 - /**
39 - * Serialization handler, see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep
40 - * for details. Instances of this class sometimes get serialized, e.g. with Title and its BacklinkCache
41 - * Because attempts to serialize mConn end in "can't serialize PDO objects" exceptions, we simply disallow
42 - * to serialize anything in this class.
43 - */
44 - function __sleep() {
45 - return array();
46 - }
47 -
4838 function getType() {
4939 return 'sqlite';
5040 }
Index: trunk/phase3/includes/BacklinkCache.php
@@ -22,6 +22,14 @@
2323 }
2424
2525 /**
 26+ * Serialization handler, diasallows to serialize the database to prevent
 27+ * failures after this class is deserialized from cache with dead DB connection.
 28+ */
 29+ function __sleep() {
 30+ return array( 'partitionCache', 'fullResultCache', 'title' );
 31+ }
 32+
 33+ /**
2634 * Clear locally stored data
2735 */
2836 function clear() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70151Fixed exceptions on attempts to serialize DatabaseSqlite. Encountered today b...maxsem18:17, 29 July 2010

Status & tagging log