Just use the actual global on HHVM, like we do on
Zend, but avoid hitting the warning.
This is a workaround for https://github.com/facebook/hhvm/issues/6206
Bug: T111641
Change-Id: I15ef0e90827c94a8b2609484b0dddcb78f04284c
<?php
+use Closure;
use MediaWiki\Logger\LegacySpi;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Logger\MonologSpi;
$GLOBALS[$globalKey] instanceof FauxRequest
) {
$this->mwGlobals[$globalKey] = clone $GLOBALS[$globalKey];
+ } elseif ( $GLOBALS[$globalKey] instanceof Closure ) {
+ // Serializing Closure only gives a warning on HHVM while
+ // it throws an Exception on Zend.
+ // Workaround for https://github.com/facebook/hhvm/issues/6206
+ $this->mwGlobals[$globalKey] = $GLOBALS[$globalKey];
} else {
try {
$this->mwGlobals[$globalKey] = unserialize( serialize( $GLOBALS[$globalKey] ) );