Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit ef8e5b4

Browse files
committed
fix rebindKernelContainer
1 parent 34d2e68 commit ef8e5b4

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Server/Application.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,21 @@ protected function preResolveInstances($application)
426426
}
427427
}
428428

429+
/**
430+
* Rebind laravel's container in kernel.
431+
*/
432+
protected function rebindKernelContainer($kernel)
433+
{
434+
$application = $this->application;
435+
436+
$closure = function () use ($application) {
437+
$this->app = $application;
438+
};
439+
440+
$resetKernel = $closure->bindTo($kernel, $kernel);
441+
$resetKernel();
442+
}
443+
429444
/**
430445
* Clone laravel app and kernel while being cloned.
431446
*/
@@ -436,7 +451,7 @@ public function __clone()
436451
$this->application = $application;
437452

438453
if ($this->framework === 'laravel') {
439-
$this->kernel->setApplication($application);
454+
$this->rebindKernelContainer($this->kernel);
440455
}
441456
}
442457
}

0 commit comments

Comments
 (0)