From: Brad Jorsch Date: Mon, 3 Dec 2012 20:24:37 +0000 (-0500) Subject: (bug 42483) Avoid serializing database object in update.php X-Git-Tag: 1.31.0-rc.0~21437^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=331da5d47124aeaa12186354d7c963d05cd54694;p=lhc%2Fweb%2Fwiklou.git (bug 42483) Avoid serializing database object in update.php Change I96b4cfd4 changed the data being stored in updatelog, trying to store the mangled parameters (which may included an added copy of the DatabaseUpdater object itself) instead of the input parameters. This causes warnings because database objects cannot be effectively serialized. Go back to storing the original input parameters instead. Change-Id: I96e6dffed98772ebb9b812773ff2f608e7e40cb1 --- diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 312b79660e..b200dcf161 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -321,9 +321,10 @@ abstract class DatabaseUpdater { foreach( $updates as $funcList ) { $func = $funcList[0]; $arg = $funcList[1]; + $origParams = $funcList[2]; $ret = call_user_func_array( $func, $arg ); flush(); - $this->updatesSkipped[] = $arg; + $this->updatesSkipped[] = $origParams; } } @@ -380,6 +381,7 @@ abstract class DatabaseUpdater { $updatesDone = array(); $updatesSkipped = array(); foreach ( $updates as $params ) { + $origParams = $params; $func = array_shift( $params ); if( !is_array( $func ) && method_exists( $this, $func ) ) { $func = array( $this, $func ); @@ -389,9 +391,9 @@ abstract class DatabaseUpdater { $ret = call_user_func_array( $func, $params ); flush(); if( $ret !== false ) { - $updatesDone[] = $params; + $updatesDone[] = $origParams; } else { - $updatesSkipped[] = array( $func, $params ); + $updatesSkipped[] = array( $func, $params, $origParams ); } } $this->updatesSkipped = array_merge( $this->updatesSkipped, $updatesSkipped );