Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -608,6 +608,17 @@ |
609 | 609 | } |
610 | 610 | } |
611 | 611 | |
| 612 | + /** |
| 613 | + * Called by unserialize. Needed to reopen DB connection, which |
| 614 | + * is not saved by serialize. |
| 615 | + */ |
| 616 | + public function __wakeup() { |
| 617 | + if ( $this->isOpen() ) { |
| 618 | + $this->open( $this->mServer, $this->mUser, |
| 619 | + $this->mPassword, $this->mDBname); |
| 620 | + } |
| 621 | + } |
| 622 | + |
612 | 623 | /** |
613 | 624 | * Same as new DatabaseMysql( ... ), kept for backward compatibility |
614 | 625 | * @deprecated since 1.17 |