In MediaWikiTestCase::stashMwGlobals(), prefer shallow copies
authorOri Livneh <ori@wikimedia.org>
Wed, 11 May 2016 11:12:46 +0000 (04:12 -0700)
committerOri Livneh <ori@wikimedia.org>
Wed, 18 May 2016 17:36:44 +0000 (10:36 -0700)
commit49b162cac179a67842e15e62eeb9deb7953827eb
treeed5ec2a7bd3ce335d5e1f532208020f1361c8f10
parent33cb9e803ae020917bcc073e1599d2fdfbfb04c2
In MediaWikiTestCase::stashMwGlobals(), prefer shallow copies

MediaWikiTestCase::stashMwGlobals() performs a deep copy of globals by
serializing and then unserializing them. This is actually unwarranted in the
common case of simple scalar values and flat arrays -- and it's expensive, too.
So before attempting a deep copy, first check if a shallow copy will do.

Change-Id: Iaba1c8e1f6bae9de0a7a1fb411cac94f7e4dfb23
tests/phpunit/MediaWikiTestCase.php