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

Commit 52368e0

Browse files
committed
fix a bug of wrong instance check for lumen which will cause serious memory leak problem.
1 parent 1801e8d commit 52368e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Server/Application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace SwooleTW\Http\Server;
44

5-
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
5+
use Illuminate\Container\Container;
66
use Illuminate\Contracts\Http\Kernel;
77
use Illuminate\Http\Request;
88

@@ -86,7 +86,7 @@ protected function loadApplication()
8686
*/
8787
public function getApplication()
8888
{
89-
if (! $this->application instanceof ApplicationContract) {
89+
if (!$this->application instanceof Container) {
9090
$this->application = $this->loadApplication();
9191
}
9292

@@ -98,7 +98,7 @@ public function getApplication()
9898
*/
9999
public function getKernel()
100100
{
101-
if (! $this->kernel instanceof Kernel) {
101+
if (!$this->kernel instanceof Kernel) {
102102
$this->kernel = $this->getApplication()->make(Kernel::class);
103103
}
104104

@@ -175,7 +175,7 @@ protected function setFramework($framework)
175175
{
176176
$framework = strtolower($framework);
177177

178-
if (! in_array($framework, ['laravel', 'lumen'])) {
178+
if (!in_array($framework, ['laravel', 'lumen'])) {
179179
throw new \Exception(sprintf('Not support framework "%s".', $this->framework));
180180
}
181181

0 commit comments

Comments
 (0)