Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -608,15 +608,13 @@ |
609 | 609 | } |
610 | 610 | } |
611 | 611 | |
612 | | - /** |
613 | | - * Called by unserialize. Needed to reopen DB connection, which |
614 | | - * is not saved by serialize. |
| 612 | + /** |
| 613 | + * Called by serialize. Throw an exception when DB connection is serialized. |
| 614 | + * This causes problems on some database engines because the connection is |
| 615 | + * not restored on unserialize. |
615 | 616 | */ |
616 | | - public function __wakeup() { |
617 | | - if ( $this->isOpen() ) { |
618 | | - $this->open( $this->mServer, $this->mUser, |
619 | | - $this->mPassword, $this->mDBname); |
620 | | - } |
| 617 | + public function __sleep() { |
| 618 | + throw new MWException( 'Database serialization may cause problems, since the connection is not restored on wakeup.' ); |
621 | 619 | } |
622 | 620 | |
623 | 621 | /** |