http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99835

Revision: 99835
Author:   mglaser
Date:     2011-10-15 01:33:19 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
follow-up to r98020. Throw MWException on attempt to serialize database.

Modified Paths:
--------------
    trunk/phase3/includes/db/Database.php

Modified: trunk/phase3/includes/db/Database.php
===================================================================
--- trunk/phase3/includes/db/Database.php       2011-10-15 01:33:10 UTC (rev 
99834)
+++ trunk/phase3/includes/db/Database.php       2011-10-15 01:33:19 UTC (rev 
99835)
@@ -608,15 +608,13 @@
                }
        }
 
-       /**
-        * Called by unserialize. Needed to reopen DB connection, which
-        * is not saved by serialize.
+       /**
+        * Called by serialize. Throw an exception when DB connection is 
serialized.
+        * This causes problems on some database engines because the connection 
is 
+        * not restored on unserialize.
         */
-       public function __wakeup() {
-        if ( $this->isOpen() ) {
-                       $this->open( $this->mServer, $this->mUser,
-                                    $this->mPassword, $this->mDBname);
-               }
+       public function __sleep() {
+               throw new MWException( 'Database serialization may cause 
problems, since the connection is not restored on wakeup.' );
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to