Add StubObject::unstub, and use it for $wgAuth->getUserInstance()
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 11 Sep 2013 19:55:15 +0000 (12:55 -0700)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 11 Sep 2013 20:11:20 +0000 (13:11 -0700)
commit37ed022c25d715e9434557cb32d197afa41bfee5
treeb73122bc44622892cb904da256674b6a8f4a511b
parentc8a2f0db31e9742c155bac7ae1f87fbec2c926d4
Add StubObject::unstub, and use it for $wgAuth->getUserInstance()

PHP's __call magic method can't handle functions with reference
parameters correctly,[1] which means that we need to manually unstub
StubObjects before calling such a method. Or you could use call-time
pass by reference with call_user_func_array, which is rather backwards
and verbose.

This change adds a convenience function to do this, and applies it to
the two calls which brought it to my attention.

[1]: https://bugs.php.net/bug.php?id=40694,
https://bugs.php.net/bug.php?id=62455

Change-Id: I74a0c04bf358e164f753b82fbefbd6205d9b2451
includes/StubObject.php
includes/User.php