Fix Status serialization with cleanupCallback as Closure
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 3 Oct 2014 15:57:31 +0000 (11:57 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 3 Oct 2014 16:02:20 +0000 (12:02 -0400)
commit2120bda6f26004ab1be34877fd880b0f01a01902
tree43fcdbb340f76c945f7bfd4abbe94def1f304ebf
parent31f73c4213eaef435010df42cb943f143b5bac32
Fix Status serialization with cleanupCallback as Closure

We already have Status objects throw away the cleanupCallback in
__wakeup. Why not also implement __sleep to not save it in the first
place?

The immediate motivation here is that cleanupCallback could be a
Closure, which causes an exception when serialization is attempted (e.g.
when trying to save the Status if an AssembleUploadChunks job fails
verification).

Note this leaves __wakeup intact, in case of old objects where
cleanupCallback is still present in the serialized representation.

Change-Id: I3aa756cd4eb5553ce0b95e7088b929b2f529abfe
includes/Status.php