public function getSession( WebRequest $request ) {
$index = ++$this->curIndex;
$this->requests[$index] = $request;
- $session = new Session( $this, $index );
+ $session = new Session( $this, $index, $this->logger );
return $session;
}
* @return \ScopedCallback When this goes out of scope, a save will be triggered
*/
public function delaySave() {
- $that = $this;
$this->delaySave++;
- $ref = &$this->delaySave;
- return new \ScopedCallback( function () use ( $that, &$ref ) {
- if ( --$ref <= 0 ) {
- $ref = 0;
- $that->save();
+ return new \ScopedCallback( function () {
+ if ( --$this->delaySave <= 0 ) {
+ $this->delaySave = 0;
+ $this->save();
}
} );
}
private function checkPHPSession() {
if ( !$this->checkPHPSessionRecursionGuard ) {
$this->checkPHPSessionRecursionGuard = true;
- $ref = &$this->checkPHPSessionRecursionGuard;
- $reset = new \ScopedCallback( function () use ( &$ref ) {
- $ref = false;
+ $reset = new \ScopedCallback( function () {
+ $this->checkPHPSessionRecursionGuard = false;
} );
if ( $this->usePhpSessionHandling && session_id() === '' && PHPSessionHandler::isEnabled() &&